I have a temperature sensor(TC74) as slave in my embedded system where in, my master is the controller MQX K70.
I am unable to communicate with the sensor on I2C communication. Need to read the temperature value from the same.
Request to please update me on the steps to do same and share an example code if any which is based on an RTOS. Thanks in Advance!!!!
I haven't used that temp sensor but looking at TC74 documentation (page 6) says the default slave address is 1001_101b. Is that what you are using?
Do you have default TC74 device or custom? The custom has a different slave address than default.
What version of MQX are you using?
MQX has simple eeprom I2C example that you could modifiy to access the temp sensor:
Thanks on the prompt reply.
No. I am using "TC74A0-3.3VCTTR: SOT-23 Serial Digital Thermal Sensor" hence the address for this would be "A0 = 1001 000". MQX version used is 4.0.
I tried the examples above. However, i see the write command failing and hence not able to do a read operation for the temp sensor.
Regarding the hardware connection, You have to connect a 4.7K ohm pull-up resistors for the SCL and SDA pins, they are open drain pins.
If you hook a oscilloscope to the SCL and SDA pins, can you see the IIC waveform? If you can not, you have to enable the IIC module gated clock and configure the IIC pin as IIC function.
If you develop IIC code based on MQX, as Mr David pointed out, you can modify the example MQX provides.
Hope it can help you.