Other Parts Discussed in Thread: CC2650,
Tool/software: TI-RTOS
Hello E2E fellows,
i'm currently working on a custom board that has CC2640F128. Our board has a battery monitor pin (DIO_11), as the following schematic,
According to my schematic, if I want my max battery vol = 3.7 and my min battery vol = 3, then my BATT_MON should range from 1.08 to 1.33.
I'm trying to use the ADC in the adcsinglechanel project but I don't understand how I should configure my ADCCC26XX_HWAttrs,
const ADCCC26XX_HWAttrs adcCC26xxHWAttrs[CC2650_LAUNCHXL_ADCCOUNT] = {
{
.adcDIO = PIN_UNASSIGNED,
.adcCompBInput = ADC_COMPB_IN_DCOUPL,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL
},
{
.adcDIO = IOID_19,
.adcCompBInput = ADC_COMPB_IN_VSS,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL
},
{
.adcDIO = IOID_19,
.adcCompBInput = ADC_COMPB_IN_VDDS,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL
}
};
#define Board_ADC0 CC2650_LAUNCHXL_ADCVSS #define Board_ADC1 CC2650_LAUNCHXL_ADCVDDS
If I want to digitize voltage on my BATT_MON pin (pin IOID_19), how should I modify the above code? Board_ADC0 currently gives me a value of 3 and Board_ADC1 give me a value of 2771, which is not a valid number that I want.
Many thanks,
Henry


