Question
I2C how to generate NACK and STOP
Posted on September 01, 2015 at 00:33
Hello,
I'm using MCP3424 and it says in it's datasheetWhen the Master finds the RDY bit is cleared, it can send a
not-acknowledge (NAK) bit and a stop bit to exit the current
read operation and send a new read command for the latest
conversion data.
But HAL drivers does not simply let me to generate start, stop, nack.
I can read the first channel of MCP3424 but i cannot switch to channel 2 or others.
I need to make this steps,
HAL_I2C_Master_Transmit(One-Shot Conversion of Channel 1 Config);
HAL_I2C_Master_Receive(3 byte data);
I2C_Send(NACK);
I2C_Send(Stopbit);
and then
HAL_I2C_Master_Transmit(One-Shot Conversion of Channel 2 Config);
HAL_I2C_Master_Receive(3 byte data);
I2C_Send(NACK);
I2C_Send(Stopbit);
but i don't know how to send nack and stop bit to MCP3424
Any help?
Thank you.
#i2c #h