Electronics > Microcontrollers

STM32: I2C with HAL what am I doing wrong?

<< < (3/3)

Watth:

--- Quote from: DavidAlfa on January 27, 2022, 06:23:38 pm ---However, if you want to read or write to a specific register, it will fail, because it sends Start/Stops on every call.

--- End quote ---
Now that it managed to get I2C running, I tried both, and both work. So HAL_I2C_Master_Transmit() does send both bytes consecutively within the same start/stop limits.

DavidAlfa:
Yes, when the 1st byte is the command, it's equivalent, but only for writing.
The problem will come when you try to read data, as I already explained

Watth:

--- Quote from: DavidAlfa on January 28, 2022, 05:42:55 pm ---Yes, when the 1st byte is the command, it's equivalent, but only for writing.
The problem will come when you try to read data, as I already explained

--- End quote ---
Oh OK, sorry. I'm still on the writing side for now. I managed to write the PCA9535's outputs register, but still have trouble with the MAX6956:
On the MAX6956 (in my case the 36 pins PW) I managed to set some pins as LED drivers and light them up with the test function. But I have trouble understanding the datasheet and this application note to control a pin individually as a LED driver and assign it a current fraction.

Navigation

[0] Message Index

[*] Previous page

There was an error while thanking
Thanking...
Go to full version