SerIn & wait


Closed Thread
Results 1 to 5 of 5

Thread: SerIn & wait

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Location
    Switzerland
    Posts
    46


    Did you find this post helpful? Yes | No

    Default

    Thanks for your replies.
    I believe i was not clear enough with my explanation.
    I receive a serial string : wers-ABC,897-00587
    now this string does not contain ABC and 123 so in this
    case serin2 command has nothing to do, it loops waiting for another
    string.
    If I receive a serial string: qwts-ABC,123-98756 now serin2 has
    to do something.
    Serin2 has to wait not only the characters ABC but ABC and 123.
    This is a classic serin line: SerIn2 pinin,396 [wait ("ABC"),testbyte]
    but in my code line serin2 should wait not only for ABC but ABC and 123.
    Hope to be enough clear.
    Thanks and bye

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    this on work with HSERIN, should also work with SERIN2
    Code:
        DEFINE   LOADER_USED 1
        DEFINE   OSC 20
        DEFINE   HSER_RCSTA 90h
        DEFINE   HSER_TXSTA 24h
        DEFINE   HSER_SPBRG 129 ' 9600 Bauds
        DEFINE   HSER_CLROERR 1
        
        discard  var byte
        ArrayVar var byte[10]
    
    start:
        hserin 5000,NotReceivedYet,[wait("abc"),discard,wait("123"),str arrayvar\10\13] 
        hserout ["Discard:",discard,13,10,_
                 "Received:",str arrayvar,13,10]
        goto start
    
    NotReceivedYet:
        hserout [13,10,"no!",13,10]
        goto start
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Can't read sequential addresses in external EEPROM
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2010, 15:46
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 22:07
  3. serin question?
    By sachymo in forum General
    Replies: 5
    Last Post: - 27th July 2008, 11:04
  4. Problem with PBP interrupt and Serin, please help
    By rgregor in forum mel PIC BASIC
    Replies: 0
    Last Post: - 22nd August 2006, 20:02
  5. Serin with low voltage
    By f_lez in forum General
    Replies: 3
    Last Post: - 21st August 2006, 12:52

Members who have read this thread : 0

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