Skip to main content
EDuat.1
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);
}

This topic has been closed for replies.
Best answer by EDuat.1

Ok it solved.That is my fault. Tied a voltage divider resistor the pin.Because of the pin is float.

2 replies

EDuat.1
EDuat.1Author
Associate II
December 17, 2020

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.

EDuat.1
EDuat.1AuthorBest answer
Associate II
December 18, 2020

Ok it solved.That is my fault. Tied a voltage divider resistor the pin.Because of the pin is float.