Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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
 
amindzo said:
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'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!.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top