Reading in one direction verses both directions – MagTek TTL User Manual

Page 23

Advertising
background image

19

SECTION 5. BIDIRECTIONAL READING AND AMPLITUDE

VARIATIONS

READING IN ONE DIRECTION VERSES BOTH DIRECTIONS


1.

The simplest way to read a card is in one direction only, with the Start Sentinel read first.
If this method is chosen, normally each character is stored in one byte of memory.
During the debug operation this Is a simple and clear method to see what is happening
using 'In Circuit Emulation' (ICE).


2.

If reading in both directions is desired, the normal method is to scan the data in the
forward direction and if no errors are found, then the data is sent. If an error is found,
then the scan is done in the reverse direction. And if no error is found the data is sent in
the forward direction (Start Sentinel first). If an error is found in both directions, then an
error is Reported.


3.

To be able to process the data in both directions, it is necessary to pack the data into
RAM without any unused bits between characters. In the case of 5 bit data, the first byte
will have the first character plus 3 bits of the Second character. The second byte will
have 2 bits of the second character, 5 bits of the third character and one bit of the fourth
character, etc. With the data not being on byte boundaries, it can be difficult to decode it
and especially difficult when looking at the data using ICE.


4.

When a card is read in the forward direction, the Start Sentinel is first, and the Start
Sentinel was chosen so that the first bit would be a one. This makes it simple to tell when
you have reached the end of leading clocking zeros and the first data bit. It also allows
for the first bit to be on a Byte boundary.

When a card is read in the reverse direction, there is no way to tell the boundary between
the trailing zeros (which are now acting as the leading zeros) and the LRC character. For
example, if the LRC is 1 (00001), then the first one bit will be encountered as the fifth bit
of the message, and there is no easy way to tell when the trailing zeros stop and the LRC
starts:


B

5

F

1

000000000,11010,10101,11111,10000,00000000

which really looks like this:


0000000001101010101111111000000000000

As you can see if you are scanning right to left, it is not easy to tell where the clocking zeros stop
and the message begins.

Advertising