8 years ago.

ADC initialization problem.

Hi, I'm trying to use the "AnalogIn_Diff" custom driver for the FRDM-K64F and to customize it adding the following code:

ADC_HAL_SetHwAverageCmd(adc_addrs[instance], true);
ADC_HAL_SetLongSampleCmd(adc_addrs[instance], true);
ADC_HAL_SetAutoCalibrationCmd(adc_addrs[instance], true); 
ADC_HAL_SetHwAverageMode(adc_addrs[instance], kAdcHwAverageCountOf8);
ADC_HAL_SetLongSampleCycleMode(adc_addrs[instance], kAdcLongSampleCycleOf10);

but it not works (the board makes the RGB led blinking in red). Why? Thanks to all.

Red blinking LED is the mbed error function being called. That happens for example if you try to make an AnalogIn on an unsupported pin. The code you show here should not cause it.

posted by Erik - 10 May 2015
Be the first to answer this question.