cancel
Showing results for 
Search instead for 
Did you mean: 

Trriger ADC injected

udibit
Associate II
Posted on April 21, 2015 at 12:32

Hi,

I would like to trigger ADC1 by TIM2 update. I checked and injected group workd fine by software triggering, i have checked in debug the sampled value. TIM2 cnt register also runs, so i probably enabled it correctly. But when trying to trigger ADC injected group by TIM update, ADC does not preform any sampling on injected group. Here is what i have added for the TIM2 for triggering:

/* Timer TRGO selection */
master_timer_config.MasterOutputTrigger = TIM_TRGO_UPDATE;
master_timer_config.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
if (HAL_TIMEx_MasterConfigSynchronization(&TimHandle, &master_timer_config) != HAL_OK)
{
/* Timer TRGO selection Error */
Error_Handler();
}

Here is what i added to ADC1 for triggering:

sConfigInjected.ExternalTrigInjecConv = ADC_EXTERNALTRIGINJECCONV_T2_TRGO; 
//

?
1 REPLY 1
udibit
Associate II
Posted on April 21, 2015 at 14:04

O.K, I got it, Just in case someone else  encounter it,

I should used the ADC injected group start function for

interruption

:

HAL_ADCEx_InjectedStart_IT()