Serial interface with RFID reader


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    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

  2. #2
    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, 22:16
  2. Replies: 33
    Last Post: - 19th March 2010, 03:02
  3. parallax rfid reader module interface with PC
    By jonil22 in forum Off Topic
    Replies: 2
    Last Post: - 3rd February 2008, 06:54
  4. Parallx rfid reader module interface with PC
    By jonil22 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st January 2008, 08:50
  5. PIC16F877 to RFID Module Serial Interface
    By koossa in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th May 2005, 06: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