SERIN2 WAIT problem


+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    306

    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
    1,640

    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
    This is more entertaining than Free to Air TV

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

    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
    2,941

    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
    1,640

    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
    This is more entertaining than Free to Air TV

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

    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
    306

    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, 09:52
  2. Serin2,Serout2,Wait problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 11th March 2012, 22:18
  3. Serin2 multi wait?
    By cburtis in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 24th November 2007, 19:08
  4. Serout2 and Serin2 problem
    By MrSafe in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 26th July 2007, 04:33
  5. serin2 DEC problem
    By PortlandJohn in forum Serial
    Replies: 0
    Last Post: - 6th April 2006, 12:56

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts