Serial communication problems

Status
Not open for further replies.

amindzo

Member
Hi,
i send sensor data from transmitter to reciever via RF modules serialy.
i use PIC16F877A.i send data every 5 minutes.for the first time i have no problem but in next five minutes i recieved wrong data(for example 140% humidity).if i reset transmitter micro it sends data correctly
i asked myself maby the problem is RF modules but they are not.
becouse i send 12 byte to reciver and befor each byte i send a character so the reciver micro take the character and then put each byte in it's appropriate variable so if reciver don't get the character correctly it can't show the data on lcd.
so what's the problem?
i use micro code studio picbasic pro2.41
this is a small part of my program:
transmitter program:
send:
give data from sensor
serout PORTC.7,N1200,["A"]
serput PORTC.7,N1200,[humid1]
serout PORTC.7,N1200,["C"]
serout PORTC.7,N1200,[humid2]
........................
........................
sleep 300
goto send
end

reciever program:
recieve:
serin PORTC.7,N1200,["A"],humid1
serin PORTC.7,N1200,["C"],humid2
...............
..............
lcdout $fe,1,#humid1
pause 4000
lcdout $fe,1,#humid2
pause 4000
goto recive
end
 

I've already told you, you can't send standard serial data via a radio link, you need some type of NRZ coding (like Manchester coding). As I also previously told you, my PIC RF tutorial explains why!.
 
amindzo said:
Hi,
i use hamiong codes for sending and recieving data.

But you are using standard RS232 serial to send them - this requires a DC coupled signal path, your radio link is AC coupled and requires an NRZ system.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…