Serial Port Timeout


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2004
    Location
    brighton
    Posts
    149

    Question Serial Port Timeout

    Hi People

    Could someone be able to point me in the right direction here
    I am running a Data Logger which is in sleep mode for 99% of the time
    The problem is that I wake the PIC from sleep when it receives any
    character from the Serial port and jumps to my Sub Routine Called SETMODE
    This all works fine and if I type the word SET and if the word typed is not
    correct its times out and go back to the label SLEEP_AGAIN, where the Pic
    goes back to sleep.
    This is all achieved by me linking my RX line to RBO Interrupt.
    The problem is that , once in the Label SETUP_MODE, if no character is
    received the program doesn't timeout to label SLEEP_AGAIN only if a
    character is received but
    Not the correct character.

    Is there a way I can make the program timeout if no character comes in


    Isaac

    SETUP_MODE:

    HSEROUT[" **** SET UP MODE ***** ",10,13,10,13 ]
    '================================================
    Hserin 2000, SLEEP_AGAIN, [WAIT ("SET")] ' Get the word SET from serial
    port
    'WAITS FOR 2 SECOND FOR THE TEXT SOIL
    '=================================================

    Rest of program here

    End

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


    Did you find this post helpful? Yes | No

    Default

    what about some FOR TO NEXT loop with PAUSEUS to poll the RCIF bit???
    Steve

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

  3. #3
    Join Date
    May 2004
    Location
    brighton
    Posts
    149


    Did you find this post helpful? Yes | No

    Default

    Thanks steve

    \but i don't understand what you mean here

    isaac

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


    Did you find this post helpful? Yes | No

    Default

    Can you post the PIC you use and schematic?? We can work on something for you.
    Steve

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

  5. #5
    Join Date
    May 2004
    Location
    brighton
    Posts
    149


    Did you find this post helpful? Yes | No

    Default

    I am using an 18f452 with the RX line tired to RB0 Interupt.
    This is because when is sleep mode any activity on the RX line (ie when i
    type in hypertheminal) the pic wakes up.
    RB0 has a 10k pullup resistor to +5v


    Isaac

Similar Threads

  1. interfacing to the pc serial port
    By kelangfei in forum General
    Replies: 4
    Last Post: - 7th October 2007, 22:35
  2. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  3. serial port control relay
    By win_832001 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 23rd June 2006, 23:56
  4. Replies: 2
    Last Post: - 28th April 2006, 12:10
  5. Receiving data from more than one serial Port
    By PICtron in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th March 2005, 10:20

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