nasys / badgerboard

5 stars 3 forks source link

Document what badger_read_vcc_mv is measuring and how the RN2483 Vdd is connected #7

Open avbentem opened 7 years ago

avbentem commented 7 years ago

I assume the badger_read_vcc_mv function is measuring the LiPo connector (which I cannot test right now). When using the USB port, or when connecting a battery pack to Vin and GND, I always get 3339 millivolts for the Badgerboard function, and always 3283 millivolts for the response of the RN2483 sys get vdd command. (Another Badgerboard always reports 3410 for the Badgerboard function and 3325 for Vdd.)

The sys get vdd command is documented by Microchip as:

2.3.6.3 sys get vdd

Response: 0-3600 (decimal value from 0 to 3600)

This command informs the RN2483 module to do an ADC conversion on the VDD. The measurement is converted and returned as a voltage (mV).

Badgerboard's technical specifications do not indicate how it's connected.

Please document what badger_read_vcc_mv is measuring, and how the RN2483's Vdd is connected.

KertIlm commented 7 years ago

HI,

Function badger_read_vcc_mv() does not measure LiPo voltage... this function measures MCU supply voltage (after LDO) so this can't be over 3.3 but it starts falling if battery is emptying until 2.7V which is marked as MCU minimum operating voltage. This function can be used to alert for low battery.