How to read and write MIFARE Ultralight pages with PN7150

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

How to read and write MIFARE Ultralight pages with PN7150

Jump to solution
1,444 Views
owenl
Contributor I

I am looking for the command sequence to read/write MIFARE Ultralight pages with a PN7150. I'm struggling with the PN7150 user manual - I see a sequence diagram for MIFARE Classic (with authentication) but not for the MIFARE Ultralight. Can anyone enlighten me or point to some sample code.

(The DH is a micro-controller running FreeRTOS)

0 Kudos
Reply
1 Solution
1,430 Views
owenl
Contributor I

Answering myself. Something along the lines of:

uint8_t ReadPage[] = {0x00, 0x00, 0x02, 0x30, page};
esp_err_t err = i2c_manager_write(port_, deviceAddress_, I2C_NO_REG, ReadPage, sizeof(ReadPage));
 
Send the 3 byte header and 2 byte payload - (0x30 == READ cmd) and page number. Then handle the returned CORE_CONN_CREDITS_NTF followed by the NCI_DATA_MSG response containing 16 bytes starting from the page address.

View solution in original post

1 Reply
1,431 Views
owenl
Contributor I

Answering myself. Something along the lines of:

uint8_t ReadPage[] = {0x00, 0x00, 0x02, 0x30, page};
esp_err_t err = i2c_manager_write(port_, deviceAddress_, I2C_NO_REG, ReadPage, sizeof(ReadPage));
 
Send the 3 byte header and 2 byte payload - (0x30 == READ cmd) and page number. Then handle the returned CORE_CONN_CREDITS_NTF followed by the NCI_DATA_MSG response containing 16 bytes starting from the page address.