That write command you are using seems to be wrong. You are using the COMPATIBILITY_WRITE command code (0xA0
) but you pass the parameters of a WRITE command.
I suggest you stick to the WRITE command:
+-----------+------+------+---------------------+
| WRAPPING | CMD | ADDR | DATA (1 PAGE) |
+-----------+------+------+---------------------+
| 0x40 0x01 | 0xA2 | 0x05 | 0x01 0x02 0x03 0x04 |
+-----------+------+------+---------------------+
Or you could also use the COMPATIBILITY_WRITE command:
You start with sending the command and the address:
+-----------+------+------+ | WRAPPING | CMD | ADDR | +-----------+------+------+ | 0x40 0x01 | 0xA0 | 0x05 | +-----------+------+------+
You should then receive the ACK/NAK status from the tag.
Then you send the data in a second frame:
+-----------+---------------------+------------------------------------------------------------+ | WRAPPING | DATA (1 PAGE) | FILLER (3 EMPTY PAGES) +-----------+---------------------+------------------------------------------------------------+ | 0x40 0x01 | 0x01 0x02 0x03 0x04 | 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 +-----------+---------------------+------------------------------------------------------------+