2020-04-29 02:06 PM
I'm attempting to program this chip to act as a thermometer that can run on a low power solar panel. The issue I'm having is the power draw is way too high. Halted i have the power draw with an LCD and RTC interrupt ready at 5.5uA, but when I'm using the ADC the draw is over 1600uA. How can i get this draw lower?
initialization
void ADC_Icc_Init(void)
{
CLK_PeripheralClockConfig(CLK_Peripheral_ADC1, ENABLE); //Enable ADC clock
ADC_DeInit(ADC1); //de-initialize ADC
ADC_Init(ADC1, ADC_ConversionMode_Single,ADC_Resolution_12Bit, ADC_Prescaler_1);
ADC_SamplingTimeConfig(ADC1, ADC_Group_FastChannels, ADC_SamplingTime_4Cycles);
ADC_SchmittTriggerConfig(ADC1, ADC_Channel_24, DISABLE); // disable SchmittTrigger for ADC_Channel_4, to save power
ADC_DMACmd(ADC1, DISABLE);
ADC_TempSensorCmd(DISABLE);
ADC_VrefintCmd(DISABLE);
ADC_ChannelCmd(ADC1, ADC_Channel_24, ENABLE);
}
segment of main code:
GPIO_HIGH(Power_Port, Power_Pin); //turns on probe
ADC_Cmd(ADC1, ENABLE); //turns on adc
for(i=cycles; i>0; i--)
{
//Gathers Samples
ADC_SoftwareStartConv(ADC1);
// Gathers Samples
while( ADC_GetFlagStatus(ADC1, ADC_FLAG_EOC) == 0 );
// Starts/adds to running summation of analog signal
res = res + ADC_GetConversionValue(ADC1);
}
ADC_Cmd(ADC1, DISABLE); //turns off adc
GPIO_LOW(Power_Port, Power_Pin); //turns off probe
// Averages Analog signal running sum //
res = res / cycles;