root2hell
Member level 3
- Joined
- Aug 13, 2014
- Messages
- 63
- Helped
- 2
- Reputation
- 4
- Reaction score
- 2
- Trophy points
- 8
- Location
- India
- Activity points
- 394
i am trying to read temp sensor LM75(7 bit Slave addr=0x48) that support I2C from a microprocessor mpc8308 using evaluation kit i.e. mpc8308rdb.
I have initialized i2c module by writing FDR Resistor, I2CCR resistor with (Enable i2c module,Disable interrupt, Transmit mode, Broadcast disabled).
then in i2c_read :
1.i2c start condition
2.updating I2CDR with 7 bit addr + W_bit(0x90)
3.wait for ACK by thermal sensor by monitoring SR[RXAK] then
4.send Register addr (0x00)
5.wait for ACK by thermal sensor by monitoring SR[RXAK] then
6.updating I2CDR with 7 bit addr + R_bit(0x91)
7. Put master in Receive mode by clearing I2CCR[MTX] bit.
8. read_data=I2CDR;
But i am only getting 0xFF in read_data byte.
I have initialized i2c module by writing FDR Resistor, I2CCR resistor with (Enable i2c module,Disable interrupt, Transmit mode, Broadcast disabled).
then in i2c_read :
1.i2c start condition
2.updating I2CDR with 7 bit addr + W_bit(0x90)
3.wait for ACK by thermal sensor by monitoring SR[RXAK] then
4.send Register addr (0x00)
5.wait for ACK by thermal sensor by monitoring SR[RXAK] then
6.updating I2CDR with 7 bit addr + R_bit(0x91)
7. Put master in Receive mode by clearing I2CCR[MTX] bit.
8. read_data=I2CDR;
But i am only getting 0xFF in read_data byte.