Hi,
I’m trying to evaluate the ADC of the RSL10 using the DIO (0…4). below a sample of the code to configure the ADC (the same one as the one used in the ADC_UART but with DIO1).
/* Set the ADC configuration */
Sys_ADC_Set_Config(ADC_CONTINUOUS|ADC_PRESCALE_6400);
/* Enable the ADC and BATMON alarm interrupts assigning channel
* number 6 to trigger the ADC interrupt. */
Sys_ADC_Set_BATMONIntConfig(INT_EBL_ADC |ADC_INT_CH6 |INT_EBL_BATMON_ALARM);
/* Configure ADC_CHANNEL input selection to DIO */
Sys_ADC_InputSelectConfig(ADC_CHANNEL, ADC_POS_INPUT_DIO1|ADC_NEG_INPUT_GND);
/* Configure both input selection for an ADC channel to GND so the OFFSET is
* subtracted automatically to result. */
Sys_ADC_InputSelectConfig(ADC_GND_CHANNEL, ADC_POS_INPUT_GND |
ADC_NEG_INPUT_GND);
/* Enable interrupts */
NVIC_EnableIRQ(ADC_BATMON_IRQn);
I have some question and remarks:
-
I can get my converted value in the interruption respecting the Sampling rate configured of the ADC
-
DIO1 used in my example should be configured as an input before configuring the ADC?
Because when is not done, I have 2V converted by ADC when my source is not connected to this PIN -
I tried to disable the ADC interrupt and getting my converted data in the main loop by checking the status using : Sys_ADC_Get_BATMONStatus(). This status is always 0, that mean no New sample ready.
do you have any idea about the 2. and 3. points ?
Best regards,