SEROUT2 and multiple WORDS


Closed Thread
Results 1 to 2 of 2
  1. #1
    atomski's Avatar
    atomski Guest

    Post SEROUT2 and multiple WORDS

    Hello everyone,

    I've decided to start a new thread
    regarding my 16F628 project problem
    (solved thanks to Melanie)...

    I have another question. Is there a way
    to send/receive several consecutive
    WORD sized variables over rs-232 (SW
    USART) using single SEROUT2/SERIN2
    command?
    For example, can I send this using a
    single SEROUT2 command:

    SEROUT2 tx,16780,["ENTER T1",13,10]
    SEROUT2 tx,16780,["ENTER T2",13,10]
    SEROUT2 tx,16780,["ENTER T3",13,10]
    SEROUT2 tx,16780,["ENTER T4",13,10]
    SEROUT2 tx,16780,["ENTER T5",13,10]

    I'm pretty sure I coud do it this way:

    SEROUT2 tx,16780,["ENTER T1","T2","T3","T4","T5",13,10]

    However, how can I receive and store 5
    consecutive values to variables with
    one SERIN2 command? I would
    appreciate if someone could give a clue
    as to what I should do to make this
    happen.
    Attached Files Attached Files

  2. #2
    atomski's Avatar
    atomski Guest


    Did you find this post helpful? Yes | No

    Default Re: SEROUT2 and multiple WORDS

    Originally posted by atomski
    Hello everyone,

    I've decided to start a new thread
    regarding my 16F628 project problem
    (solved thanks to Melanie)...

    I have another question. Is there a way
    to send/receive several consecutive
    WORD sized variables over rs-232 (SW
    USART) using single SEROUT2/SERIN2
    command?
    For example, can I send this using a
    single SEROUT2 command:

    SEROUT2 tx,16780,["ENTER T1",13,10]
    SEROUT2 tx,16780,["ENTER T2",13,10]
    SEROUT2 tx,16780,["ENTER T3",13,10]
    SEROUT2 tx,16780,["ENTER T4",13,10]
    SEROUT2 tx,16780,["ENTER T5",13,10]

    I'm pretty sure I coud do it this way:

    SEROUT2 tx,16780,["ENTER T1","T2","T3","T4","T5",13,10]

    However, how can I receive and store 5
    consecutive values to variables with
    one SERIN2 command? I would
    appreciate if someone could give a clue
    as to what I should do to make this
    happen.
    I did a little experimenting, spent about
    2 days busting my gray cells and found
    a way to do what I wanned. Here's an
    example:

    SERIN2 rx, 16780,[DEC1 T1,DEC2 T2, DEC3 T3,DEC4 T4,DEC5 T5]
    WRITE 0, T1
    WRITE 1, T2
    WRITE 2, T3 'Word sized var takes up 2 eeprom locations
    WRITE 4, T4 'Word sized var takes up 2 eeprom locations
    WRITE 6, T5 'Word sized var takes up 2 eeprom locations

    I guess writting to an eeprom could be
    done diffrently, however this worked for
    me nicely... Just my 2 cents

    --
    Sincerest regards,

    YZ7REA Vladimir M Skrbic
    4N7ATV Repeater Administrator
    YU7GHZ Radio Club President

Similar Threads

  1. Problems controlling multiple pics
    By gandora in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 29th May 2007, 08:59
  2. Problem reading multiple ADC ports
    By jswayze in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 4th November 2004, 16:46

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