Wauuuuuuuu!
Thanks people for so much help.
I will never forget this!
Bye Pesti.
Wauuuuuuuu!
Thanks people for so much help.
I will never forget this!
Bye Pesti.
Would you mind posting a snipet of your Serin code. I too am using a 433Mhz receiver which has 4 outputs. 1-3 are depending on which of the 3 buttons on the fob are pressed, but the 4th emits serial data, like the serial number of the fob device.
I owuld be interested in how you are capturing your serial code.
Many thanks,
Steve
Hi,
I try to capture with audio visual method or connect direct from transmitter output to my second PIC.
But the problem is I can not make the same wave I dont know why!, I have tryed with 300 Baud then with 1200 but I can not have the same binary tone.
I use just a normal Serin command:
Define LOADER_USED 1
Include "modedefs.bas" ' Mode definitions for Serout
ADCON1=7
define osc 4
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_SPBRG 207 ' 1200 Bauds
DEFINE HSER_CLOERR 1
' Alias definition
' ================
'
'
RCIF VAR PIR1.5 ' Receive interrupt flag (1=full , 0=empty)
TXIF VAR PIR1.4 ' Transmit interrupt flag (1=empty, 0=full)
' Variable definition
' ===================
B0 var byte
pause 10 ' safe start-up delay
Main:
serin porta.0,N1200,B0
serout porta.1,N1200,[B0]
hserout [#B0]
goto main
This photo is what I have captured from my transmitter.
This wave is made from the transmitter 5 times.
I have found on the web how can I read this audio data but I dont know any more where is this homepage ! :-)
Bye Pesti.
Hi People,
i have a question ,can I use this manchester code like in this example.
Trough PortA.0 is incoming encoded data from my transmitter and is then decoded and trough PortA.1 is going encoded data out.
Define LOADER_USED 1
Include "modedefs.bas" ' Mode definitions for Serout
ADCON1=7
define osc 4
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_SPBRG 207 ' 1200 Bauds
DEFINE HSER_CLOERR 1
n var byte
d var byte
myVar VAR byte
CounterA var Byte
ErrorFlag var Bit
MyData var Byte
encoded var Word
v var word
pause 10 ' safe start-up delay
Main:
serin porta.0,N1200,v
ErrorFlag=0
For CounterA=0 to 7
If v.1=0 then
MyData.7=0
If v.0=0 then ErrorFlag=1
else
MyData.7=1
If v.0=1 then ErrorFlag=1
endif
v=v>>2
If CounterA<7 then MyData=MyData>1
next
goto encodemanchester
encodeManchester:
For d=0 TO 7
IF mydata.0[d]=0 Then
encoded.0[d*2]=0
encoded.0[d*2+1]=1
Else
encoded.0[d*2]=1
encoded.0[d*2+1]=0
EndIF
serout porta.1,N1200,[encoded]
hserout [encoded]
Next
goto main
end
Please for help,thanks very much.
Pesti.
The serin command is used as folow:
Transmitter code: SerOut GPIO.1,N1200,["A","work"]
Receiver code: SerIn porta.3,N1200,["A"],B0,B1,B2,B3 received data will be: B0=w, B1=o, B2=r, B3=k
Note the N1200 is the baud rate, that is very important the N can be replaced with a T depending on the polarity of the data you receive, then the ["A"] the program will wait on the pin porta.3 until it receive an "A" then it will read the data that follow into the 4 variables B0-B3, you can use more variables if you want to.
But if your transmitter is using a decoder chip it is impossible to read the data you will always get garbage and not real data.
The data that you receive while the transmitter is off is only garbage or QRM caused by florescent light or other interference.
To sum up, you will need to know at what baud rate and polarity your transmitter is sending the data and you need to know what the [qualifier] is, it can be any character/s.
Last edited by ChrisMicro; - 29th November 2010 at 03:03.
You can't teach an old dog new tricks, but I'm always willing to try.
You can try the following:
Create some word long variables eg
B0 var WORD
B1 var WORD
B2 var WORD
B3 var WORD
SerIn porta.3, N1200,,, B0, B1, B2, B3
then compare the variables if it contain the same data then it will be the correct code because the encoder/decoder chips send out a 12 bit data that will fit into a word variable that can take up to 16 bits of data
You can't teach an old dog new tricks, but I'm always willing to try.
Bookmarks