Shop OBEX P1 Docs P2 Docs Learn Events
Newbie needs help with Cheapertronics RFID to Stamp serial connection. — Parallax Forums

Newbie needs help with Cheapertronics RFID to Stamp serial connection.

ForceFedForceFed Posts: 5
edited 2008-07-22 23:58 in BASIC Stamp
Hi everyone,
I am using a CheaperTronics.com RFID receiver to read an active RFID tag I got from them also. I have connected the receiver directly to a pc and tested it. It runs at 9600, 8 ,N,1 on hyperterminal with no problems. The only thing that is output from the receiver is a 4 digit alphanumeric code followed by a space. I have connected pin 3 of DB9 from the receiver to pin 2 of my basic stamp 2. Pin 5 from the receiver is connected to Vss on the BOE. I am using a SERIN command to fetch the incoming data
SERIN 2,84,[noparse][[/noparse]WAIT("23wL")]


My program will stop when it gets to that command and nothing happens unless I quit manually. The RFID tag outputs it's unique string every 2.5 seconds. I have it active before running the program to make sure it will be visible to the receiver. I even tried reading the tag ID in using a string variable but it never happened that way either. In the stamp manual I saw that you need to use a 22k resistor in series with the input line to the stamp on any input line, but it is not needed on pin 2(reason why I used pin2). Do you think I should use one anyway? Also if the RFID receiver works with my pc then wouldn't I need a max232 to connect to my stamp? Not sure which is which but I think computer logic levels are CMOS and electronics are usually TTL. So I think this means I would need a MAX232 to convert the CMOS signals from the serial out of the RFID to the TTL levels the stamp can accept?
Thanks in advance,
Jared

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-22 20:05
    Depending on the construction of the CheaperTronics RFID receiver, you may have damaged your Stamp. You cannot connect an RS232 output directly to a Stamp I/O pin. At the very least, you will need a resistor (like 22K) in series as described in the SERIN chapter of the Basic Stamp Reference Manual. I believe that you will need to use "inverted" mode when connecting to an RS232 output like this.

    RS232 normally uses +5 to +8V for one logic level and -5 to -8V for the other. The negative voltages and the higher positive voltages can damage or destroy an I/O pin or the whole Stamp if there's enough current available.

    Post Edited (Mike Green) : 7/22/2008 8:12:30 PM GMT
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-07-22 20:17
    If you're REALLY using physical "Pin 2" on the BS2, you'll need to use "SERIN 16, 84, [noparse][[/noparse]...]"
  • ForceFedForceFed Posts: 5
    edited 2008-07-22 20:19
    Thanks for the reply, I was afraid that I might have caused damage, but the rest of the stamp seems to work fine so if anything I hope I just damaged an input. If my stamp is not damaged the circuit should use a max232 before I try again correct?
  • ForceFedForceFed Posts: 5
    edited 2008-07-22 21:12
    allanlane5 said...
    If you're REALLY using physical "Pin 2" on the BS2, you'll need to use "SERIN 16, 84, [noparse][[/noparse]...]"

    Thanks for pointing that out, I did have it connected to physical pin 2 on my BS2. Going to go pick up a 232 a radio shack and try it out. I have been trying to find current draw for the max232 to calculate voltage drop resistor to drop from 9v to 5v?

    jared
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-22 22:29
    If you've connected your RS232 signal to the Stamp pins marked "Sin"/"Sout", these already have an RS232 interface with some special characteristics.· In particular, SERIN and SEROUT use pin "16" to refer to this serial port and anything sent to the Stamp will be echoed back.

    The Stamp module has a 5V regulator and, if powered from Vin, will output +5V on the Vdd pin.· There's limited current available there (50mA total).
  • ForceFedForceFed Posts: 5
    edited 2008-07-22 23:37
    I am confused confused.gif Right now I have my circuit connected to physical pin 2(sin) on the BS2. In my code I refer to this pin as pin 16. The output from my RFID is a string of 5 characters "23wL(sp)", which I am only waiting for the first 4 "23wL" I have the SERIN command written as follows
    SERIN 16, 84,[noparse][[/noparse]WAIT("23wL")]
    


    This is all of my code other than the DEBUG command afterwards so that I know it worked. Does the Sin pin on the BS2 have an integrated MAX232 or do I still need to wire one in?
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-22 23:58
    The Stamp has built-in voltage conversion circuitry on Sin/Sout for RS232 voltages.· The Stamp Manual shows the circuit.
    ·
Sign In or Register to comment.