Month: July 2015
A little bit of progress. One TS06 sent a packet and the other noticed it. The recieved packet was flagged as having all sorts of errors, which is appropriate because it seems of be full of junk.
Recieved something with status SYS_STATUS_IRQS SYS_STATUS_RXSFDD SYS_STATUS_LDEDONE SYS_STATUS_RXPHD SYS_STATUS_RXPHE SYS_STATUS_RXFCG SYS_STATUS_RXRFSL
But the good news is that something got transmitted.
And a DW packet?
The next example shows output from packets sent by the DW EVK1000 which seems to have much better status.
Recieved something with status SYS_STATUS_IRQS SYS_STATUS_RXSFDD SYS_STATUS_LDEDONE SYS_STATUS_RXPHD SYS_STATUS_RXPHE SYS_STATUS_RXSFDTO SYS_STATUS_HSRBP
I had a few minutes of uninterrupted time to begin to scrutinize the DW code. The code base is pretty big. The actual demo “application” code, (not even the libraries) are extensive. See ->
I printed out just the demo part of the code so that I could start to understand how they set up the radios for TOF calculations. Now it got depressing.
The following code translates TOF to a distance. It appears that the hardware can produce TOF results that are negative! OK, I can see how that can happen, but simply turning it into a positive number seems like a odd solution. I wonder why that is the right thing to do?
So each report is actually the average of 32 TOF estimates. That can’t be good for our power budget!
This is my first program that actually needed to know the speed of light.
Glorious fudge factors (pulled out of rectal orifice) require floating point. N.B. No FP hardware on the Nordic.
//assume PHR length is 172308us for 110k and 21539us for 850k/6.81M
if(instance_data[instance].configData.dataRate == DWT_BR_110K)
{
msgdatalen *= 8205.13f;
msgdatalen += 172308;
}
else if(instance_data[instance].configData.dataRate == DWT_BR_850K)
{
msgdatalen *= 1025.64f;
msgdatalen += 21539;
}
else
{
msgdatalen *= 128.21f;
msgdatalen += 21539;
}
Antenna delay
So we have to figure out the antenna delay.