Author Topic: What's going on with the bit synchronizer and sync values?  (Read 358 times)

Tylerlee12

  • Newbie
  • *
  • Posts: 4
What's going on with the bit synchronizer and sync values?
« on: April 09, 2018, 10:36:35 PM »
Hi all!

Just starting up with an RFM69W.  In regards to the bit synchronizer, I noticed this library has this code:

https://github.com/nayem-cosmic/RFM69-Library-AVR/blob/f649ef8b25dfb531041cfa5dfca314cf0952b301/RFM9.c#L119
Code: [Select]
while (readReg(REG_SYNCVALUE1) != 0xaa)
{
writeReg(REG_SYNCVALUE1, 0xaa);
}

while (readReg(REG_SYNCVALUE1) != 0x55)
{
writeReg(REG_SYNCVALUE1, 0x55);
}

  • What's the point of writing REG_SYNCVALUE1 and then immediately overwriting it?  Is this something necessary to get the bit synchronizer up and running right or something?
  • It looks like you can add multiple sync words by also writing to REG_SYNCVALUE2, REG_SYNCVALUE3, etc.  What impact does using sync words have on the range of the RFM69Ws?
  • I'm assuming whatever sync words I choose will need to match on both by transmitter and receiver RFM69W modules?


emjay

  • Full Member
  • ***
  • Posts: 119
  • Country: nl
Re: What's going on with the bit synchronizer and sync values?
« Reply #1 on: April 10, 2018, 06:16:41 AM »
1. It is a sanity test that the SPI bus is actually talking to a live RF module - you can see that this code is very early in the init sequence - the test patterns (alternating one/zero) are of course not relevant to later when the module is fully initialised and active.

2. Synch pattern length is more about immunity to noise - the longer the length the less chance that random input bit streams will trigger a false packet decode

3. Yes