Getting the RFID-RC522 to work! [SOLVED]

@Ambition1906, I found the bug!!! There are three key variables used for counters that are cast as “char”, assuming this is a SIGNED 8 bit type. However, the firmware code casts “char” as an UNSIGNED 8 bit type. So, tests like:

for (char i = no_of_sectors - 1; i >= 0; i--) {

will NEVER be less than zero since it is an unsigned value. I changed three vars to int8_t to fix the problem. The one causing the Ultralight to no read was “currentLevelKnownBits”. With these fixes, the ultralight cards reads just fine. I will fix the code in both the repo and the IDE. :smile:

UPDATE: IDE and repo libraries are updated :stuck_out_tongue:

2 Likes