Hi,
I am new in this forum and it is one of the kindness Administrator from this http://ucontroller.9.forumer.com forum introduce me this forum. He say " Tell them that ku7485 had sent you ". I really need help from you all. Please help me if anyone know how to slove my problem...
I bought one RF Receiver.
My question is is it possible we direct connect the receiver output to uC(at89c52) rather than we use the decoder to decode the receiver signal?
As i know the Manchester Coding and Decoding for use with RF Modules...
Encoding: 8 bit byte becomes 16 bits to transmit... zero's become "01" and ones become "10".
Decoding: 16 bits get deconstructed back to 8 bit byte... "01" gets turned back into a zero and "10" gets turned back into a one.
Example... you are sending byte $00 which is equal to %00000000... this get's turned into %0101010101010101.
Here is the article:
http://www.ottawarobotics.org/articles/rf/rf.html
How can use uC to design it? Please guide me...
I have found out few question on this design..
1) How to model the decoder in C code? Please can you teach me how to write the C code for decoder? How the decoder pattern code work?
2) Is it i have to use the AT89C52 T2EX pin as externel interupt function, and i have to write a "Timer in Capture Mode" on my coding?
How can i capture the signal if i use T2EX? It either "01" gets turned back into a zero and "10" gets turned back into a one (i'm not sure my receiver is "01"=0,"10"=1 or "01"=1,"10"=0) but to generate an Interrupt the external input T2EX only recognize 1-to-0 transition.
Thank you.
RF receiver output connected to uC
I have written manchester decoder sw on a microcontroller. Its a bit tricky and requires a fair amount of care but if you take your time and build good debugging hooks into the code you should be fine.
First, determine your actual protocol. manchester defines the data encoding but you need to come up with a lead-in and lead-out sequence so you can decide when to apply the actual manchester decoder. I picked illegal code sequences. lead-in was high for 5 half-clocks followed by 1 low and then 1 high. Lead-out was low for 5. This caused the message to be balanced.
Then I used a timer interrupt that had a period of slightly longer than the half-clock. 4 highs in row says start looking for a 101.
Once I saw that, I started doing manchester decoding.
3 lows in a row terminated the message.
For decoding manchecter code, I basically built a state machine. I used a timer and the input pin generated interrupts on any edge. Each edge reset the timer. If the timer interrupt happened, there are two 0s or 1s in a row. If an edge interrupt happened, then it's a 10 or 01. You have to work through the possible cases do decide the state transitions.
good luck.
First, determine your actual protocol. manchester defines the data encoding but you need to come up with a lead-in and lead-out sequence so you can decide when to apply the actual manchester decoder. I picked illegal code sequences. lead-in was high for 5 half-clocks followed by 1 low and then 1 high. Lead-out was low for 5. This caused the message to be balanced.
Then I used a timer interrupt that had a period of slightly longer than the half-clock. 4 highs in row says start looking for a 101.
Once I saw that, I started doing manchester decoding.
3 lows in a row terminated the message.
For decoding manchecter code, I basically built a state machine. I used a timer and the input pin generated interrupts on any edge. Each edge reset the timer. If the timer interrupt happened, there are two 0s or 1s in a row. If an edge interrupt happened, then it's a 10 or 01. You have to work through the possible cases do decide the state transitions.
good luck.
RF Protocal and Code
Hi,
Thank for your reply. But i have alot of question and not very clear on your explanation.
Please guide me step by step?
Thank for you kindness.
Thank for your reply. But i have alot of question and not very clear on your explanation.
How to determine my actual protocol? Please can you tell me the way?First, determine your actual protocol.
I done the machester and the data encoding code already. But wat you mean lead-in and lead-out sequence? Please can you show me your parts of the code? So, i can study how it work. If i understand on that may be i will understand what's your following explanation.manchester defines the data encoding but you need to come up with a lead-in and lead-out sequence so you can decide when to apply the actual manchester decoder. I picked illegal code sequences.
Please guide me step by step?
Thank for you kindness.
Who is online
Users browsing this forum: No registered users and 63 guests