No I2C feedback: How to debug?
Posted: Thu Apr 28, 2022 7:18 pm
I connected a PN532 NFC board to my RaspberryPi Pico. Since there's no Micropython Library supporting I2C, I tried to port the Adafruit_CircuitPython_PN532, motivated by @Roberthh here in this Micropython Forum: «I have ported adafruit libraries a few times, and it was not difficult.» and mimicking the SPI port of @cgglzpy «I've actually done this».
My Problem: I can send data with my code fragment, but I don't receive an answer ("Failed to detect the PN532"). How would you geeks proceed?
What I have done:
My Problem: I can send data with my code fragment, but I don't receive an answer ("Failed to detect the PN532"). How would you geeks proceed?
What I have done:
- The writing on the chip of my board seem identical to all pictures I can find on the internet. ➝ I am confident that it is an original chip.
- The DIP Switches are configured to I2C as requested. While NXPs PN532 User Guide states in chap. 6.1.1.3 I2C interface the I2C address to be 0x48, there is no mention that the address is shifted one byte in the I2C protocol (and thus, 0x24 must be used). And the board should be «able to support a clock frequency up to 400 kHz».
- An "i2c.scan()" states the board's address not reliably (~50% success). Lowering the I2C frequency tend to improve success, but still far from reliable. Same with additional 100kΩ pull-up resistors.
- I tried to improve communication by adding IRQ and Reset lines, to reliably reset and wake up the board, but without noticeable improvement.
- Try the second board I ordered from AliExpress. ➝ I don't expect different results.
- Verify Hardware and Wiring: Reconfigure the Pico to use CircuitPython and try the Adafruit's Library. ➝ Since I never tried circuitPython I'd budget several hours for that test.
- Use the problems described above as an excuse to invest in a simple logic analyzer (i.e. LA104 for ~100 USD). ➝ Probably not very helpful for the current problem, but a nice investment .