2019-02-17 04:33 AM
I'm using this device. with "BlueNRG-1_2 DK 3.1.0"
I have a problem with reading ADC.
use two channels pin1, pin2 (ADC1, ADC2), connected to two potentiometers (analog joystick)
I can read only one channel, how can I read the two channels?
In this code the value of adc is not correct, why?
//------------Configure ADC
SysCtrl_PeripheralClockCmd(CLOCK_PERIPH_ADC, ENABLE);
xADC_InitType.ADC_OSR = ADC_OSR_200;
xADC_InitType.ADC_Input = ADC_Input_AdcPin2 | ADC_Input_AdcPin1;
xADC_InitType.ADC_ConversionMode = ADC_ConversionMode_Single;
xADC_InitType.ADC_ReferenceVoltage = ADC_ReferenceVoltage_0V0; xADC_InitType.ADC_Attenuation = ADC_Attenuation_6dB02;
ADC_Init(&xADC_InitType);
ADC_SelectInput(ADC_Input_AdcPin2);
ADC_Cmd(ENABLE);
//------------------READ
if(ADC_GetFlagStatus(ADC_FLAG_EOC)) {
if(channelselect==0){
channelselect=1;
raw_value2 = (int16_t)ADC_GetRawData();
ADC_SelectInput(ADC_Input_AdcPin1);
}else{
channelselect=0;
raw_value1 = (int16_t)ADC_GetRawData();
ADC_SelectInput(ADC_Input_AdcPin2);
}
ADC_Cmd(ENABLE);
}
2020-04-13 12:44 PM
I have the same issue. Did you found something ?
Could someone help please ?
2020-07-06 04:54 AM
Hello !
I have exactly the same problem !
Did you find a solution please?
2020-07-06 04:56 AM
Hello,
The issue was that my system clock was configured to 32Mhz and the ADC is not working fine at 32Mhz (see errata sheet).
You should reconfigure the system clock to 16Mhz.
2020-07-06 05:02 AM
2020-07-16 01:40 AM
Hello Stabilo,
My ADC is working properly, but BLE disconects every 15 secondes.
The BLE disconnects every 15 seconds. I lower the frequency during my ADC routine and increase it just after. This causes a malfunction on my bluetooth communication. Do you have any advice?
bests regards,