understanding serial data  - Page 1
Forum section: electronics / projects

author: ctesla75
author_rank: Contributor
timestamp: August 16, 2015, 02:18:03 am
content: Hi All,I am trying to repurpose a rf transmitter receiver pair, the transmitter have four buttons but only two outputs are uitilized. I would like to use all four on a new project. i know absolutely nothing about serial data, and dont know which direction to go i dont know what to google, it has come up with things like protocols and ask fsk, i dont know which one to follow how do i know what protocol to use .is there a good book or website to look at.the problems i am seeing now are1. Am i capturing the data properly- i am using rigol ds1052e ,first i hold down button on transmitter then press run/stop on rigol and save data to usb. however all data captures from all buttons look the same to me.2. how do i convert data to a hex number so micro can wait for it.3. do i need to figure out baud rates ect.the receiver is a kw-rf211a and the micro is a micrf211ayosi have read the data sheet but will have to read it a few more time before i grasp it ,it says it is ook and ask ,google searches of this device have said it is pwm so im not surethanksctesla75

author: JimRemington
author_rank: Regular Contributor
timestamp: August 16, 2015, 03:18:46 am
content: Those captures are not the same and without doing any analysis it looks like a very simple PWM protocol, with the first 6 bits being 100001...Take a look inside the modules. If there is a chip labeled PT2262 or PT2272, then that is a standard and well understood protocol. Seehttps://dzrmo.wordpress.com/2012/07/08/remote-control-pt2272-for-android/

author: kc8apf
author_rank: Regular Contributor
timestamp: August 16, 2015, 05:09:32 am
content: 1) Holding the key may or may not cause the transmitter to repeat the code. Pressing run/stop when you are already holding the key down will capture something in the middle of pattern. Change the trigger to single-shot mode on a positive-going edge (your captures show the data line idles low). Press start/run first so the scope is waiting for the trigger, then press the key once. You should end up with a capture that starts at the beginning of the transmitted pattern.2) The MICRF211AYQS is a RF receiver, not a micro. The datasheet (http://www.micrel.com/_PDF/micrf211.pdf) shows that it has a single output pin (DOUT) that will match whatever level is on the transmitter input pin. You'll need to look at the chip connected to the receiver's DOUT pin to see what the protocol is. From the captures, I agree with Jim that is looks like a simple PWM protocol where the length of the high signal level indicates if it is a 0 or a 1. The PT2262/2272 that Jim mentioned seem like a reasonable guess as to what is going on. Specifically, look at Figure 7A on the link Jim provided. That's not how typical serial buses like RS232, SPI, or I2C work. If you want to feed the data directly from the receiver's DOUT pin to a micro, you'll need to measure the duration of each high pulse and convert it to a bit. For most micros, you can use the timer in a capture mode to do that. If the protocol is already being handled by a discrete chip like the PT2262/2272, it's a lot easier to just use the output of _that_ instead.

author: ctesla75
author_rank: Contributor
timestamp: August 16, 2015, 02:34:03 pm
content: hi thanks for the replies,I have tried recapturing the data , i didnt even know i could capture using one shot, however i ran into a problem there is a constant stream of data when no buttons are pressed, so i still had to keep the button pressed and press run/start , multiple presses seems to stop at different points,it seems to repeat the signal but then again if it was i would expect the relay to turn on and off again but the button needs to be released and pressed again. there is no other chip on the board only a crystal and resistors capacitors ect, the d0 output goes to a atmel micro on the main pcb not on the modulethanks ctesla75

author: nali
author_rank: Frequent Contributor
timestamp: August 16, 2015, 02:59:02 pm
content: At a glance it looks like Manchester encoded data to me?

author: JimRemington
author_rank: Regular Contributor
timestamp: August 16, 2015, 03:45:37 pm
content: QuoteThat is just receiver noise. To decode the data, you need to measure the pulse widths and filter for valid on/off times.Many people use Audacity to visualize and decode low bit-rate data streams, like this:http://rayshobby.net/interface-with-remote-power-sockets-final-version/