This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I2C PN532 Problem (Clock Stretching?)

Hi,

I am trying to connect a PN532 (RFID Tag Reader module) to BLE Nano (nrf58122) using I2C. This doesn't work, and I'm trying to figure out why.

I am generating the code via Arduino IDE. The sketch compiles and works beautifully with an Arduino. However, when tested with the BLE Nano, it fails to send a command over I2C.

I think this might be related to clock stretching, however, I am not an expert in I2C communication. I tried modifying the code directly by setting the frequency to 400kHz, but that did not seem to change anything.

I am attaching the code below. Basically, success returns false on the BLE nano, but not with Arduino.

The device is connected via SDA=>P0_10, SCL=>P0_8, and has two 1.5k pull up resistors to VDD.


Wire.begin();

Wire.beginTransmission(PN532_I2C_ADDRESS);

delay(20);

Wire.endTransmission();

Wire.beginTransmission(PN532_I2C_ADDRESS);

bool success = Wire.write(PN532_PREAMBLE));


Related