This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

TTL interface of swipe card reader

HAI,
I would like to implement TTL interface to a swipe card reader. I want to read track 2 of a card .This contains alphanumeric characters and each character is of 5 bit size which includes one parity bit.
I designed a hardware circuit for this with AT89c2051.
The data is coming as a stream of bits from the readers magnetic head. So I have store this bit stream to a bit array. I used bdata variable for this purpose, but is not possible to write to the bit position.
How I can write these bits to my bit array? What is wrong with code below: I used the pin P1.6 as the input for the data from card reader's magnetic head. Please help me.

sbit dat=P1^6;
bdata unsigned char mydata[13];

for (i = 0; i < 13; i++)
{
for (mask = 0x01; mask != 0x00; mask <<= 1)
 {
  mydata[i] & mask = dat;
 }
}


Here the error I got is errorC141:syntax error near'=';

Please give a replay.

0