I had interfaced a humidity sensor by going through the datasheet, user guide and application report. I have some issues related to i2c.
ACKNOWLEDGMENT NOT GIVEN FROM THE SENSOR
Issues
- Acknowledgement not given from the sensor after writing the start, write address byte of the slave, stop.
- Is the pulse width of the SCL is correct?
Things I have done to generate clock and data:
***************************************************
UCB1BR0 = 12; // fSCL =SMCLK/12 = ~100kHz
UCB1BR1 = 0;
UCB1I2CSA = 0x51; // default slave address (0x28 )given in the sensor data sheet
*******Continuous loop for Start,and Stop and Write address of Slave *****************
while(1)
{
UCB1CTL1 |= UCTXSTT; // I2C start condition
UCB1CTL1 |= UCTXSTP; // Generate I2C stop condition
}
Other than above I have set necessary configurations for USCI module.
My question as per I2C protocol and data sheet gave the Start sequence, 7-bit slave address, and write bit the calculated byte for the slave write address 0x28 are 0x51.
So I have set UCB1I2CSA = 0x51.
So, after transmitting start, slave write address the acknowledgment has to be given from the sensor in the 9th clock pulse by making the SDA line low which is not happening.
The clock pulses generated are like spikes. Are they correct? Is there anything wrong with the clock pulses.
Can anyone help me to analyze this situation? I have seen this response from the CRO.