How to connect RC522 RFID module and SD-Card Adapter to one Arduino board?

狂风中的少年 提交于 2019-12-13 07:48:41

问题


I want to store the log of RFID tag into the Micro SD card, but RFID and SD card having MOSI and MISO. So i want to know how to connect RFID and SD card to one Arduino UNO.


回答1:


Pins named MOSI and MISO indicate an SPI bus. There should also be a pin labeled SS, CS or similar (slave select). you can hook up several slaves to one master and select the device you want to talk to using that pins logic level.

There should be tons of tutorials and examples online.




回答2:


You can connect multiple slaves to same SPI instance ie, same MOSI, MISO and clock lines. Then you can select a particular slaves based on the status of Slave Select(SS) pin connected to the corresponding slave device. See this tutorial to understand the concept of slave select. You need to connect one pin(say X) to SS line of SD and another pin(pin Y) to SS line of RFID.

Don't forget that you can communicate with only one device at a given time. You have to switch between SD and RFID by changing state of pin X and Y. Copy data from RFID to memory after enabling SS for RFID and then copy that data to SD by enabling its SS.

See arduino uno page to get more details regarding the pins.




回答3:


Yes, I got the answer. Only add the 220K register to SD card MISO pin before connect to Arduino.For more information see attached image



来源:https://stackoverflow.com/questions/41277010/how-to-connect-rc522-rfid-module-and-sd-card-adapter-to-one-arduino-board

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!