What are these configurations for in LPS firmware?

Discussions about all things Bitcraze
Post Reply
doctorlu
Beginner
Posts: 23
Joined: Mon Dec 28, 2015 8:41 am

What are these configurations for in LPS firmware?

Post by doctorlu »

Dear all,
I have a question in terms of the LPS configuration. I see the current code has configured this mode, in UWB.c
dwNewConfiguration(dwm);
dwSetDefaults(dwm);
dwEnableMode(dwm, MODE_SHORTDATA_FAST_ACCURACY);
dwSetChannel(dwm, CHANNEL_2);
dwSetPreambleCode(dwm, PREAMBLE_CODE_64MHZ_9);

I just got confused that the "dwEnableMode" has already set the channel and preamblecode in it. Why use "dwSetChannel" and "dwSetPreambleCode" again?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: What are these configurations for in LPS firmware?

Post by arnaud »

Hi,
The dwEnableMode function sets channel 5 and a preamble by default. In this code we set channel 2 and a preamble ID authorized for channel 2.
doctorlu
Beginner
Posts: 23
Joined: Mon Dec 28, 2015 8:41 am

Re: What are these configurations for in LPS firmware?

Post by doctorlu »

Thanks. I get it. So my question is why you change the channel from 5 to 2?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: What are these configurations for in LPS firmware?

Post by arnaud »

No good reason for using channel 2 really, we have always done that even before porting the arduino driver to C (what we now call libdw1000) and we stick with it. Intuitively channel 2 is on lower frequency than channel 5 so it should have better range however we have never tested this assumption.
Post Reply