Hello all, I have been lurking and reading for awhile, and I am comparatively new to the Propeller. I am stuck on figuring out a suitable course of action regarding reading these 125KHz RFID passcards.
I have a HID brand MiniProx reader that outputs a protocol called Weigand, but there is a daughterboard that converts the Weigand format to a clocked-type of bitstream, and I am having difficulty figuring out how to proceed.
I need to be clear, I have been wrestling with this for quite awhile, and I absolutely am not asking anybody here to write my code for me.
I am a decent at PBasic, PIC Basic PRO, Motorola assembly, BasicX, and a couple others that escape me right now. I need a couple promotions to be considered a novice with Spin, and I am definitely wrestling with Propeller Assembly for now. I have RTFM, and I have purchased a couple Propeller books, one of which is "The Official Guide", so I have no problem doing my homework.
With that out of the way, I am trying to build a standalone controller for these cards that has a power supply, the reader, the daughterboard, and a serial LCD. The reason for the project is because the inkjet ID number wears off of the cards after awhile, and I am looking for a way to extract the ID without scanning the card at the fuel pumps, so that I can engrave them onto the cards.
There are two lines from the daughterboard that I need to decode; a clock, and a data. These two lines idle at +5 volts all day long until a card is scanned. When a card is successfully scanned, the reader beeps and begins pulsing the clock line low for approximately 300 microseconds, with a period of 2 milliseconds per bit. When the clock line pulses low, if the data line is low, that is a 0, and if the data line is high, that is a 1. From my reading, there are 26 bits that arrive from the controller- I can parse the bitstream myself, but I am having trouble setting up the propeller to be waiting for the first bit, and collecting the required number of bits.
After a successful read, the controller will output to the LCD the required information for a few seconds, then clear the screen and start over waiting for another card. I can write to the LCD with no problems, and have created an object with the LCD constants pre-declared.
I have tried "waitpeq", "waitpne", "if" and some other different attempts, but I can't get it to capture a bit, shift it into my variable, and capture the successive bits- it always hangs, and I am not good enough yet to figure out why. I plan on buying Viewport within the next few days but I am waiting on a check that hasn't arrived yet.
So there it is in a (lengthy) nutshell: wait all day for the clock to start pulsing, when it does, count off 26 bits and shift the level of the data line into a variable. It seems easy, and yet I can't figure out how to do it. The low pulses of the clock (and data when it is 0) are kind of quick, but it seems to me that a period of 2 mS is plenty of time to shift the bit in and rearm itself.
Without writing my code (unless you really want to, of course) can somebody maybe offer up some advice on a basic strategy for me? I can't express how much I would appreciate any help.
If I didn't explain it well enough, please let me know.