Section 4. error checking, Error checks by a typical reader – MagTek TTL User Manual
Page 19
15
SECTION 4. ERROR CHECKING
This section describes error checking by a typical single track reader and with and Intel 8751
CPU on a typical Track 2 reader.
ERROR CHECKS BY A TYPICAL READER
The following error checking is performed by a typical card reader:
1.
While the card is being swiped no error checking is done. All of the micro processor unit
(MPU) time is being devoted to storing the data being read off the card into memory
(RAM). Normally the strobe output from the card reader is connected to an interrupt
input on the MPU. The MPU is set so that the interrupt is triggered on the falling edge of
the strobe. The data output line from the card reader goes to a normal MPU port input
pin. On each Falling edge of the strobe, one bit of data is collected from the data input
line and the interrupt routine is exited. The 'Card Present' output from the card reader
goes to a normal MPU port Input pin. All outputs from the card reader are quiescently
high (V
cc
).
2.
When 'card present' returns to high again the MPU knows that the card has cleared the
read head and error checking can begin. The MPU now checks each character that it
collected in step 1 for the following:
A. Checks to ensure the first character is a 'Start Sentinel'. This will be a hex B (01011)
for Track 2 or Track 3. For Track 1 it will be a percent sign (1000101).
B. Checks each character for odd parity (an odd number of one bits).
C. Updates the LRC total as each character is checked.
D.
Checks to see if the current character is an 'End Sentinel' (11111, 0011111). If no
'End Sentinel' is found, this is an error. When the 'end sentinel' is found, the MPU
inputs the next character (LRC), checks its parity, and updates the LRC total. It
then checks that the LRC total is zero. If it is not zero it is an error.
3.
Some readers keep count of the number of characters checked, and if this number
exceeds the maximum allowed, will give an error. The maximum allowed is: track 1 =
79; track 2 = 40; track 3 = 107.
4.
If for some reason you do not have enough interrupts available to use the preceding
method, MagTek can provide an application note on how to do it without using
interrupts. This is done by using a "USART" for each track along with an MPU. See
Appendix D.