cancel
Showing results for 
Search instead for 
Did you mean: 

BUG looks like. ADC 3 channel oversampling in the same period and hard fault

EDuat.1
Associate III

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);
}

1 ACCEPTED SOLUTION

Accepted Solutions
EDuat.1
Associate III

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

View solution in original post

2 REPLIES 2
EDuat.1
Associate III

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
Associate III

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