PN532 - i2C address control

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PN532 - i2C address control

1,248 Views
shaharc1994
Contributor I

Hi, 

We are working with the PN532 reader using this data sheet - https://www.nxp.com/docs/en/nxp/data-sheets/PN532_C1.pdf

we are trying to communicate with several PN532 and when we try to change the i2C address of one of the PN532's with the I2CADR register (0xDB) according to the datasheet on page 65 without the expected result. we get the following:

1. when using the i2C communication the address changes after writing to the register and is persistent across reboot but has no effect on the slave response. what we get is that the chip whose address was A before changing it to B is still B after reset but is responding with I2C protocol for A 

2. when using SPI communication to change the I2C register when we can change the address from A to B but after reset its back to A

0 Kudos
7 Replies

608 Views
jovanpn
Contributor I

Hi,

we have similar problem related to this topic. We have developed our own boards which are using PN532 RFID controller and now we have the need to connect multiple boards of ours together for some project, so we need to change I2C address for some PN532 controllers to be able to use them all of them in the same time. Now, like @shaharc1994 we are having problems changing slave I2C address. We also have this Adafruit module we used to test PN532 controller during our own board development. We tried changing I2C address on both, Adafruit module and our board and the results are the same.

The problem we have is that we are able to successfully change content of I2CADDR (0xDB) register but unlike for @shaharc1994, PN532 on our boards and Adafruit module does not save content of I2CADDR register across reboot. When we write new I2C address to this register, we can read it until we reboot the controller. And, like for @shaharc1994, PN532 controller responds only on default I2C address (0x48) in any situation, after I2CADDR register content change and after reboot.

We have developed Java software, as per controller datasheet, to communicate to PN532 controllers from Raspberry Pi during our testing and I can confirm that RAW communication data looks to be totally correct, as per datasheet. I can provide this data if needed. Firmware version of PN532 controllers is 1.6 on both, Adafruit module and our own boards.

Is there any way or some special procedure or settings (software or hardware) we need to do to successfully store new slave I2C address into register and use it afterwards? And is I2CADDR register of any real use at all for this usecase?

Thank you in advance!

0 Kudos

389 Views
jovanpn
Contributor I

Can @Julián_AragónM maybe help me with this issue?

0 Kudos

1,223 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @shaharc1994,

The PN5321 is not recommended for new designs, so support may be limited. For new designs, we recommend PN7160.

Could you please share with us your setup? What are you utilizing as host?

Best regards,
Julián

0 Kudos

1,200 Views
shaharc1994
Contributor I

Thanks for the quick response.

I am using Arduino Mega to communicate with the PN532 through I2C protocol.
The PN532 does reply to the default address 0x48(Taken from page 26,42 in the user manual).
When I change the address stored in I2CADR(DBh) the following happens:
Changing the value of I2CADR(DBh) register to 0x02 I expected to get an answer when I called address 0x02 over I2C but I got no answer and continued to receive answers when calling 0x48 address.
Changing the value of I2CADR(DBh) register to 0x03 I expected to get an answer when I called the address 0x00(General Call) but I got no answer and continued to receive answers when calling 0x48 address.

0 Kudos

1,178 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @shaharc1994,

Are you using an Arduino library to send the commands? If so, I can't go into much detail. Could you send me a log of the raw data you are sending? The change address command may be wrong. 

Could you also share the PN532 module you are using? 

Best regards,
Julián.

 

0 Kudos

1,149 Views
shaharc1994
Contributor I

HI,

I'm trying to change the value of I2CADR to 0x02 I send the following sequence in I2C (written in HEX):
0000FF05FBD40800DB024700

 

I am using a red board like in the following link:
https://www.electroniclinic.com/pn532-rfid-nfc-module-with-arduino-how-to-use-hsu-uart-spi-i2c/

 

Thanks!

0 Kudos

1,125 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @shaharc1994,

Unfortunately, because of the custom SW, this issue seems to be out of our support scope. I apologize for any inconveniences this may cause. I would recommend checking this issue with the creator of the library.

Just as pointers, some of the issues could be that the address may be hardcoded into the library you are using. 

Also, please help me looking into the chapter 8.3.2.4 (Slave receiver mode), to check all the requirements for slave receiver/transmitter mode.

Here is also a case that relates to your problems: Host interface PN532 and I2C address - NXP Community, please see if it clears some things up.

Again, I apologize for any inconveniences this may cause.

Best regards,
Julián.

0 Kudos