2015-08-31 03:33 PM
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
2015-09-07 08:22 AM
Hi turkman.serhat,
I think that the actions you need to do are already managed by the HAL_I2C_Master_Receive. In fact, it do the following:1- Transmit the Start bit with slave address followed by read bit2- Received the number of desired bytes3- Send the NACK + STOP bit.So you have only to call HAL_I2C_Master_Receive. You can monitor the transferred data on the I2C bus thanks to SDA pin.-Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.