Shop OBEX P1 Docs P2 Docs Learn Events
Propeller and HID ProxPoint Plus — Parallax Forums

Propeller and HID ProxPoint Plus

I'll admit it off the bat I am new to the propeller. I am trying to read the card number with the Propeller and I have been unsuccessful. I have it working with an Arduino Micro but wanted to try it with the propeller. I basically have to read when D0 and D1 on the reader go low. I have the D0 connected to the propeller with a 4.3k resistor, as it is 5v from the reader, to pin 39 and D1 with a 4.3k resistor to pin 40. Below is a snippet of code for testing if anyone can assist it will be greatly appreciated.

#include "simpletools.h"

void testReader (void)
{
high(39); //set pin to high had to do it on the Arduino tried it both ways with propeller no different.
high(40); // same as above
int read0; // input of pin 39 saved here
int read1; // input of pin 40 saved here
while(1) // none stop loop
{
read0 = input(39); // read pin 39
read1 = input(40); // read pin 40
print("read0 = %d\n", read0); // print to console value of pin 39
print("read1 = %d\n", read1); // print to console value of pin 40

}

output on console is 0 for both even if I swipe a card on the reader. I've never asked for help on a forum before please let me know if I didn't provide enough info.


Thank you,
Anthony

Comments

  • The propeller only has 32 I/O pins (port B is not hooked up). Verify which pins you are connected to.

    Based on the D0/D1 comment, I assume this is using the Wiegand interface. If so, then you shouldn't need to drive the pins high, as the card reader should already be doing that. Just keep the pins direction as input (the default).
  • kwinnkwinn Posts: 8,697
    As Seairth posted you don't need to drive the pins high, the card reader does that. The I/O signals are not designated by pin numbers as you seem to be doing in your code. They are designated by the bit position in the input register. Pin 39 would be bit 30 on the dip which is what I guess you have since it is Vss on the 44 pin packages.

    BTW, bits 30/31 are used for serial data to program the chip so best to avoid them. Avoid 28/29 as well. They connect to the eeprom.
  • kwinnkwinn Posts: 8,697
    Best to define the pins you use either as:

    P0 = 0
    P1 = 1
    etc.
    P31 = 31

    That matches the prop documentation.

    Even better to use the pin function:

    HID-D0 = 0
    HID-D1 = 1
  • Has anyone successfully created SPIN code to read various length Wiegand coded RFID cards they are willing to post?
  • kwinnkwinn Posts: 8,697
    edited 2016-06-28 02:43
    This is a spin program I kluged together a while back to test weigand card readers and sort out a mixed bag of unmarked cards. It will read cards up to 64 bits and print the result in binary, decimal, or hex. It's a bit of a mess, but it works.
  • kwinn wrote: »
    This is a spin program I kluged together a while back to test weigand card readers and sort out a mixed bag of unmarked cards. It will read cards up to 64 bits and print the result in binary, decimal, or hex. It's a bit of a mess, but it works.

    Thanks, kwinn, I'll give it a try and post back to tell how it goes.

Sign In or Register to comment.