SERIN2 WAIT problem


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326

    Default SERIN2 WAIT problem

    good day to all in this forum,
    I am currently using PIC18f252 for receiving a data stream via UART connected to portc.6 .
    I use the following method: SERIN2 RX_12,396,3000,WARNE ,[WAIT("T="),STR TE\4 ] . Mode is 0.
    Everything work well but the WARNE label is not fired if the portc.6 pin is stack LOW.. It works correctly if the pin stays HIGH all the time .
    Just to summarize the timeout label is fired in case of "T=" is not received within 3 secs and the line stays HIGH.
    "T=" could not be received for the following reasons:
    > because not transmitted
    > because the line is staked LOW
    > because the line is stacked HIGH.
    I am asking if there is a possibility to jump to timeout label in all three condition.
    Any assistance is appreciated.
    Thanks in advance.
    Regards,

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,515

    Default Re: SERIN2 WAIT problem

    two thoughts
    1 investigate why rx line is being held low and stop it from happening
    2 change strategy and use the usart
    Warning I'm not a teacher

  3. #3
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326

    Default Re: SERIN2 WAIT problem

    Thanks Richard,
    I am going to try to consider all the possible failures of the radio receiver.
    Do you mean to use the HW UART pin RC7 ?
    The point is that i am using two UART in this project.
    Any other possibilty to consider ?
    Thanks again for your interest on the matter.
    regards
    Ambro

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,993

    Default Re: SERIN2 WAIT problem

    If you can use another PIC there are some with 2 uarts. Either 16F or 18F like these:

    16F19175
    16F19176
    18F43K22
    18F44K22
    18F45K22

    and many other pin compatible with your chip.

    Ioannis

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,515

    Default Re: SERIN2 WAIT problem

    Do you mean to use the HW UART pin RC7 ?
    yes , you did not indicate the uart was already in use


    Any other possibilty to consider ?
    as ionis says a better chip with 2 eusarts
    or
    check pin status before using serin
    or
    write your own serin routine that can detect a permanent spacing condition
    Warning I'm not a teacher

  6. #6
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166

    Default Re: SERIN2 WAIT problem

    I have to ask, What is the serial input port connected to? Does the receiver have a CMOS output meaning it can sink and source voltage for the input pin? If it is an open collector output from the receiver then I would connect a pullup resistor of about 10K ohms from +5 to the input pin of the micro. I have never had issues with the SERIN command if used with a pullup resistor.
    Dave Purola,
    N8NTA
    EN82fn

  7. #7
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326

    Default Re: SERIN2 WAIT problem

    Thanks very much for all the suggestions received.
    I did solve the problem by checking the pin state before launch SERIN2: it is working now.
    All the best to all of you,
    regards

Similar Threads

  1. problem in serin2
    By FADI984 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th December 2012, 10:52
  2. Serin2,Serout2,Wait problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 11th March 2012, 23:18
  3. Serin2 multi wait?
    By cburtis in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 24th November 2007, 20:08
  4. Serout2 and Serin2 problem
    By MrSafe in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 26th July 2007, 05:33
  5. serin2 DEC problem
    By PortlandJohn in forum Serial
    Replies: 0
    Last Post: - 6th April 2006, 13:56

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