This project shows the implementation of an RFID module that outputs the 10-character unique ID ( 5 bytes ID + 1 byte checksum + 4 bytes timestamp) of a 125kHz RFID card with Silicon Labs platform based on I2C communication.
It can be used for human tracking, checking event attendance, and is also beneficial for electronic wallet applications.
-
Or SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit (BRD4002 + BRD4338A)
-
If the BGM220P Explorer Kit is used:
The SparkFun RFID Qwiic Reader board can be easily connected to your board by using a Qwiic cable. The hardware connection is shown in the image below:
-
If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:
The hardware connection is shown in the table below:
Description BRD4338A GPIO BRD4002 EXP Header SparkFun RFID Qwiic Reader I2C_SDA ULP_GPIO_6 EXP_16 SDA I2C_SCL ULP_GPIO_7 EXP_15 SCL
You can either create a project based on an example project or start with an empty example project.
-
From the Launcher Home, add your board to My Products, click on it, and click on the EXAMPLE PROJECTS & DEMOS tab. Find the example project filtering by "ID-12LA".
-
Click Create button on the Third Party Hardware Drivers - ID-12LA - RFID Qwiic Reader (Sparkfun) example. Example project creation dialog pops up -> click Create and Finish and Project should be generated.
-
Build and flash this example to the board.
-
Create an "Empty C Project" for your board" using Simplicity Studio v5. Use the default project settings.
-
Copy the file
app/example/sparkfun_rfid_id12la/app.c
into the project root folder (overwriting the existing file). -
Install the software components:
-
Open the .slcp file in the project.
-
Select the SOFTWARE COMPONENTS tab.
-
Install the following components:
-
If the BGM220P Explorer Kit is used:
- [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom
- [Application] → [Utility] → [Log]
- [Application] → [Utility] → [Assert]
- [Platform] → [Driver] → [I2C] → [I2CSPM] → qwiic instance
- [Third Party Hardware Drivers] → [Wireless Connectivity] → [ID-12LA - RFID Reader (Sparkfun) - I2C]
-
If the SiWx917 Wi-Fi 6 and Bluetooth LE 8 MB Flash SoC Pro Kit is used:
- [Application] → [Utility] → [Assert]
- [WiSeConnect 3 SDK] → [Device] → [Si91x] → [MCU] → [Peripheral] → [I2C] → [i2c2]
- [Third Party Hardware Drivers] → [Wireless Connectivity] → [ID-12LA - RFID Reader (Sparkfun) - I2C] → set the correct I2C address of the RFID Reader
-
-
-
Build and flash the project to your device.
Note:
-
Make sure that the Third Party Hardware Drivers extension is installed. If not, follow this documentation.
-
SDK Extension must be enabled for the project to install "ID-12LA - RFID Reader (Sparkfun) - I2C" component.
A higher level kit driver I2CSPM (I2C simple poll-based master mode driver) is used for initializing the I2C peripheral as master mode and performing the I2C transfer.
rfid_id12la.c
: Communicate with the microcontroller through the Silabs I2CSPM platform service as well as implements public APIs to interface with the ID12LA RFID.
This example demonstrates some of the available features of the ID12LA module. After initialization, the ID-12LA module outputs a packet through I2C ( 5 bytes ID + 1 byte checksum + 4 bytes timestamp) when it scans an RFID card. The "scan" time is not the time of day the RFID card was scanned but rather the time between when the card was scanned and when the user requested the RFID tag from the Qwiic RFID Reader (the time that data is stored in the buffer of ID12LA module). The following diagram shows the program flow as implemented in the app.c file:
Use J-Link Silicon Labs or other program to read the serial output. The BGM220P uses by default a baudrate of 115200. You should expect a similar output to the one below.
To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of third_party_hw_drivers_extension repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues.
Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of third_party_hw_drivers_extension repo.