Hello, I am testing the IPS2200 for absolute position sensing applications. I made a prototype board and the sensor seem to work fine. I can get good sin/cos analog signals at the output while rotating a metal target. Now I am trying to communicate with this sensor over I2C bus using a PIC microcontroller. The problem is, that I can write data, but I can't read it. The sensor never sends an ACK signal after it's address byte when reading, but sends it when writing. Is it possible, that I first need to write some initialization data before reading the device?
Here are the data packets recorded with digital analyzer.
READING - I don't get ACK, although the address seems to be correct.
WRITING - seems to work correctly, I get ACK after the address byte.
Here are some more details about my setup.
I use 4.7k pullup resistor on both SCL and SDA lines, the CSn_IRQN pin is pulled up as well. The oscilloscope shows clear digital signals, with steep edges and no significant noise. I tried 2.2k resistors as well, but without any difference. I tried lowering I2C bus speed from 100kHz to 50kHz and then 20kHz as well. Tried to change the IC (two times).
To make sure, that there are no issues with the microcontroller, I connected a completely different i2c device to the same setup using the same code, just changed the i2c address. It is responding properly to both read and write commands, so I assume that it the problem is on the sensor side.
What might be a possible cause for this?
Hi,
Thanks for the request. We have acknowledged your request and will update you soon.
Regards:
Raja.
Sorry for the long wait. Please see the response factory apps team:
As you are using a self-made board to evaluate the output signals. The question is: did your sensor module work properly with the Renesas Com board? If yes, then there might be an error in his microcontroller code or address.
Could you please check with our Com board and give feedback on that? Moreover, could you please tell me the end application of your project?
Hi Raja,
Thank you for your response. Indeed the problem was in the implementation of I2C on the microcontroller side. It had a bit misleading commands with not so much description and I was not that deeply familiar with I2C to immediately identify the problem. The problem was that I was trying to read the device without sending the write instruction and the register address first, therefore the device was not acknowledging my read request. Now it seems to communicate fine.Thank you for your help!
Thanks for the update. Good to hear that your problem has been resolved.
Noted with same.
hello,Could you share some code examples ?I also encountered a similar problem, but the data I read from a certain register is not fixed.
Hi, I would strongly suggest to use a digital analyzer first to make sure that you don't have electronic issues, also check the timings and etc. If the analyzer shows the same values each time, but the code reads different ones, then I would suggest looking for general I2C examples for your microcontroller platform - this is what I actually did while debugging my case.