Shop OBEX P1 Docs P2 Docs Learn Events
How do you declare a pin to receive? — Parallax Forums

How do you declare a pin to receive?

p00ndawgp00ndawg Posts: 70
edited 2010-07-06 20:13 in Propeller 1
and then how can you use whatever that pin receives in a useful way? like say if you know you're transmitting a number to that receive pin how can you grab that number from the receive pin?

Comments

  • LeonLeon Posts: 7,620
    edited 2010-07-05 22:19
    You could use something like the simple serial software here:

    obex.parallax.com/objects/183/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • p00ndawgp00ndawg Posts: 70
    edited 2010-07-05 23:07
    ah yes I am using that. But when I receive something im still not quite sure how to get a value from what im receiving. or use it properly.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-07-05 23:36
    You need to ask more specific questions to get specific answers.

    There are a variety of techniques to send data from one device's I/O pin to another device's I/O pin. A number of these are standardized like asynchronous serial and both SPI and I2C synchronous serial. All of these send a series of 8-bit bytes these days. They've all been used to send other numbers of bits at a time, but 8-bit bytes are generally what's done today.

    Once you have an arbitrary series of bytes sent from one place to another, now there are all sorts of ways to send more complex data over these byte streams. How you do that depends a lot on what sort of data you want to send.

    Using the data "properly" depends entirely on what you mean by that.
  • LeonLeon Posts: 7,620
    edited 2010-07-05 23:41
    You could hook up eight LEDs to output pins and display the received data on them, or output the data to a TV or monitor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • p00ndawgp00ndawg Posts: 70
    edited 2010-07-05 23:55
    ok well im using the prop motor board to drive this RFID reader(http://www.robotshop.ca/apsx-rw-310-rfid-reader-writer-module-ttl-1.html).
    Im getting it to scan by transmitting the value to scan(from data sheet) using simple serial. Except im not sure on how to use the rx method to actually receive the tag im reading.
    At the moment im just outputting the number to the parallax serial terminal, but its wrong. Id like to be able to see the tag number.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-07-06 01:03
    Just glancing at the link you provided, it looks like the RFID reader is designed to receive and send standard asynchronous serial data using logic levels. You'll have to refer to the reader's documentation to see just what it's supposed to be sending. You can use the receive method of any of the receive objects (like FullDuplexSerial) to receive whatever's sent from the RFID reader and display it using whatever display you want. Just use the RX method to get each character and use the HEX method of the display driver object (like TV_TEXT) to display the byte value received.

    Again, you need to provide some information about what you're trying to accomplish. You also need to read the documentation on the RFID reader and provide some of that in your question. It's not fair to expect us to do that for you.
  • p00ndawgp00ndawg Posts: 70
    edited 2010-07-06 01:16
    Ill post some code tomorrow morning to show you what im asking.
  • p00ndawgp00ndawg Posts: 70
    edited 2010-07-06 19:51
    lets see if this makes a little more sense about what im trying to do.
    Whenever i print tagid whatever comes out seems to be garbage.

    Maybe im not understanding serial. Any help appreciated.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-07-06 20:05
    I guess I don't under stand what you're doing. Obviously, you're initializing PST and FDS with Rpin as the receive pin for the Prop and Rxpin as the transmit pin for the Prop. Then you're watching Txpin for a high level. Why? It's an output controlled by FDS. You could use the RXCheck method in FDS to see if there's anything in the receive buffer. Then you're ignoring FDS and trying to read the bits from the RFID reader after you get them and throw them away with FDS.rx.

    Anyway, you need to either use FDS or use one of the "bit-banging" routines like Simple_Serial or use your own "bit-banging" routine like rfidRead, but not more than one.

    I think you'd be better off starting with a straightforward flowchart or similar prose description of what you're doing, then flesh it out (and test it) one piece at a time.

    I believe there's code for Parallax's RFID reader in the Object Exchange. You might have a look at that and see if you can adopt it to your RFID reader.
  • p00ndawgp00ndawg Posts: 70
    edited 2010-07-06 20:13
    Thanks mike I think I understand. So I should be able to using FDS to get all the bits that the rfid is reading? I shouldnt need to write extra code?

    EDIT: yea I got it working thanks alot mike.

    Post Edited (p00ndawg) : 7/6/2010 8:18:07 PM GMT
Sign In or Register to comment.