SERIN & Timeout


Closed Thread
Results 1 to 5 of 5

Thread: SERIN & Timeout

  1. #1
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289

    Unhappy SERIN & Timeout

    I realize a projekt with a 868MHz-sender, which acts like a home-sign.

    The sender acts OK, but the receiver makes me worry....

    I don't use the internal Hardware-UART of the 16F872 (so far)...

    I use the SERIN-command. It works ...

    But if the sender is off, the receiver gets a lot of noise, so the Timeout of the SERIN-Command will not work, it restarts while it gets some high Input...

    I have tried a lot of tricks, but it don't solve my problem (counting the impulses on the input takes to much of codespace, using a FOR-NET-Loop instead isn't better...)

    The ISM-Connecting works fine (10 Bytes $55 or so to sync and 1 Start-byte $96 and 4 Bytes ($A5 or so) to carry 8 bit of information ... I am a lousy pragmatiker)

    But the timeout in the SERIN (and more in the SERIN2) -Command makes me worry....

    At the weekend I begin to change the librarys of PBP !



    BTW: Accessing X[1] or so with the SERIN / SEROUT-command will not work, it seems to be fouly....

  2. #2
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    But if the sender is off, the receiver gets a lot of noise, so the Timeout of the SERIN-Command will not work, it restarts while it gets some high Input...


    Try tying your receiver pin to ground, to force a ground. thus hopefully getting rid of the "noise". your Serin is reacting to Noise. And you need to rid yourself of this noise.

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

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


    Did you find this post helpful? Yes | No

    Default

    Try to use the internal USART, you must use HSERIN instead of SERIN. If you want to be sure to not overflow the input buffer add

    DEFINE HSER_CLROERR 1

    at the begining of your program.


    For the noise... have you any pull down/Pull up resistor on the RX pin of your PIC. Do you use MAX232 ???

    "At the weekend I begin to change the librarys of PBP !"
    Must be sure that's the problem before...!!! I'm pretty curious to see your code and schematics before.
    Steve

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

  4. #4
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Default

    Hello,

    the noise is coming out of the ISM-receiver, because of the free floating of the filters...
    It can't be turned off with a resistor!

    Because our local dealer has no PICs, I must look at the sources in the librarys.... Uuups.

  5. #5
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Default Fixed!

    I has managed the problem....

    Throw away these timeout-feature of the PBP!
    Use handcoded programs !

    ;-)

    Using Timer1 as a Timer (475ms) and the stupid SERIN-Command to look into the stream of pulses out of the receivers...
    If there is a byte (and the SERIN will receive MANY! ... they ignore the stopbit and don't check the framing....) check it and if it is our startbyte, get the next 4 bytes.
    Putting this in a loop until the Timer is done...


    ;Timer1 setzen
    ;Teiler /8 OSC/4 als Input = 125kHz
    T1CON.5=1
    T1CON.4=1
    ;0,475 Sekunden = -59375 = 1811h
    TMR1H=$18
    TMR1L=$11
    ;INT-Flag löschen
    PIR1.0=0
    ;GO!
    T1CON.0=1
    ;Flag für Müll-Empfang setzen
    Dummy_Bit=1
    ;Funkmodul auslesen
    REPEAT
    SERIN Funk_IN,T2400,Dummy
    IF Dummy=$96 THEN
    SERIN Funk_IN,T2400,Buf_Sin[0],Buf_Sin[1],Buf_Sin[2],Buf_Sin[3]
    ;merken, daß ein Empfang stattfand
    Dummy_Bit=0
    ENDIF
    ;Zeit ablaufen lassen
    UNTIL PIR1.0
    ;Timer stoppen
    T1CON.0=0
    ;empfangene Zeichen auf Byte umrechnen
    Dummy=Buf_Sin[0]:GOSUB Manch2Bit
    Dummy=Buf_Sin[1]:GOSUB Manch2Bit
    Dummy=Buf_Sin[2]:GOSUB Manch2Bit
    Dummy=Buf_Sin[3]:GOSUB Manch2Bit

Similar Threads

  1. Serin timeout not working properly!
    By Megahertz in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 1st January 2010, 20:56
  2. SERIN timeout
    By Del Tapparo in forum Serial
    Replies: 3
    Last Post: - 20th November 2007, 04:34
  3. SERIN Timeout
    By George in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 23rd March 2007, 15:06
  4. 16F628A Serin timeout and Timer1
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th March 2006, 23:20
  5. SERIN SERIN2 Timeout
    By markedwards in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd June 2005, 18:59

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