<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>125kHz RFID Reader Source Code Project</title>
	<atom:link href="http://www.125khz-rfid-reader.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.125khz-rfid-reader.com</link>
	<description>125kHz RFID Reader Driver Technical Manual</description>
	<lastBuildDate>Wed, 20 Jul 2011 08:06:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Links to useful sites</title>
		<link>http://www.125khz-rfid-reader.com/links/links-to-service-provider-web-sites</link>
		<comments>http://www.125khz-rfid-reader.com/links/links-to-service-provider-web-sites#comments</comments>
		<pubDate>Wed, 20 Jul 2011 07:57:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://www.125khz-rfid-reader.com/?p=112</guid>
		<description><![CDATA[Embedded Developer All Embedded EG3 EE Compendium Arm Atmel Microchip Electronic Engineer Electronic Consultant Embedded Programmer]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.embeddeddeveloper.com/" target="_blank">Embedded Developer</a></p>
<p><a href="http://www.allembedded.com/" target="_blank">All Embedded</a></p>
<p><a href="http://www.eg3.com/" target="_blank">EG3</a></p>
<p><a href="http://ee.cleversoul.com/" target="_blank">EE Compendium</a></p>
<p><a href="http://www.arm.com" target="_blank">Arm</a></p>
<p><a href="http://www.atmel.com/" target="_blank">Atmel</a></p>
<p><a href="http://www.microchip.com/" target="_blank">Microchip</a></p>
<p><a href="http://www.electronic-engineer.co.uk/index.php" target="_blank">Electronic Engineer</a></p>
<p><a href="http://www.electronic-consultant.co.uk/index.php" target="_blank">Electronic Consultant</a></p>
<p><a href="http://www.embedded-programmer.com/index.php" target="_blank">Embedded Programmer</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.125khz-rfid-reader.com/links/links-to-service-provider-web-sites/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>c) Memory Space Requirements</title>
		<link>http://www.125khz-rfid-reader.com/using-the-driver-in-your-project/memory-space-requirements</link>
		<comments>http://www.125khz-rfid-reader.com/using-the-driver-in-your-project/memory-space-requirements#comments</comments>
		<pubDate>Wed, 21 Apr 2010 10:48:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[4. Using The Driver In Your Project]]></category>

		<guid isPermaLink="false">http://www.125khz-rfid-reader.com/?p=99</guid>
		<description><![CDATA[Using the PIC18 Sample Project the driver uses approximately 2534 program memory bytes (1276 x 16 bit instructions) compiling just the driver functions with the Microchip C18 MPLAB C Compiler for PIC18 family of 8 bit microcontrollers (with no compiler optimisations enabled). The driver requries approximately 40 bytes of static RAM memory space.  It requires [...]]]></description>
			<content:encoded><![CDATA[<p>Using the PIC18 Sample Project the driver uses approximately 2534 program memory bytes (1276 x 16 bit instructions) compiling just the driver functions with the Microchip C18 MPLAB C Compiler for PIC18 family of 8 bit microcontrollers (with no compiler optimisations enabled).</p>
<p>The driver requries approximately 40 bytes of static RAM memory space.  It requires only a small amount of temporary variable storage space from the stack.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.125khz-rfid-reader.com/using-the-driver-in-your-project/memory-space-requirements/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>b) Timing Requirements</title>
		<link>http://www.125khz-rfid-reader.com/using-the-driver-in-your-project/timing-requirements</link>
		<comments>http://www.125khz-rfid-reader.com/using-the-driver-in-your-project/timing-requirements#comments</comments>
		<pubDate>Wed, 21 Apr 2010 10:42:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[4. Using The Driver In Your Project]]></category>

		<guid isPermaLink="false">http://www.125khz-rfid-reader.com/?p=94</guid>
		<description><![CDATA[The decoding of the modulated tag datastream requries the Dout rising edge interrupt to be handled with reasonably low latency so that the time x 1uS since the last rising edge can be passed to the drivers rfid_sampling_rising_edge() function with as much accuracy as possible.  Depending on the RFID tags data rate (different tags are [...]]]></description>
			<content:encoded><![CDATA[<p>The decoding of the modulated tag datastream requries the Dout rising edge interrupt to be handled with reasonably low latency so that the time x 1uS since the last rising edge can be passed to the drivers rfid_sampling_rising_edge() function with as much accuracy as possible.  Depending on the RFID tags data rate (different tags are permitted to use different rates) the quickest interrupting will be a rising edge every 512uS, 256uS or 128uS.  Many tags use the slowest 512uS bit rate as it helps increase range.</p>
<p>In the Microchip PIC18 sample project using an 8 bit microcontroller running with a 125nS instruction clock (8MHz crystal with 4 x PLL) the rfid_sampling_rising_edge() function takes a maximum of 95uS to complete (typcially significantly less &#8211; the most time is taken after parity bits are receveid).  This is with no C18 compiler optimisations enabled.</p>
<p>The above should allow you to decide on a suitable interrupt arrangement for your microcontoller based on the other demands of your applicaiton.  Remember that the rising edge interrupt is only active when reading a RFID tag.  When the driver is idle the interrupt is disabled.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.125khz-rfid-reader.com/using-the-driver-in-your-project/timing-requirements/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>b) How The Driver Functions</title>
		<link>http://www.125khz-rfid-reader.com/how-the-driver-works/how-the-driver-functions</link>
		<comments>http://www.125khz-rfid-reader.com/how-the-driver-works/how-the-driver-functions#comments</comments>
		<pubDate>Wed, 21 Apr 2010 10:25:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[7. How The Driver Works]]></category>

		<guid isPermaLink="false">http://www.125khz-rfid-reader.com/?p=90</guid>
		<description><![CDATA[On powerup the driver will initialise the HTRC110 and then place it in a low power standby state. When your applicaiton calls the rfid_read_tag() function the driver then enables the HTRC110, carries out several configuration functions and RF value setting operations before placing the HTRC110 in read mode.  In this mode the Dout pin of [...]]]></description>
			<content:encoded><![CDATA[<p>On powerup the driver will initialise the HTRC110 and then place it in a low power standby state.</p>
<p>When your applicaiton calls the rfid_read_tag() function the driver then enables the HTRC110, carries out several configuration functions and RF value setting operations before placing the HTRC110 in read mode.  In this mode the Dout pin of the HTRC110 simply passes the received modulated data from the RFID tag, or if no tag is present it will contain trash data.  The 64bits of data the RFID tag will be continuously transmitting in a cycle containing 9 header bits, 40 data bits and 14 parity bits.  The header bits allow the start of the data sequence to be identified and the 14 parity check bits provide sufficient error detection to ensure that only a valid RFID tag will be read.  The EM4102 <a href="http://www.125khz-rfid-reader.com/downloads/em4102.pdf" target="_blank">datasheet </a>provides a lot of detail about the data bits and the possible modulation methods.</p>
<p>Once in read mode the HTRC110 outputs a 125kHz sine wave.  The tag (if present) will interfear with the RF sine wave signal in order to pass its data stream back which the HTRC110 detects for us.  When reading is active the Dout pin of the HTRC110 contains the raw data output of the tag after being filtered into a digital signal by the HTRC110.</p>
<p>Although the tag data length is 64 bits the driver needs to receive an initial 22 bits to determin the bit rate and then between 64 to 127 bits need to be received before we have a complete sequence.</p>
<p>Therefore a read can take 149 bits x 512uS maximum bit rate = 76mS.</p>
<p>Tags will often be set to use the slowest 512uS bit rate as slow transitions on the air interface are easier to detect, which means you get additional range and more reliable communications.</p>
<p>The EM4102 protocol permits tags to respond with Manchester, BiPhase or PSK (Phase Shift Keying)  modulation.  Although any of the 3 methods can be used tags basically always use Manchester encoding as there are many RFID readers out there that only support manchaester encoding.  This driver supports Manchester and BiPhase encoding, as BiPhase is very similar to Manchester and there is minimal code footprint required to also support it.  Although supporting PSK is not an particuarly complex task, it does requrie specific microcontroller hardware to be done efficiently and would cause unessary complexity so as PSK is not used in practice this driver does not support it.</p>
<p>For Manchester or BiPhase modulation the tag will be responding with 1 bit every 64, 32 or 16 periods of the carrier frequency, and will change state once or twice during this (the tag is allowed to use any of these three as its data rate). Using a clever detection method the driver only needs to detect each rising edge to determine the preceeding bit states, reducing the interrupt burden on the main application.  Also only detecting each rising edge removes issues of dealing with non perfect high and low widths within each cycle &#8211; being radio they are often not perfectly 50/50, but the overall bit frequency will be relatively accurate.</p>
<p>So for either of these modulations the bit rate will be approximately 128uS, 256uS or 512uS. If the tag was using PSK modulation it would be changing state every carrier frequency period (every 8uS)</p>
<p>Once the bit rate has been determined by the driver it calculates the 125% and 175% bit times which it will then use to decode the data stream.</p>
<p>The driver now decodes the receied data bits on the fly as they are received.  This is a much more efficient and minimal memory requriement approach rather than storing a large chunk of data and decoding it later.</p>
<p>To find the header the driver looks for the bit sequence 0111111111 which is the stop bit followed by header. This sequence cannot occur anywhere else in the tags 64 bit stream.</p>
<p>From the header bitstream the driver is able to determin if Manchester of BiPhase modulation is being used by the RFID tag.  The driver then decodes the remaining bits of the 64 bit sequence, checking for a parity error as each parity bit is received.</p>
<p>If all of the parity checks pass and the final stop bit is received the RFID read is a sucess and a valid tag has been detected.  The driver stores the 10 character ASCII hex tag ID ready for the main application to read and switches the HTRC110 back into low power mode.  When a tag is present and in range there is typcially no need for a retry &#8211; the read sequence will typically work first time.</p>
<p>However the driver will retry for up to 150mS in case it helps where the signal is week. As this driver checks for parity errors as nibbles are received (rather than at the end) failures can occur early on in the bit sequence, so doing this will often mean the driver is ready to try again at the start of the very next sequence from the tag.</p>
<p>If no valid tag bitstream is detected the driver switches the HTRC110 back into low power mode and declares the read a failure.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.125khz-rfid-reader.com/how-the-driver-works/how-the-driver-functions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>d) Troubleshooting</title>
		<link>http://www.125khz-rfid-reader.com/uncategorized/troubleshooting</link>
		<comments>http://www.125khz-rfid-reader.com/uncategorized/troubleshooting#comments</comments>
		<pubDate>Wed, 21 Apr 2010 09:42:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[4. Using The Driver In Your Project]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.125khz-rfid-reader.com/?p=79</guid>
		<description><![CDATA[A few things to check if you run into problems implementing the driver in your application: Are the communicaitons between the HTRC110 and your microcontroller working correctly &#8211; does the HTRC110 reply?  Use the RFID_SPI_SAMPLE_CS_PIN and a logic analyser to capture these if necessary. Is the time value being passed to the rfid_sampling_rising_edge() function correct [...]]]></description>
			<content:encoded><![CDATA[<p>A few things to check if you run into problems implementing the driver in your application:</p>
<ul>
<li>Are the communicaitons between the HTRC110 and your microcontroller working correctly &#8211; does the HTRC110 reply?  Use the RFID_SPI_SAMPLE_CS_PIN and a logic analyser to capture these if necessary.</li>
<li>Is the time value being passed to the rfid_sampling_rising_edge() function correct &#8211; check with a scope.</li>
<li>In the function rfid_sampling_rising_edge() breakpoint at the end of the section &#8220;//&#8212;&#8211; CALCULATE THE CYCLE TIMES &#8212;&#8211;&#8221;.  Is the rfid_1us_bit_rate correct?  If you use a logic analyser to capture Dout from the HTRC110 during tag reading you will be able to determin the bit rate by looking for the shortest low high pulse sequence (high edge to high edge) &#8211; does rfid_1us_bit_rate match?</li>
</ul>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">RFID_SPI_SAMPLE_CS_PINUse</div>
]]></content:encoded>
			<wfw:commentRss>http://www.125khz-rfid-reader.com/uncategorized/troubleshooting/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a) How the HTRC110 works</title>
		<link>http://www.125khz-rfid-reader.com/how-the-driver-works/a-how-the-htrc110-works</link>
		<comments>http://www.125khz-rfid-reader.com/how-the-driver-works/a-how-the-htrc110-works#comments</comments>
		<pubDate>Wed, 21 Apr 2010 09:30:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[7. How The Driver Works]]></category>

		<guid isPermaLink="false">http://www.125khz-rfid-reader.com/?p=75</guid>
		<description><![CDATA[Overview The HTRC110 is a great RFID reader IC and it takes care of all aspects of the radio frequency transmittion and reception.  It incorporates features to remove tuning and calibration requirements which can be a clasic pain of RFID reader deisgn.  The communication interface to the microcontroller is similar to SPI.  However a special [...]]]></description>
			<content:encoded><![CDATA[<h4>Overview</h4>
<p>The HTRC110 is a great RFID reader IC and it takes care of all aspects of the radio frequency transmittion and reception.  It incorporates features to remove tuning and calibration requirements which can be a clasic pain of RFID reader deisgn.  The communication interface to the microcontroller is similar to SPI.  However a special start bit sequence is used and there is no chip select pin making it not directly compatible with SPI.  The driver incudes an option to allow a spare microcontroller pin to be used as a dummy chip select pin, allowing you to use a logic analyser to capture the communications between the HTRC110 and your microcontroller during development if you wish &#8211; see the rfid.h file for details of enabling this.</p>
<h4>Reading Tags</h4>
<p>The HTRC will take care of all aspects of the radio frequency side of things for you, but its output when reading a tag is the raw modulated data output from the tag.  This 64bit continuous looping data stream needs to be decoded by your microcontoller to determin if the data is from a valid tag or if it is just RF noise (if no tag is present the datastream will contain junk data).  Once the HTRC110 has been put in read tag mode in will pass the data stream until the microcontroller stops it.  It is during this phase that the HTRC uses the most power.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.125khz-rfid-reader.com/how-the-driver-works/a-how-the-htrc110-works/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PIC18 Sample Project</title>
		<link>http://www.125khz-rfid-reader.com/example-circuits/pic18-sample-project</link>
		<comments>http://www.125khz-rfid-reader.com/example-circuits/pic18-sample-project#comments</comments>
		<pubDate>Tue, 20 Apr 2010 22:42:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[6. Example Circuits]]></category>

		<guid isPermaLink="false">http://www.125khz-rfid-reader.com/?p=72</guid>
		<description><![CDATA[Download the HTRC110 RFID Reader Driver PIC18 Example Project Circuit here.]]></description>
			<content:encoded><![CDATA[<p>Download the HTRC110 RFID Reader Driver PIC18 Example Project Circuit <a href="http://www.125khz-rfid-reader.com/downloads/htrc110_rfid_reader_driver_example_project_circuit.pdf">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.125khz-rfid-reader.com/example-circuits/pic18-sample-project/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Driver Firmware Revisions</title>
		<link>http://www.125khz-rfid-reader.com/revision-history/firmware-revisions</link>
		<comments>http://www.125khz-rfid-reader.com/revision-history/firmware-revisions#comments</comments>
		<pubDate>Tue, 20 Apr 2010 22:18:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[8. Revision History]]></category>

		<guid isPermaLink="false">http://www.125khz-rfid-reader.com/?p=66</guid>
		<description><![CDATA[V1.00 (Current Version) Original Release]]></description>
			<content:encoded><![CDATA[<h4>V1.00 (Current Version)</h4>
<p>Original Release</p>
]]></content:encoded>
			<wfw:commentRss>http://www.125khz-rfid-reader.com/revision-history/firmware-revisions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>c) Using The Driver With a RTOS or Kernel</title>
		<link>http://www.125khz-rfid-reader.com/driver-overview/c-using-the-driver-with-a-rtos-or-kernel</link>
		<comments>http://www.125khz-rfid-reader.com/driver-overview/c-using-the-driver-with-a-rtos-or-kernel#comments</comments>
		<pubDate>Tue, 20 Apr 2010 22:09:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[1. Driver Overview]]></category>

		<guid isPermaLink="false">http://www.125khz-rfid-reader.com/?p=62</guid>
		<description><![CDATA[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.]]></description>
			<content:encoded><![CDATA[<p>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.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.125khz-rfid-reader.com/driver-overview/c-using-the-driver-with-a-rtos-or-kernel/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a) Functions</title>
		<link>http://www.125khz-rfid-reader.com/using-the-driver-in-your-project/functions</link>
		<comments>http://www.125khz-rfid-reader.com/using-the-driver-in-your-project/functions#comments</comments>
		<pubDate>Tue, 20 Apr 2010 22:09:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[4. Using The Driver In Your Project]]></category>

		<guid isPermaLink="false">http://www.125khz-rfid-reader.com/?p=60</guid>
		<description><![CDATA[The driver is implemented as a single thread so you just need to make sure functions are 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. void rfid_process (void) This function should be called regularly as part of your [...]]]></description>
			<content:encoded><![CDATA[<p>The driver is implemented as a single thread so you just need to make sure functions are 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.</p>
<h4>void rfid_process (void)</h4>
<p>This function should be called regularly as part of your applications main loop.</p>
<h4><strong>void rfid_read_tag (void)</strong></h4>
<p>Call this function to start the read tag process</p>
<h4>BYTE rfid_get_read_tag_result (void)</h4>
<p>Call this function to check for the end of the read tag process.  It returns 0 if still reading, 1 if completed.  Bit 7 will be set if the read failed.</p>
<p>After a sucessful read the ASCII tag ID will be in rfid_data_nibbles[0] | rfid_data_nibbles[9]</p>
<h4>void rfid_sampling_rising_edge (WORD us_since_last_rising_edge)</h4>
<p>Call with us_since_last_rising_edge = The time in uS since the last edge interrupt.  You application interrupt hander must create this value from an available microcontroller timer. The maximum time between interrupts will be approximately 1024uS, so your timer calculation only needs to deal with time values of up to say 1280uS (to give a reasonable margin of worst case tollerance).</p>
<p>Call with the timer value captured as close as possible to the rising edge occuring (reduce latency as much as possible).</p>
<p>This fucntion will ignore the value for the first 2 calls allowing for initial timer error.</p>
<h4>void rfid_force_initialise (void)</h4>
<p>In typical use this function is not requried as the driver will automatically initialise the HTRC110 IC on powerup.  However if you are using this driver with multiple HTRC110 devices (for instance by switching the SCLK, DIN and DOUT lines by using one or more 74HC4053 IC&#8217;s) then this function can be called during your applications initialisation after selecting each HTRC110.  To read each HTRC110 call rfid_read_tag() and wait for rfid_get_read_tag_result() to return a completed result before switching to the next HTRC.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.125khz-rfid-reader.com/using-the-driver-in-your-project/functions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

