Associate II
December 17, 2020
Solved
BUG looks like. ADC 3 channel oversampling in the same period and hard fault
- December 17, 2020
- 2 replies
- 1011 views
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);
}