RFM69 - Disable NRZ?

Started by papadeltasierra, September 21, 2017, 06:14:57 AM

papadeltasierra

Just spotted that the RFM69 docs talk about NRZ but do not indicate whether this can be disabled?  Do they actually mean the Manchester encoding/whitening settings and can I actual disable this?

Background is that I want to use this module to listen to something that RTL-SDR shows is not using any similar encodings so I just want a 'raw' binary output.

Felix

Two things:

1) Are you using the RFM69 library?
2) Can you please define NRZ for the folks who never heard the abbreviation?

papadeltasierra

RFM69 library - I will be  ;).
NRZ is https://en.wikipedia.org/wiki/Non-return-to-zero.  My understanding is that this is sometimes described as '1 is represented by +voltage, 0 is represented by -voltage' and this avoids signal drive in systems connected by physical cables but also described as a way to avoid long runs of zeros and ones by combined with bit-stuffing.  But given I'm expecting to be using the 2-FSK mode, and we're talking about wireless comms here, I'm not sure how this would relate to NRZ where a '1' might be a '+offset' frequency and a 0 a '-offset' frequency.  That's sort of where I am with this - somewhat confused as to how this chip uses NRZ given that the expression just magically appears in the RFM69 specs with little explanation of how or why.

emjay

The power on reset defaults set the data encoding as NRZ - basically on transmit, ones and zeros are mapped to opposite frequency deviations of the constant carrier.  i.e. actual bit rate = data rate (the baud setting)
This can be problematic for long unchanging runs of ones or zeros - the receiver bit slicer drifts out of synch and makes a hash of decoding.
One solution is to switch on Manchester encoding which ensures lots of transitions but at the cost of halving the effective data rate i.e. actual useful bit rate = half the baud setting.
A less 'expensive' solution is to turn on data whitening which also introduces lots of transitions to keep the bit slicer happy. This scrambles  with a known pattern that can be unwound at the other end.

Felix

NRZ is better known as DC-Free mechanisms, covered in chapter 5.5.8. of the DS.
@emjay is correct about using data whitening or manchester encoding. Please see the datasheet link above for more details and how to set registers to achieve this.

papadeltasierra

Thanks to both for the info.  I'd just about got there but it's good to know I wasn't heading in the wrong direction.  FYI I'm trying to catch and decode the output from a water meter that probably follows Open Meter Standards so could be Manchester or 3-of-6 encoded.  However the unusual implementation (water meter talks to repeater station talks 'Flexnet' over a cell-like network) means it might not be.  So first step is for me to try and capture 'raw' (i.e. not Manchester or other decoded) data before perhaps enabling Manchester decoding.
So I believe that I've written a sketch to disable must of the RFM69's cleverness, grab the first X bytes and dump them as hex and as soon as my Moteino board arrives, I'll give it a try.  And if that works, there are some local car park signs on 433MHz that interest me too  :).