Try baud rate 1200 instead of 2400. Most of these modules are good at this frequency.
Try baud rate 1200 instead of 2400. Most of these modules are good at this frequency.
Two things:
First, the junk data transmitted has to be a certain type of junk. The receiver has to be put into a “middle” state in order to work. Think of a capacitor that is charged to its maximum of 25 volts. Adding a 25 volt signal to it will not have a change on its state. The same goes for one that is zero charged, 0 volts will not change its state. In order for either 0 or 25 volts to have the same effect the capacitor has to have an initial charge of 12.5 volts.
To put the receiver in a “middle” state send $55 five times. Then send the synch then your data all on one line.
Code:'transmitted junk = $55 synch = a SEROUT PIN,N2400,[junk,junk,junk,junk,junk,synch, data]Notice I used the SERIN/SEROUT , not SERIN2/SEROUT2.Code:'received SERIN PIN, N2400,[“a”],data
Dave
Always wear safety glasses while programming.
These modules require all data to be encoded using the Manchester code. Search this forum for it and you will find lots of examples.
sorry for the late reply, i have not had time to work on this till now.
so it tried what you said and sent %10101010 to stabalize the oscillators, (put it in the neutral zone). and now i am able to get something on the other end of the pic. however i can't seem to get it continously. in my sample program i am counting numbers continously in my transmitter side and sending it to my reciever to display it. it sends numbers but it does not send it continously.
i.e i send 1,2,3,4,5,6,7,8,9,10 and will recieve 1, 4, 6,9
how do i make my program more stable.
'=====transmitter=====
junk = $55
synch = "a"
dat = 0
loopa:
pause 1000
serout tx, N2400, [junk, junk, junk, junk, junk, synch, dat]
dat = dat + 1
if dat = 255 then dat = 0
goto loopa
'=====reciever======
synch = "a"
dat = 0
begin:
serin rx, 4, [synch], dat
pause 5:serout2 LCD, baud, ["start", 1, DEC (dat), 0]
goto begin
For small amounts of data I prefer using the NEC protocol which has been around since the dawn of remote control and has been widely used by manufacturers of audio/visual gear.
I posted a short example for sending/receiving in the Code Examples forum.
http://www.picbasic.co.uk/forum/showthread.php?t=6261
Bookmarks