everhack Stuff I've been messing with, or just thinking about.


RFID Reader, part 4, detecting bits! (well, 1’s at least)

After wrestling and backing up a bit and rewriting a good part of it, I finally got the analog comparator and input capture scheme working.

Timer1 counts continuously while the antenna signal is being generated.

The analog comparator is configured to trigger the Timer 1 Input Capture interrupt whenever the signal detector voltage crosses an analog threshold voltage.

Whenever there is a rising edge (input signal rises above threshold), I check to see if timer1 has exceeded a certain value or not. If there's been no rising edge within a certain length of time, we either have a "1" bit, OR we have no card at all.

"No card" is handled by only allowing a minimum AND maximum "low time" (I.e. 1's can only be SO long).

The picture below shows the modulated antenna signal in blue, and the detected 1-bits in yellow. Now I'm finally able to get started on actually storing 0's and 1's.



Since the input capture interrupt is called twice on every cycle, we need to know if it has been longer than about 5 or 6 complete cycles since the last FALLING edge.

Looking at the Microchip spec now, I realize I didn't QUITE implement it properly.

According to this picture, I should actually be timing the duration of consecutive cycles above AND below the threshold. I was only timing the length of the LOW portion. I'm not certain whether it really matters or not, time will tell.


Anyhow, this should be "good enough" for now, the next thing I'll work on is actually storing the consecutive bits and looking for a header of some kind to determine the beginning of the string. I also planned to implement some error correction by requiring several consecutive matching reads before deciding that we've actually detected the signal correctly and completely.




Comments (0) Trackbacks (0)

No comments yet.

Leave a comment

No trackbacks yet.