We get issues when reading out the temperature and voltage using the dwt_readtempvbat.
We use it with the fastSPI enabled, the deca_sleep(1) inside works as expected.
After transmitting we consistently read out the correct values.
After receiving a frame, we sometimes read out incorrect values.
After waking up the DW1000 and then using the dwt_readtempvbat we also sometimes read incorrect values.
In our data it seems the leftmost bit to be wrong.
0x8d which gives the assumed correct value of 47.5 degrees C
0x0d which gives the wrong value of -97.2 degrees C
0xa8 which gives the assumed correct value of 3.26V
0x28 which gives the wrong value of 2.53V
The faulty temperature and faulty voltage don’t happen consistently together.
We get the following readings:
- both values are correct
- only the temperature is incorrect
- only the voltage is incorrect
- both the temperature and voltage is incorrect
As you are using fast SPI, you should call the following dwt_readtempvbat(1). Can you confirm that’s what you do ? I guess yes as you mention the sleep, but just double checking.
Have you checked if you have the same issue with slowspi ?
For example swap the call for :
port_set_dw1000_slowrate(); temp_vbat = dwt_readtempvbat(0); port_set_dw1000_fastrate();
We are indeed using dwt_readtempvbat(1).
We experience the same issue with the suggested slowspi code.
With fastspi, increasing the internal sleep in dwt_readtempvbat to 5ms, this also does not resolve the issue.
Further testing shows adding a 4 millisecond delay after a frame has been received and then reading out the temperature/voltage, the issue does not happen anymore. at 1-3ms the issue still happens. (again using the fastspi)
are you using the DWM1001-DEV kit or a custom pcb?
If it is a custom pcb it can be an electrical problem.
Verify that you have decoupling capacitors and a low-curl regulator. ADC readings are very sensitive to the quality of the power supply.
We don’t see any problems with the current supply.
On what voltage does the internal measurement circuit run, 1.8V or 3.3V?
Also in the dw1000_user_manual_2.18 it states the ADCCE bit in PMSC_CTRL0 should be on if we want to initiate a measurement ourselves.
Under 6.4 The register accesses to perform the reading of the temperature and voltage sensor does not do this.
In the dw1000_api_rev2p14_stsw under the examples (ex_09a/ex_09b) this bit is also not explicitly enabled.
Is this necessary ? Manually enabling this bit does not resolve the issue.
Visualizing the temperature and spraying the DW1000 with cold spray for electronics.
We see the DW1000 giving faulty measurements when the temperature gets too high.
This is a visualization of the raw voltage measurement uint8 we get from dwt_readtempvbat.
Converted we see this happens at 23.73°C.
Below the temperature threshold we do not see faulty measurements.
We haven’t seen similar behavior, I was recently testing several dwm1004 (dw1000 design) over -40C to 80C and did not get any issue with incorrect reading from the adcs.
We are using slow spi, if you use fast spi you may need to add some additional delay or the first measurement may be incorrect. But appart from that, there is no indication it shouldn’t work in such a consistent way.
Do you observe the same behavior on several devices ?
Just an udpate : the R&D have observed unstabilities with the most significant bit when using fast spi, their recommendation would be not to read temp/voltage with a spi above 3Mhz.
This recommendation is actually in the DW1000 driver api guide :
With the slow spi, I would really not expect you to see any error.
Hope it helps,