[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-692153-105":3,"detail-sidebar-cat-0-en-105":80,"doc-detail-692153-en":130,"doc-similar-692153":154},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":73,"head_meta":75,"extra_data":77,"updated_unix":79},105,"en","using-spi-to-drive-an-mfrc522-rfid-reader-beginner-friendly-guide","Using SPI to Drive an MFRC522 RFID Reader - Beginner-Friendly Guide","","A beginner-friendly guide explaining how to use SPI to drive an MFRC522 RFID reader (also labeled RC522) on a BeagleBone. It introduces SPI using an I2C comparison, clarifies key timing behavior such as the one-byte MOSI/MISO delay, and outlines how to configure SPI0/SPI1 with chip-select options. The guide then transitions to RFID concepts and step-by-step workflows for obtaining a tag’s UID, including C-level operations with registers and FIFO buffering, plus troubleshooting and support files.",{"@graph":14,"@context":72},[15,34,55],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/using-spi-to-drive-an-mfrc522-rfid-reader-beginner-friendly-guide/692153/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/using-spi-to-drive-an-mfrc522-rfid-reader-beginner-friendly-guide/692153.png","ImageObject",300,407,{"name":42,"@type":43},"Riley","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-24","2026-11-08",true,{"@type":52,"interactionType":53,"userInteractionCount":33},"InteractionCounter",{"@type":54},"ViewAction",{"@type":56,"mainEntity":57},"FAQPage",[58,64,68],{"name":59,"@type":60,"acceptedAnswer":61},"What hardware and protocol does this guide focus on for RFID reading?","Question",{"text":62,"@type":63},"The guide focuses on using SPI to drive an MFRC522 RFID reader on a BeagleBone. It explains why SPI is the primary interface for this reader and does not cover I2C or UART for driving it.","Answer",{"name":65,"@type":60,"acceptedAnswer":66},"How does SPI differ from I2C in this guide’s explanation?",{"text":67,"@type":63},"SPI uses a synchronous master-slave architecture where the BeagleBone acts as the master and the RFID reader is the slave. Compared with I2C’s single SDA line, SPI uses MOSI and MISO signal lines and includes a one-byte delay between them.",{"name":69,"@type":60,"acceptedAnswer":70},"What steps does the guide follow to obtain an RFID tag’s UID?",{"text":71,"@type":63},"It explains the RFID technology behind the MFRC522 and then demonstrates C-based steps to write commands into the FIFO buffer, execute a transceive operation, check for errors, read the tag response, and extract the tag’s UID.","https://schema.org",{"og:url":32,"og:type":74,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":76,"canonical":32},"index,follow",{"doc_id":78,"site_id":7},692153,1794180246,{"code":4,"msg":81,"data":82},"success",[83,87,91,95,100,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":84,"show_sort_weight":85,"slug":86},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":88,"show_sort_weight":89,"slug":90},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":92,"show_sort_weight":93,"slug":94},"Exam",70,"exam",{"id":96,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},5,"Comic",60,"comic",{"id":101,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},6,50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":96,"slug":129},19,"General","general",{"code":4,"msg":81,"data":131},{"doc_id":78,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":101,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":33,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":79,"read_time":144,"preview_page_count":26,"preview_urls":145},1374391975076,"https://ap-avatar.wpscdn.com/avatar/14000253ca4ec9f6853?x-image-process=image/resize,m_fixed,w_180,h_180&k=1783305029341752051","Using SPI to Drive an MFRC522 RFID Reader  \nSpencer Leslie, Louie Lu, Jet Simon  \nApril 2024  \nContents  \n1 Introduction 2  \n2 SPI 2  \n2.1 Overview ............................................... 2  \n2.2 Configuring SPI on the BeagleBone ................................. 2  \n2.3 Working with SPI in C ........................................ 4  \n2.3.1 Initialization ......................................... 5  \n2.3.2 Reading and Writing Registers ............................... 5  \n2.4 Support Files ............................................. 6  \n2.5 Troubleshooting ............................................ 6  \n3 RFID 8  \n3.1 Overview ............................................... 8  \n3.2 MF1S503x, aka the MIFARE Classic 1K .............................. 8  \n3.2.1 The UID ........................................... 8  \n3.2.2 Commands .......................................... 9  \n3.3 MFRC522 ............................................... 9  \n3.3.1 The FIFO Buffer ....................................... 9  \n3.3.2 Commands, Part II ...................................... 10  \n3.3.3 Registers ........................................... 10  \n3.3.4 Formatting a Register Address ............................... 11  \n3.3.5 Wiring to the BeagleBone .................................. 12  \n3.4 Working with RFID in C ...................................... 12  \n3.4.1 Writing a Command to the FIFO Buffer .......................... 13  \n3.4.2 Executing a Transceive ................................... 13  \n3.4.3 Checking for Errors ..................................... 14  \n3.4.4 Reading a Tag’s Response from the FIFO Buffer ..................... 15  \n3.5 Obtaining a UID ........................................... 16  \n3.6 Support Files ............................................. 16  \n3.7 Troubleshooting ............................................ 16  \n4 Appendix 18  \n1 Introduction  \nThis guide will walk you through how to use SPI to drive an MFRC522 (also sometimes labelled as RC522) RFID Reader. Section 2 gives a brief overview on the SPI protocol, and shows how to configure SPI on the BeagleBone. Section 3 explains the technologies behind RFID, and demonstrates the steps necessary to obtain the UID (unique ID) of an RFID tag. Please know that while this is a lengthy guide, we have designed the article to be beginner-friendly. Support files for SPI and RFID modules are included alongside this guide, but their implementations are only half-complete.  \nWe wrote this two-in-one guide because we found that other student guides for SPI, while helpful, contain some crucial inaccuracies as of the time of writing. Section 2 of our guide can be considered an update to those documents. As for RFID, beginner resources are very scarce. Most Internet guides hand-wave away the technical details, simply encouraging direct use of popular premade libraries which are not immediately compatible with the BeagleBone. We hope that by reading this guide, you can not only get your RFID reader to work for this class’s hardware, but also gain an appreciation for what is going on under the hood.  \n2 SPI  \n2.1 Overview  \nTo drive the MFRC522 RFID reader, we will be using a protocol we have not yet seen in this class-SPI (Serial Peripheral Interface) . While it might be possible to use I2C or UART to drive the MFRC522, we will not be covering them here. Based on our findings, the MFRC522 is primarily intended to be used with SPI.  \nIt is useful to frame our introduction of SPI in terms of an already familiar protocol: I2C. Like I2C, SPI employs a synchronous, master-slave architecture. The master is the BeagleBone, and the slave is an SPI device, i.e. our RFID reader. The main difference between the two protocols is that I2C uses just one signal line to exchange data-SDA (Serial Data), while SPI uses two-MOSI (Master Out Slave In) and MISO (Master In Slave Out) .  \nPractically speaking, there is just one important quirk you must know about SPI: there is a one-","cbCaiitr0DX8syyE","https://ap.wps.com/l/cbCaiitr0DX8syyE","pdf",352883,18,"English","# 1 Introduction\n# 2 SPI\n## 2.1 Overview\n## 2.2 Configuring SPI on the BeagleBone\n## 2.3 Working with SPI in C\n## 2.4 Support Files\n## 2.5 Troubleshooting\n# 3 RFID\n## 3.1 Overview\n## 3.2 MF1S503x, aka the MIFARE Classic 1K\n## 3.3 MFRC522\n## 3.4 Working with RFID in C\n## 3.5 Obtaining a UID\n## 3.6 Support Files\n## 3.7 Troubleshooting\n# 4 Appendix","[{\"question\":\"What hardware and protocol does this guide focus on for RFID reading?\",\"answer\":\"The guide focuses on using SPI to drive an MFRC522 RFID reader on a BeagleBone. It explains why SPI is the primary interface for this reader and does not cover I2C or UART for driving it.\"},{\"question\":\"How does SPI differ from I2C in this guide’s explanation?\",\"answer\":\"SPI uses a synchronous master-slave architecture where the BeagleBone acts as the master and the RFID reader is the slave. Compared with I2C’s single SDA line, SPI uses MOSI and MISO signal lines and includes a one-byte delay between them.\"},{\"question\":\"What steps does the guide follow to obtain an RFID tag’s UID?\",\"answer\":\"It explains the RFID technology behind the MFRC522 and then demonstrates C-based steps to write commands into the FIFO buffer, execute a transceive operation, check for errors, read the tag response, and extract the tag’s UID.\"}]","Using SPI to Drive an MFRC522 RFID Reader - Beginner-Friendly Guide | PDF",45,[146,150],{"page_no":22,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/b7af4426822f6f4495a3bd9806d120bb.webp",983,1272,{"page_no":26,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/a416a31d6a6b89c76c64f71700c97945.webp",982,1270,{"list":155,"token":11},[156,162,168,174,181,187,193,199,205,211],{"doc_id":157,"doc_title":158,"file_type":137,"home_preview_img_url":159,"slug":160,"view_count":101,"category_name":29,"create_tm":161},700731,"SmartElex 6 Degrees of Freedom Breakout - LSM6DSO - Tutorial","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012034053/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112119&Signature=dN9vLacmpOgkstKQvxs31p0kB54%3D","smartelex-6-degrees-of-freedom-breakout-lsm6dso-tutorial",1794520312,{"doc_id":163,"doc_title":164,"file_type":137,"home_preview_img_url":165,"slug":166,"view_count":30,"category_name":29,"create_tm":167},720559,"ADXL345","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230023675291/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112119&Signature=FeTn6oMCfnA1qXuX1vl79gFLvQ8%3D","adxl345",1795038190,{"doc_id":169,"doc_title":170,"file_type":137,"home_preview_img_url":171,"slug":172,"view_count":33,"category_name":29,"create_tm":173},720568,"MPU-9255 Product Specification - Document","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230023675353/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112119&Signature=PK5NGeHT1NWI3KmpBj1dcxZTtsU%3D","mpu-9255-product-specification-document",1795038212,{"doc_id":175,"doc_title":176,"file_type":137,"home_preview_img_url":177,"slug":178,"view_count":179,"category_name":29,"create_tm":180},690368,"ICM-42688-P Datasheet - High Precision 6-Axis MEMS MotionTrackingTM Device","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002631854/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112119&Signature=h1F8ue88wSX8O6wnWqEFcPxNWaA%3D","icm-42688-p-datasheet-high-precision-6-axis-mems-motiontrackingtm-device",12,1794164731,{"doc_id":182,"doc_title":183,"file_type":137,"home_preview_img_url":184,"slug":185,"view_count":33,"category_name":29,"create_tm":186},720576,"Gyroscope (BNO085) UART-RVC Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230024400360/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112119&Signature=Wa2tojhHaSbslhHSuSer1ZG0mOQ%3D","gyroscope-bno085-uart-rvc-guide",1795038236,{"doc_id":188,"doc_title":189,"file_type":137,"home_preview_img_url":190,"slug":191,"view_count":96,"category_name":29,"create_tm":192},700732,"LSM6DSO: always-on 3D accelerometer and 3D gyroscope - Application note","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012034059/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112119&Signature=VK0jzwDRR2GaM104mrbsZf6WiDM%3D","lsm6dso-always-on-3d-accelerometer-and-3d-gyroscope-application-note",1794520316,{"doc_id":194,"doc_title":195,"file_type":137,"home_preview_img_url":196,"slug":197,"view_count":96,"category_name":29,"create_tm":198},700687,"Arduino Playground-MPU-6050 - Introduction","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011569104/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112119&Signature=LAhw4NNQCtcubGYTSm6JMUHDKeY%3D","arduino-playground-mpu-6050-introduction",1794520009,{"doc_id":200,"doc_title":201,"file_type":137,"home_preview_img_url":202,"slug":203,"view_count":33,"category_name":29,"create_tm":204},700683,"MPU-6000 and MPU-6050 - Register Map and Descriptions - Revision 4.0","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011569048/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112119&Signature=9xje21fzwToRirc9PkofNXOFSJs%3D","mpu-6000-and-mpu-6050-register-map-and-descriptions-revision-40",1794519974,{"doc_id":206,"doc_title":207,"file_type":137,"home_preview_img_url":208,"slug":209,"view_count":101,"category_name":29,"create_tm":210},690359,"Grove-3-Axis Digital Accelerometer (LIS3DHTR) - Overview - Hardware and Example Code","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002023998/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112119&Signature=jqhG3c%2FO1yNg3JcKO46H9qu7V8Q%3D","grove-3-axis-digital-accelerometer-lis3dhtr-overview-hardware-and-example-code",1794164675,{"doc_id":212,"doc_title":213,"file_type":137,"home_preview_img_url":214,"slug":215,"view_count":33,"category_name":29,"create_tm":216},720519,"Interfacing MAX30102 Pulse Oximeter and Heart Rate Sensor with Arduino","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230024397871/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796112119&Signature=ySqz3zS9KKsScXFPg5OA2cc2c8c%3D","interfacing-max30102-pulse-oximeter-and-heart-rate-sensor-with-arduino",1795037722]