Interfacing ID-20 with PIC 16F88

Hey guys, forgive me if this is in the wrong section, I’m new to the forum.

Using an ID-20 Innovations RFID reader, I’m trying to send the ID that the reader gets to a PIC 16F88 microcontroller.

I have followed the pin descriptions and output formats guide in the ID-20’s datasheet and have the Weigand26 format selected (+5V on pin 7).

I’ve connected a multimeter to the “Data 1” and “Data 0” pins… but all I’m getting is +5V on the multimeter, even when I scan a card. I did read that I needed a 4K7 pull-up resistor on the D0 and D1 pins… and I’m honestly not sure how that’s supposed to be wired…

Can anyone explain how this works for me, or point me in the right direction? I’ve been searching google for hours. Thanks!

How about a link the the ID20 data sheet.

A multimeter won’t show much, if you are getting data out of it. You need a scope.

Here’s the link to the ID series readers (http://www.sparkfun.com/datasheets/Sens … asheet.pdf).

And I’m confused on how it’s getting the data then. It’s not just supplying power for ones and no power for zeros in pulses or something? If not… how am I supposed to read that data coming onto the pins of my PIC chip?

You need to look at the data sheet:

pin 8, Data 1 is a clock and pin 9, Data 0 is the data. See the Scope capture images and Start and End Sequences For Magnetic Timing. The Card present signal is on Pin 5 and these three signals are similar to SPI serial. Connect these three lines to input oins on the PIC. The code then needs to wait for the Card Present signal to go low, count off 10 clocks, then read the data line on each of the next clock rising edges.

The data Structures are in the data sheet. It also appears that the data is Manchester encoded which your PIC code will need to decode.

But I am a little confused:

They do list an ASCII data mode but I’m lost as to how this may be selected. Maybe its the Format Selector on pin 7, tied to ground selects ASCII but whether this is inverter or not on the ID-20 is another question as on the ID-20RW it states this can be directly connected to an RS232 port therefore inverted.

This may take some experimenting to get correct data as there appears to be several pin and data formats. An O’scope would really come in handy for this device.

Do you have a PICKit2? If so use its logic analyzer function to look at the data pins of the ID20.

Okay, just to be clear, the reader outputs the clock right? And how is that read by the PIC? Does the reader just send continuous on/off really fast?

And another question… the datasheet states that the clock and data pin … * Requires 4K7 Pull-up resistor to +5V… do where/how do I hook up the resistors? Have the clock and data pins go to somewhere separate on my breadboard, and then have a resistor connect from that spot to the PIC input pins?

I’ve gotten a little confused with this device also.

Re-reading all of your posts I see you have selected the Weigand26 format. I was looking at the Magnetic Emulation format in the last post.

In the Weigand26 format (and Mag. Em.) 4.7k Ohm resistor pull-ups to +5V are require on pins 8 & 9 (I’ll guess these are open collector or open drain outputs).

There is a Data Format Structure for Weigand26 on 4 of the data sheet but I do not understand it or Data0 & Data1. Yet. so off to google…

Did find this on Weigand26 :

http://www.edaboard.com/ftopic104482.html

http://www.hidglobal.com/documents/unde … _wp_en.pdf

http://en.wikipedia.org/wiki/Wiegand_interface

Finally an explanation of Data0 & Data1. The Wiki article does explain them well enough.

This one: http://www.ibtechnology.co.uk/pdf/magswipe_dec.PDF

has a bit more detail including a timing diagram and a few of the other links on the Wiki page have more than enough info to use decode the Wiegand 26-bit format.

These are basically differential signals at TTL levels so they connect directly to input pins on a 5V PIC.

The PIC code just needs to read these inputs and decode the Data0 & Data1 into logic highs or lows.

Thank you for helping me thus far waltr. I’m still not quite sure how I’m supposed to hook up the “pull-up” resistors… I’ve never used them before. I understand I have to hook one side of the resistor to +5V… but I’m unsure about where the other side should go.

Also, for Weigand26, all I’m getting is a constant +5V output (without the pull-up though), so do you think adding the resistors where necessary will change this? Or maybe the highs and lows are going so fast that my multimeter can’t keep up reading those changes?

As you’ve been told a couple of times, a multimeter won’t show anything. You need a scope.

A pullup resistor is just connected between the pin and Vcc.

I have to hook one side of the resistor to +5V…

and the other end of the resistor goes to the pin (signal line) that needs to be pull-up. Google Pull-up and Open Collector for info on how and why.

I’m getting is a constant +5V output

Like Leon and have said several times you will NOT see these signals on a meter.

Why? Look at the timing diagram in the last link I posted. The signals are high (5V) most of the time and go low (ground) for 50usec every 2msec. A meter averages this signal so at best you may see 4.875V instead of 5V when the chip is sending and that is if the chip sends continuously for several seconds which it does not.

I have asked a few other questions that would allow me to help you better. Without answers to these questions no one can help much.

Thank you guys. That’s exactly what I needed. I wanted to know why I couldn’t use a multimeter. And I’ll be getting a scope today to look at all this. I’m sorry if I asked the same questions, I didn’t understand what was meant by the answers until just now.

And I’ve put the pull-up resistors in going from +5V to the readers pins 8 & 9, so hopefully that will work.

Right now I have the PIC reading the 2 data pins and displaying if they are high or low on an LCD screen. That says they are always high as well. I know you said the multimeter doesn’t update fast enough, but would the LCD screen connected to the PIC? Or is that still too slow to show the changes?

Thanks!

Well the data pins go low for only 50usec, that’s 50X10^-6 seconds or 1/20,000 second so I doubt that an LCD could display them.

Try code that when it reads the input as a low sets a bit (register value) and outputs this for a few seconds. Then clears the bit and waits for the next time the input goes low.

What programmer are you using for the PIC? Is it a PICKit2?

Okay, I’ll try that. I’m using the PG3B programmer