Serin2


Closed Thread
Results 1 to 6 of 6

Thread: Serin2

  1. #1
    2a03111's Avatar
    2a03111 Guest

    Default Serin2

    The SERIN2 timeout function doesn't seem to work. I connected it to a RF receiver and it never seems to jump out of the timeout. Anyone knows what the problem is?

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    As long as the input pin is toggling (even just with noise), the timeout will keep being reset. Also, I cannot recall which (but you can easily test this), but if the input is in the wrong state when at idle, it won't time out either.

  3. #3
    2a03111's Avatar
    2a03111 Guest


    Did you find this post helpful? Yes | No

    Default

    Is there anyway to overcome this?

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    First identify - is your problem noise or inversion (ie by inversion I mean is the idle in the wrong state for timeout to happen)?

  5. #5
    2a03111's Avatar
    2a03111 Guest


    Did you find this post helpful? Yes | No

    Default

    It is noise. No problems when I connected it to GND.

  6. #6
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Then you have a problem.

    If you have a Carrier-Detect signal from your RF module, you can AND that with the input going to the SERIN pin like a pseudo 'Squelch' control. This will solve some of the problem BUT it will be at a cost of Range and introduce a few other problems which for brevity I'll skip at this time. It is not a full proper solution but it's easy for those that don't know better.

    Everyone feeds the output of the RF module straight into a PIC and expects results. This is not the professional way to go. SERIN does a lot for those that can't do it for themselves, but there are limitations - and you've just come across one of them.

    With Radio, a single noise spike in the wrong place can easily destroy a complete data packet (or prevent a timeout) and it is therefore unwise to try to use SERIN (or for that matter the Hardware UART) directly. Just because everyone uses this method, or details it in their applications books, does not mean it is the correct way to go. It is NOT. It is very very amateurish and no true professional would subscribe to this method of use.

    The best method is to take multiple samples of each bit period and reconstruct the data by majority decision. This will handle noise spikes and also the 'jitter' that you get as receivers are operated at the extremes of range. Using this method you get reliability under adverse noise conditions, an extended range far beyond what is achieved using other methods and a controlled timeout. So basically, don't use SERIN, HSERIN, DEBUGIN or whatever, and write your own routine to do what I've just described above.

    Melanie

Similar Threads

  1. GPS $GPRMC to PIC16F684. Need help with SERIN2
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th November 2009, 09:47
  2. Getting SERIN2 to work?
    By BobPigford in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 22nd July 2009, 20:10
  3. SLOW Serin2 and Serout2
    By dragons_fire in forum General
    Replies: 3
    Last Post: - 26th June 2009, 02:38
  4. SERIN2 digit parsing
    By skimask in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th January 2007, 23:15
  5. SEROUT2 and SERIN2 commands
    By bangunprayogi in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th August 2005, 09:03

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