Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

rf module usart and pic

Status
Not open for further replies.

jaycec

Member level 2
Joined
Jul 22, 2010
Messages
51
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
india
Activity points
1,611
Hi forum
I have a general doubt about asynchronus usart reception,I have connected an rf receiver to rx line of receiver.so there will be some noise input at rx line,will microcontroller receive this as serial data ?If yes then another question.Assume receiver register of pic is half loaded by noise input then comes data i send then is there a possibility that the receiver register may contain half noise input bits and remaining half bits i send.Please answer me even it looks like a foolish question.
 

Have a look at this project, it will give you good idea as to what needs to be done: WinAVR AVR-GCC Tutorial

About your other query, you have to send reasonably long preamble for RX module to stabilize before sending the real data packet. This is avoid data corruption due to noise.

And to ensure you you have received the correct data some kind of error detection mechanism has to be implemented like odd/even parity.

Hope this helps
 
  • Like
Reactions: jaycec

    jaycec

    Points: 2
    Helpful Answer Positive Rating
About your other query, you have to send reasonably long preamble for RX module to stabilize before sending the real data packet. This is avoid data corruption due to noise.
It's basically a good idea, but doesn't guarantee correct receiption as long as a standard UART is used at the receiver. Assume that the receiver UART has been triggered by noise one or two bits before the preamble starts. At worst case it will continouosly receive wrong data and never synchronize on the incoming packet. By chance, it will pick up a correct start bit after a frame error.

The only reliable method in this situation is bitwise synchronisation. It can't be achieved with hardware UARTs but is easily done in software at the usual low baud rates of 4k8 or 9k6 maximum. As another point, you should check, if the RF modules are able to transmit standard UART data, that have a bit duty cycle range of 10 to 90% (data 0x00 respectively 0xff) They are often designed to work with HT-12 type RC encoded signals (D.C. between 33 and 66%). Manchester encoding is a common method to achieve near 50% DC for the bit stream.
 
  • Like
Reactions: jaycec

    jaycec

    Points: 2
    Helpful Answer Positive Rating
thanks for your answer,where can i find details about software usart using mikroc?
 

Unfortunately, I'm not fanmiliar with mikroc. But the basic software UART operation is to poll the input pin or possibly use a port B change interrupt and have a timing reference, either by a software delay or a hardware timer. After a start bit edge, wait 1/2 bit duration and then sample the data a the defined bitrate. Hardware UARTs usually oversample the input pin at 16 x bitrate.

The bitwise synchronization performs a pattern match. If a mismatch is detected, it's restarted on the next bit. A standard preamble, a continuous 1010 sequence, doesn't determine the frame boundary. Instead, it uses a sync character after the preamble. It's detection starts the packet receiption.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top