-
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....
-
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
-
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.
-
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.
-
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