Hi Iko,
Thanks for the reply...
this is my c code:
1) set of gpio
Gpio_SetPinFunction(gGpioPin31_c, gGpioAlternate1Mode_c);
Gpio_EnPinPuKeeper(gGpioPin31_c, FALSE);
2) ADC Setup
#include "ADC_Interface.h"
...
...
AdcConfig_t sAdc_Config;
AdcConvCtrl_t adcConvCtrl;
Adc_Init();
Adc_Reset();
(void)Adc_SetFifoCtrl(FIFO_DEEP);
Adc_DefaultConfig(sAdc_Config, 24000); // (1Mhz prescale clock, 300KHz ADC analog clock,
// 10 us on time, 40 us conversion time,
// auto working mode, compare interrupt disabled,
// FIFO interrupt disabled)
(void)Adc_SetConfig(&sAdc_Config);
Adc_TurnOn();
adcConvCtrl.adcTmrOn = TRUE;
adcConvCtrl.adcChannels = 0;
adcConvCtrl.adcChannels |= (1 << gAdcChan1_c);
adcConvCtrl.adcTmBtwSamples = gTimeBetweenSamples_c; // 1s between samples
adcConvCtrl.adcSeqMode = gAdcSeqOnTmrEv_c; //Timer mode
adcConvCtrl.adcRefVoltage = gAdcBatteryRefVoltage_c;
(void)Adc_SetConvCtrl(gAdcPrimary_c, &adcConvCtrl);
3) problem : I'm tring to sample 1.5V of battery (AA) on channel 1, but the sampled value that I read from FIFO is greater ,for example 2130 ....
Where is the problem on my code?
Have you some example about it?
Thank you in advance...