Shop OBEX P1 Docs P2 Docs Learn Events
Can BS2 pins P0-P15 read a TTL signal? — Parallax Forums

Can BS2 pins P0-P15 read a TTL signal?

teatreeoilteatreeoil Posts: 7
edited 2011-02-11 16:50 in BASIC Stamp
I am trying to read the serial signal from the Parallax RFID reader. It seems like I should be able to do that using the serin construct, but the data I get seems to be junk. If I'm reading the reference manual right, it says the Sin pin can read TTL, but that the other pins read RS-232? Is that correct?

Unfortunately the BOE I'm using doesn't give me a jumper to Sin pin (correct?), so using Sin seems unwieldy at best - I guess I'd have to pull the IC and put it on a breadboard, and I don't want to keep putting the IC back and forth like that for code/try iterations.

Am I making sense so far, and if so, what's the best path here? Add hardware to convert the TTL out from the RFID reader to be RS-232 compatible for one of the P0-P15 inputs?

Is there any other way to proceed here? Right now I just want to read some rfid tags using the BS2 while it's in the BOE.

Comments

  • ZootZoot Posts: 2,227
    edited 2011-02-11 13:09
    Other way around! Sin is part of the 4 pin interface to the serial/usb port. Sin is the equivalent of using p16. It is ONLY for RS232 communication with a PC or similar device (for example, your program itself and the debug/debugin commands use Sin and the serial connector to communicate between the Stamp and PC).

    P0-P15 are TTL/CMOS ready pins (i.e. a 1 equals >= ~ 1.4 volts, anything less = 0).

    So if you are using P0-P15 to communicate with your RFID reader, and it doesn't work, post your code and/or a photo of your hookup.

    Do not use the RS-232 port to connect with your reader -- you'll likely damage it.

    If you want to use Sin/Sout to comm. as RS-232, use pin 16 in your code.

    This is all thoroughly documented in the manual, so I would refresh your knowledge by reading up -- before you damage a device and/or disassemble your Stamp needlessly.
  • teatreeoilteatreeoil Posts: 7
    edited 2011-02-11 13:36
    Zoot wrote: »

    This is all thoroughly documented in the manual, so I would refresh your knowledge by reading up -- before you damage a device and/or disassemble your Stamp needlessly.

    Thanks for the excellent followup. I'm no stranger to reading tech documentation, so when I get home this evening I'll quote the section of the manual which had me understanding things the other way around.

    Also, will post code and photo as requested, as well as observed output. I can get data, it just does not contain the start/end bytes, nor is it consistent with the output representing a certain alphanumeric range as described. More later, thanks!
  • Mike GreenMike Green Posts: 23,101
    edited 2011-02-11 13:42
    Page 2 of the RFID Reader documentation shows the connections to the RFID Reader. Both /OE and Sout should be connected to Stamp I/O pins (P0-P15), pick any two. As Zoot implied, Sin and Sout on the BOE are not the same as Sout on the RFID Reader. Do not connect them together. On the BOE, Sin and Sout are RS232 voltage compatible serial signals for programming from a PC. On the RFID Reader, Sout is the serial output and is TTL/CMOS compatible (as are the Stamp I/O pins (P0-P15)).
  • teatreeoilteatreeoil Posts: 7
    edited 2011-02-11 14:10
    Mike Green wrote: »
    Both /OE and Sout should be connected to Stamp I/O pins (P0-P15),

    Any reason not to tie pin 2, /OE, to ground, rather than to one of P0-P15? This is what is shown in the book "Making Things Talk" which I was vaguely following (although using the BS2 rather than an Arduino).
  • Mike GreenMike Green Posts: 23,101
    edited 2011-02-11 14:18
    The RFID Reader takes significantly more power when it's turned on using /OE. You could certainly tie /OE to ground if you want and if the additional 200mA (approx.) drain is not an issue.
  • teatreeoilteatreeoil Posts: 7
    edited 2011-02-11 14:27
    Mike Green wrote: »
    The RFID Reader takes significantly more power when it's turned on using /OE. You could certainly tie /OE to ground if you want and if the additional 200mA (approx.) drain is not an issue.

    I see. Supposing I have an application in which it would be sufficient to know if a tag was present at 15 sec intervals. Sounds like I could extend battery life significantly by polling at that interval, rather than leaving it enabled all the time. Thanks for bringing my attention to that.
  • teatreeoilteatreeoil Posts: 7
    edited 2011-02-11 16:50
    I've got the RFID reading tags now. Thanks for all your help. By eliminating several things I thought could be problems but weren't, I was able to focus on what turned out to be the real problem - I had a mistake in my baudmode in my code.

    When I get my project complete (long way to go still), I'll share it with the group. Some of you who are parents should get a laugh out of it, at least. :)

    Thanks again.
Sign In or Register to comment.