 |
| Author |
Message |
|
|
Posted: Mar 30, 2012 - 07:04 PM |
|

Joined: Mar 29, 2012
Posts: 43
|
|
I am having absolutely no luck getting data out of the mag card reader:
DDRC = 0x20; // output for an LED on PC5
PORTC = 0x10; // enable pullup resist on PC4
EIMSK = EIMSK | 1 << INT1; // enable card reader interrupt
next_bit = ~PINC; // mag reader has inverted logic
next_bit = next_bit >> 4; // wanted data on PC4 shift to right to be LSB
next_bit = next_bit & 1; // make sure no unwanted data
I always get a zero for the data reading. Did I do something wrong? |
|
|
| |
|
|
|
|
|
Posted: Mar 30, 2012 - 07:06 PM |
|

Joined: Mar 29, 2012
Posts: 43
|
|
ISR(INT1_vect) {
Mag_Stripe_ISR();
}
Mag_Stripe_ISR() {
unsigned char next_bit, ID_bits, temp, ID_char;
next_bit = ~PINC;
next_bit = next_bit >> 4;
next_bit = next_bit & 1;
switch (next_state) { ETC.....} |
|
|
| |
|
|
|
|
|
Posted: Mar 30, 2012 - 07:08 PM |
|


Joined: Jul 18, 2005
Posts: 62299
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
Oh no you don't. One thread and stick to it.
(as this one has nothing to do with GCC it's this one that gets locked) |
_________________
|
| |
|
|
|
|
|
|
|