AnsweredAssumed Answered

K60 adc calibration problem

Question asked by Kwon YM on Feb 1, 2015
Latest reply on Feb 3, 2015 by Chris Brown

I use MK60 and 16Bit ADC of differential mode.

 

and I copy source code on it.

 

I always run "ADC_ExecCalib" function after reset.

 

sometimes, ADC offeset has been got so big diffenent value befor reset.

 

Do I must run this function every reset? or Can I use this function on only first run?

 

 

 

void InitADCDiffDMA(void)
{
DisableInterrupts;
//**** MCU periphery initialize **********************************************
SIM_Init(SIM_MODULE_CONFIG);
//FLL_Init(FLL_MODULE_CONFIG_FEE_96MHZ);

//test
//InitPITimer1();

//**** VREF config *********************************************************
VREF_Init (VREF_MODULE_TIGHTREG_CONFIG);

//**** PDB config **********************************************************
PDBCH0TRG0_Init (PDB_PRETRG_ON_DEALYED_CONFIG, 0x0010);
PDBCH1TRG0_Init (PDB_PRETRG_ON_DEALYED_CONFIG, 0x0010);
PDB_Init (PDB_MODULE_SWTRG_NO_IRQ_CONFIG( PDB_PRESCALER_1, PDB_MULT_1, 0x1000, 0xFFFF), 1, NULL);

//**** ADC config **********************************************************
//**** ADC calibrations **************************************************
ADC_ExecCalib (ADC0,ADC_MODULE_16B_IREF_HWTRG_CONFIG_U, &ram_adc0);       //DC OK, AC??
ADC_ExecCalib (ADC1,ADC_MODULE_16B_IREF_HWTRG_CONFIG_U, &ram_adc1);       //DC OK, AC??

//**** ADC0,ADC1 initialization ******************************************
ADC_Init  (ADC0, ADC_MODULE_16B_HWTRG_DMA_IREF_USER_CONFIG, ADC_CH_DI_POLL_CONFIG(DAD1), ADC_CH_DI_POLL_CONFIG(DAD1), 2, NULL);
ADC_Init  (ADC1, ADC_MODULE_16B_HWTRG_DMA_IREF_USER_CONFIG, ADC_CH_DI_POLL_CONFIG(DAD1), ADC_CH_DI_POLL_CONFIG(DAD1), 3, NULL);

//**** DMA channel 0 *****************************************************
DMACH0_CH1_Init();
DMACH1_CH1_Init();
//**** Enable all interrupts ***********************************************

EnableInterrupts;
//**** Start PDB ***********************************************************
PDB0_Trigger();
}

Outcomes