2020-12-17 04:30 AM
Hi I am trying to get ADC injected data in 3 channel at the same period.
Oversampling ratio = 8x
three bit shift
every channel 12.5 cyle
ADC resolution 12 bit
And one regular channel activate in 3 second period VrefInt
170 Mhz ADC clock
Fadc_ker_ck = 170 Mhz
TCONV = (12.5 + 12.5) = 25 cycle -> (1/170Mhz) * 25 = 147 ns per channel
8 sampling per channel -> 147ns * 8 = 1.18 us
For 3 channel -> 1.18us * 3 = 3.53 us
This executes in 10 Khz -> 100 us
So what can be the problem.ioc file attached.
void callback_ADC_injected(void)
{
ADC_injected_raw[0] = LL_ADC_INJ_ReadConversionData12(ADC1,
LL_ADC_INJ_RANK_1); // U Phase
ADC_injected_raw[1] = LL_ADC_INJ_ReadConversionData12(ADC1,
LL_ADC_INJ_RANK_2); // V Phase
ADC_injected_raw[2] = LL_ADC_INJ_ReadConversionData12(ADC1,
LL_ADC_INJ_RANK_3); // V_Bus
}
void callback_ADC_regular(void)
{
ADC_regular_raw[0] = LL_ADC_REG_ReadConversionData12(ADC1);
}
Solved! Go to Solution.
2020-12-18 01:08 AM
Ok it solved.That is my fault. Tied a voltage divider resistor the pin.Because of the pin is float.
2020-12-17 06:20 AM
I checked it again and problem with rank 3.it seems it doesnt work properly .I am not sure.
I checked them one by one and rank 1 and rank 2 together .Just after the reading rank 3 ,system going on Hard Fault.
2020-12-18 01:08 AM
Ok it solved.That is my fault. Tied a voltage divider resistor the pin.Because of the pin is float.