RFID / RC522 / WS2818B Neopixel / Interrupt Comms / DFR0299

Started by Trikkitt, May 17, 2022, 09:40 AM

Previous topic - Next topic

Trikkitt

The following is my currently in-progress code for a fun project I've been working on.

It is entirely interrupt drive for all communications.  New data flowing in gets written to buffers by the interrupt routines.  Outbound data is exactly the same and it uses hardware for all communications.  RFID is via simple SPI, WS2812B/Neopixel via SPI and a few other peripherals, 115200bps comms to the WiFi module and 9600bps to the DFR0299 for playing audio.  The RFID reader code will read the content of the cheap mifare 1k clone cards quite happily, it'll also read the payment provider file from a credit or debit card (not the payment card number etc) which allows it to know which type of card is being presented (Visa, Mastercard etc).

I used the DFR0299 because it was cheap from China.  Under £1 per module!  The MicroSD cards cost more than the player.  So a really cheap way to add audio to the project.

The code isn't attractive because I've been doing this in my spare time and my day job isn't as a coder!  But I figured someone might find some snippits from it useful such as accessing the RC522 card reader.  On that note be careful, the cheap ones from ebay / aliexpress are awful quality.  As an absolute basic they use underspecified inductors on L1 and L2 which I have to swap out to make it read anything more than the mifare 1k cards.  Even then some are still terrible and I don't know why.

Anyway, here is the code - feel free to pull it apart and reuse bits.  It is an attachment to this post as it is too big to include within the text. 

Mapo