Serial interface with RFID reader


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by brid0030 View Post
    My serin2 statement differs from the examples in the book in many ways. And I don't know which differences are important. I've tried lots of variations, and the error is not "plain as day" to me. Can I just get an answer? I promise I have not come the forum as a first resort.
    My point exactly: You're serin2 statement differs from the examples in the book in many ways.

    Does that tell you anything? Such as that if it differs, it probably won't work right.

    Try to make your serin2 statement look like something in the book. Compare the SERIN with the SERIN2 statement. What's different about the two? Specifically, the 3rd paragraph of Page 132 and the 2nd paragraph of Page 130.
    It's just that easy! Really it is.

    You could 'just get an answer', but you're not going to learn anything about learning anything.

  2. #2
    Join Date
    Nov 2006
    Posts
    70

    Default Success

    The following code works. Serin2 modes differ from serin modes, and I think the variables for serin and serout ports have to have numbers.

    DEFINE OSC 20

    S0 var portb.0 ' Define serial out pin
    S1 var portb.1 ' Define serial in pin
    RDR1 VAR portb.3 ' serial in from reader
    RST1 VAR portb.2 ' reader reset
    B0 var byte 'byte variable
    tag var BYTE[10] ' Creates a byte array of 10 bytes

    HIGH RST1 'reset Reader

    loop: Serin S1,6,B0 ' B0 = input character
    PAUSE 1500 'wait a sec
    Serout S0,6,["ready "] 'Send ready
    SERIn2 RDR1, 16468,[skip 2, STR tag\10] 'read in tag ID
    SEROUT S0,6,["got the code: "] 'acknowledge
    print: Serout2 S0,16468,[STR tag] 'send out tag ID
    Serout S0,6,[" done"] 'print done
    Goto loop 'do it again

  3. #3
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by brid0030 View Post
    The following code works. Serin2 modes differ from serin modes, and I think the variables for serin and serout ports have to have numbers.
    Good game....That's what I was getting at the whole time.

    SERIN/SEROUT; use modes (t2400, n9600, etc)

    SERIN2/SEROUT2; you have to figure out the 'mode number' depending on what you want to do according to the manual (or towards the back somewhere there's a table with a lot of values already in it). But one of the advantages of the SERIN2/SEROUT2 over regular SERIN/SEROUT is that you can set it up to run at 4,578 baud if you want (I don't know if that works out in the math, but I think you get my point), that and the big one is the much better string/variable handling options.

Similar Threads

  1. Parallax RFID Reader code example
    By dan-tron in forum Code Examples
    Replies: 4
    Last Post: - 19th April 2013, 23:16
  2. Replies: 33
    Last Post: - 19th March 2010, 04:02
  3. parallax rfid reader module interface with PC
    By jonil22 in forum Off Topic
    Replies: 2
    Last Post: - 3rd February 2008, 07:54
  4. Parallx rfid reader module interface with PC
    By jonil22 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st January 2008, 09:50
  5. PIC16F877 to RFID Module Serial Interface
    By koossa in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th May 2005, 07:03

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts