thotro / arduino-dw1000

A library that offers functionality to use Decawave's DW1000 chips/modules with Arduino.
Apache License 2.0
527 stars 288 forks source link

getTempAndVbat and ADC readings #167

Closed cimbalo closed 7 years ago

cimbalo commented 7 years ago

DW1000 ADC doesn't work unless ADCCE bit and undocumented bit 9 of PMSC_CTRL0 are set to 1. As result getTempAndVbat always return a fixed value based on factory calibration values.

I can provide a pull request to fix the issue. What do you think of a function enableADCClock to set those two bits? There are better implementation options?

thotro commented 7 years ago

Hi there! Thanks for the pointer!

I'm not sure if it wouldn't be better to just force this state anyway on initialization; so no further functions would be necessary to be explicitly called. Or do come any drawbacks/post-enable-consequences with it?

Your choice of implementation! :-) A PR is more than welcome!

Cheers!

cimbalo commented 7 years ago

I trace down the problem to the lde load code. PR fix my issue by not overwrite the register state on initialization.

thotro commented 7 years ago

Great, many thanks!