Part Number: CC1352R
Other Parts Discussed in Thread: SYSBIOS
Tool/software:
Dear Experts,
i am trying to get the CC1352R custom board Battery voltage, please check the following code, i am getting 893mV,
#include <stdint.h>
#include <stdbool.h>
#include <ti/devices/cc13x2_cc26x2/driverlib/aon_batmon.h>
//#include <ti/devices/cc13x2_cc26x2/driverlib/driverlib.h>
#include <ti/drivers/Board.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>
int main(void) {
// Initialize board (clocks, power, etc.)
Board_init();
// Enable the battery monitor
AONBatMonEnable();
// Wait until the battery monitor has a valid measurement
while (!AONBatMonNewBatteryMeasureReady()) {
// Small delay or wait loop
}
while (1) {
// Check if a new battery voltage measurement is ready
if (AONBatMonNewBatteryMeasureReady()) {
// Read raw battery voltage (in units of 1/1024 V)
uint32_t rawVoltage = AONBatMonBatteryVoltageGet();
// Convert to millivolts
uint32_t voltage_mV = (rawVoltage * 1000) / 1024;
// Print to system output (Console)
System_printf("Battery Voltage: %d mV\n", voltage_mV);
System_flush();
}
// Sleep for a while (update ~1s, no need to poll faster)
Sleep(1);
}
return 0;
}
please assist me to solve this.
regards
Surya.