125kHz RFID Reader Driver Technical Manual

a) Features

Low cost 125kHz passive RFID tags are the ideal choice for all sorts of identification applications.  However many engineers view the task of designing a 125kHz RFID reader as too daunting a job involving dabbling in the black arts of radio frequency design.  Instead an engineer will typically opt for the safe approach of using one of the many off the shelf but expensive RFID reader OEM modules.

Actually designing a 125KHz RFID reader is very straightforward if a good RFID reader IC is used and this driver is designed to work with the excellent NXP (formerly Philips) HTRC110 RFID Reader Chip.

This driver provides complete functionality to read EM Marin EM4102 (previously named H4001/H4102) and compatible RFID transponders.  The EM4100 is one of the more common data formats for RFID transponders, so named because the microchip at the heart of compatible tags are based on a controller chip originally made by the company EM Microelectronic.  The protocol is typically used by the many types of generic 125kHz read only passive RFID tags available from a huge range of suppliers.  These simple RFID transponders carry 40 bits of read only memory and are typically supplied with a globally unique ID value (the 40 bits provide 1,099,511,627,776 combinations).

The driver provides the following main features:-

  • Automatically handles the 64, 32 or 16 period data rates and Manchester or Biphase encoding methods used by EM4102 based tags.  Most tags use Manchester encoding due to many RFID readers only supporting Manchester encoded tags.
  • Optimised for small code footprint embedded designs.
  • State machine and interrupt based implementation to avoid your application stalling while tags are read and the modulated data stream decoded.
  • Automatically switches the HTRC110 to low power mode between reading tags.
  • No reliance on compiler specific libraries.
  • Full source code supplied for you to use and modify as required.

b) Driver Technical Notes

The driver is designed to support the NXP HTRC110 RFID reader chip and has been designed to work with 8-bit, 16-bit and 32-bit microcontrollers.

The driver has the following hardware requriements:

In order to decode the modulated RFID tag data stream the driver requires the RFID Dout connection to be made to a microcontroller rising edge interrupt pin.  The driver carries out all other communications by driving and reading the microcontroller pins directly.

When a rising edge is detected the driver function that is called needs to be passed the time x1uS since the last rising edge interrupt occured.  Therefore your microcontroller needs to have a timer you can use to allow your code to pass the time value.

c) Using The Driver With a RTOS or Kernel

The driver is implemented as a single thread so you just need to make sure it is always called from a single thread (it is not designed to be thread safe).  All RFID operations are carried out using a non stalling state machine approach.