Page 1 of 2
RFID module
Posted: Thu Oct 05, 2023 3:42 pm
by WingNut
Hi all. Is there anyway of getting this module to work with the RC522 component?
https://www.amazon.co.uk/AZDelivery-Rea ... r=8-4&th=1
It has more connections than the FC component
Re: RFID module
Posted: Thu Oct 05, 2023 5:14 pm
by chipfryer27
Hi
It should work fine.
Generally I've found AZDelivery products to be OK and they include a free e-book for most of their modules. Have you downloaded it yet?
The Flowcode component has the standard four SPI connections to the module and a Reset pin, whereas the AZD module not only has these five but an additional pin too called IRQ (interrupt request).
If you go to the FC WiKi and download the example you will see that it loops around polling the component to see if a card is present. Unless the component is polled frequently it won't know if a card is present or not. You need to ensure you look often enough or you may miss a read.
With the AZD module it will generate an IRQ whenever a valid card is present (normally high, going Low if present). So you could either poll frequently to check as before, or connect this pin to any Interrupt pin on your chip. Now your chip can be doing other things and when a card is presented, it will interrupt and process the request.
Regards
Re: RFID module
Posted: Thu Oct 05, 2023 7:24 pm
by WingNut
I have downloaded the example and built it on breadboard. The component has Miso, mosi, cs, clk and reset no sda. The module does not have cs so i'm not sure how to connect it. I did think it would work with the miso and mosi alone as I believe the irq can be ignored. But so far I really don't know how it should be connected to my micro
If i can get the example working then I can fiddle with the programming
Re: RFID module
Posted: Thu Oct 05, 2023 9:46 pm
by chipfryer27
Hi
FC example when initially opened has an error regarding pins in that both CLK and CS are assigned to C2. You need to check /change to whatever. An example connection is below:-
FC component to AZD
MOSI (C0) = MOSI Pin
MISO (C1) = MISO Pin
CLK (C2) = SCL Clock Pin
CS (C3) = SDA Slave Select Pin
Reset (C4) = Reset Pin
INT0 = IRQ Interrupt
You are correct that you can ignore the IRQ pin, but if used then it makes things so much easier as when a card is presented to the reader your MCU will immediately branch to read / process then go back to other duties. If IRQ isn't used then you will need to ensure you poll fast enough.
Hope this helps.
Regards
Re: RFID module
Posted: Fri Oct 06, 2023 7:41 am
by WingNut
Thanks Chipfryer. I'll give that a go. Maybe the staff can fix the component
Re: RFID module
Posted: Fri Oct 06, 2023 8:01 am
by chipfryer27
Hi
There is nothing to fix, the component isn't "broken" it is just that probably the module you are using differs from the one used to create, and things have also got "lost" in translation. For example they are calling CS "SDA" which really makes no sense at all as that generally refers to an I2C pin.
As mentioned usually I have no issue with AZD products. Their guides, although written for Arduino, are still very helpful.
Regards
Re: RFID module
Posted: Sun Oct 08, 2023 2:53 pm
by WingNut
I don't have issues with AZ products either. Who is the manufacturer of the original? The datasheet I can find of the chip suggests that the irq pin has to be programmed and i dont see any additional circuitry on this module to do that?
Re: RFID module
Posted: Sun Oct 08, 2023 4:17 pm
by chipfryer27
Hi
As far as I'm aware it's NXP and you can get the data sheet here
https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf
You can see from the pin descriptions the confusion in using SDA, as depending on how it is configured it could use SPI/I2C/UART. If you had a basic chip you could probably configure it to suit yourself or design your own module.
Regards
Re: RFID module
Posted: Sun Oct 08, 2023 4:21 pm
by WingNut
Yeah I have that datasheet. Looks like I'll have to do that
Re: RFID module
Posted: Sun Oct 08, 2023 5:42 pm
by chipfryer27
Hi
Unless I've missed something, why can't you use the module with the existing component?
Regards