X10 RF Protocol Decode - How to???

  • 1
  • 2
  • Seite 1 von 2
nwrightson
Benutzer
Avatar
Geschlecht:
Herkunft: Newcastle
Alter: 64
Homepage: nweha.homeserver.c…
Beiträge: 362
Dabei seit: 08 / 2003
Betreff:

X10 RF Protocol Decode - How to???

 · 
Gepostet: 31.03.2012 - 06:15 Uhr  ·  #1
Hi All,
What do you think is the best method of performing a decode of the incoming serial data stream from a X10 (Home Automation product) RF (433MHz) Receiver?
Here is a link to the protocol X10 RF Protocol Basically a AGC header followed by a address byte, complement of the address byte, data byte followed by the compliment of the data byte.


I've never done a software based decode of a serial stream before, I've always used SPI/I2C/UART hardware.
I could do it -
1) All manually, looking at the level of the pin and doing a series of loops with udelays etc.
2) Using an Interrupt on the pin and a internal timer.

Given how noisy this area of the radio spectrum is, should I attempt to do multiple sampling within each bit?
Does any one have some code for this style of thing that they are willing to share? Save me reinventing the wheel again.


Thanks,
Neil.
nwrightson
Benutzer
Avatar
Geschlecht:
Herkunft: Newcastle
Alter: 64
Homepage: nweha.homeserver.c…
Beiträge: 362
Dabei seit: 08 / 2003
Betreff:

Re: X10 RF Protocol Decode - How to???

 · 
Gepostet: 04.04.2012 - 06:28 Uhr  ·  #2
Amazing!

Over 50 views and not one person has done a software decode of a serial stream or has any comments. :(

Neil.
Mr Crusty
 
Avatar
 
Betreff:

Re: X10 RF Protocol Decode - How to???

 · 
Gepostet: 04.04.2012 - 14:04 Uhr  ·  #3
Neil,

I think I would opt for a timer interrupt routine, as it does allow for other processing to carry on during interrupts, delays loops may suffer timing anomalies from other interrupt routines at a latter date.

It almost get a feeling that a hardware timer option might be a possible solution, or even a small FPGA

Like you most of my serial streams have used some form of UART in the past.

Hope others can give a better answer than I can.

Best
Merlin
Administrator
Avatar
Geschlecht:
Alter: 25
Beiträge: 1474
Dabei seit: 03 / 2005
Betreff:

Re: X10 RF Protocol Decode - How to???

 · 
Gepostet: 04.04.2012 - 17:48 Uhr  ·  #4
Never done it, but I would comment as follows, althouhgh you have probably thought of all of this;

You can't really send the signal to, e.g. an ADC pin and hope to get anything useful. The AVR is simply too slow. So you need hardware to convert the carrier to a solid signal, hence the AGC I guess. You have a similar issue with many FPGAs although they do often run faster. Once you have these 'solid' signals you have to decide whether a false positive or a false negative is more likely to occur in order to resolve conflicts. If you have multiple sends of the same data you can use majority polling. I personally would use an off the shelf decoder chip to do the first stage, because that is the hard bit, e.g www.wgldesigns.com/w800.html This chip gives a serial output stream which you are more familiar with.
miparo
Schreiberling
Avatar
Geschlecht:
Herkunft: Germany
Alter: 59
Beiträge: 988
Dabei seit: 09 / 2007
Betreff:

Re: X10 RF Protocol Decode - How to???

 · 
Gepostet: 04.04.2012 - 20:15 Uhr  ·  #5
Did you read http://load-8-1.blogspot.de/ ?
supports the X10 434MHz RF remotes and the X10 IR protocol with AtMega.
nwrightson
Benutzer
Avatar
Geschlecht:
Herkunft: Newcastle
Alter: 64
Homepage: nweha.homeserver.c…
Beiträge: 362
Dabei seit: 08 / 2003
Betreff:

Re: X10 RF Protocol Decode - How to???

 · 
Gepostet: 05.04.2012 - 01:15 Uhr  ·  #6
Hi Guys,
Thanks for responding.

Zitat geschrieben von Merlin

Never done it, but I would comment as follows, althouhgh you have probably thought of all of this;

You can't really send the signal to, e.g. an ADC pin and hope to get anything useful. The AVR is simply too slow. So you need hardware to convert the carrier to a solid signal, hence the AGC I guess. You have a similar issue with many FPGAs although they do often run faster. Once you have these 'solid' signals you have to decide whether a false positive or a false negative is more likely to occur in order to resolve conflicts. If you have multiple sends of the same data you can use majority polling. I personally would use an off the shelf decoder chip to do the first stage, because that is the hard bit, e.g www.wgldesigns.com/w800.html This chip gives a serial output stream which you are more familiar with.


The signal from the receiver is a Logic signal (TTL ?) so I don't need a ADC input. IT would appear that lot's of the transmitters do multiple sends, so I could use your majority polling. I already have a W800 but the PIC on it has died. Buying a new W800 is ~$150 including freight.
I have lot's of AVR's, a good compiler and help full friends, so why spend that amount of money on a inferior (PIC :) ) product. My PC software is looking for a W800 data stream and this is what I need to emulate. Ie convert the RF stream into four bytes, representing the 32 bits coming in. I don't need to do a decode of the bit's, more just a conversion between hardware mediums, ie from RF to RS232. But I do need to do some error checking though.

Zitat geschrieben von miparo

Did you read http://load-8-1.blogspot.de/ ?
supports the X10 434MHz RF remotes and the X10 IR protocol with AtMega.

I do have some Arduino hardware but have never used the compiler. I will have a look at the code though and see how they do it.

Thanks,
Neil.
Merlin
Administrator
Avatar
Geschlecht:
Alter: 25
Beiträge: 1474
Dabei seit: 03 / 2005
Betreff:

Re: X10 RF Protocol Decode - How to???

 · 
Gepostet: 05.04.2012 - 10:24 Uhr  ·  #7
Zitat

My PC software is looking for a W800 data stream and this is what I need to emulate. Ie convert the RF stream into four bytes, representing the 32 bits coming in. I don't need to do a decode of the bit's,

Your original reference has an algorithm for doing just this (it is in basic, so it is easy to convert although the constants are questionable). The subroutine InputCapture obviously just generates an array of signal width. So I guess your original post was asking the best way to design 'InputCapture'. I would go with Mr Crusty on this and sample on a timer interrupt. I would set systick to 0.1 and use OnSystick to store the value. I tend to use a 3 sample algorithm to avoid glitches. I'll post it to you if you are interested.
Avra
Schreiberling
Avatar
Geschlecht:
Herkunft: Belgrade, Serbia
Alter: 54
Homepage: rs.linkedin.com/in…
Beiträge: 653
Dabei seit: 07 / 2002
Betreff:

Re: X10 RF Protocol Decode - How to???

 · 
Gepostet: 05.04.2012 - 12:15 Uhr  ·  #8
  • 1
  • 2
  • Seite 1 von 2
Gewählte Zitate für Mehrfachzitierung:   0

Registrierte in diesem Topic

Aktuell kein registrierter in diesem Bereich

Die Statistik zeigt, wer in den letzten 5 Minuten online war. Erneuerung alle 90 Sekunden.
MySQL Queries: 8 · Cache Hits: 14   135   149 · Page-Gen-Time: 0.027333s · Speichernutzung: 2 MB · GZIP: ein · Viewport: SMXL-HiDPI