Solved
How can I use Capture Compare as external trigger source?
Hi!
This might be a simple question, but I still haven't solved it.
I want to create an external trigger source for SDADC 16-bit and I have selected TIM12 Capture Compare 1 as external trigger source.
Then I have enable the Output Compare, because I did not find Capture Compare.
Then I enable the NVIC for the SDADC.
HAL_TIM_Base_Start(htim13); /* TIM13 is trigger source for SDADC1 */
HAL_TIM_Base_Start(htim12); /* TIM12 is trigger source for SDADC2 */
HAL_TIM_Base_Start(htim16); /* TIM16 is trigger source for SDADC3 */
if (HAL_SDADC_InjectedStart_IT(hsdadc1) != HAL_OK)
Error_Handler();
if (HAL_SDADC_InjectedStart_IT(hsdadc2) != HAL_OK)
Error_Handler();
if (HAL_SDADC_InjectedStart_IT(hsdadc3) != HAL_OK) /* Differential only */
Error_Handler();But still. Nothing happens when I have this function avaiable.
This never calls. Why?
/* Callbacks for SDADC */
void HAL_SDADC_InjectedConvCpltCallback(SDADC_HandleTypeDef *hsdadc){
if(hsdadc->Instance == SDADC1) {
STM32_PLC_Analog_Input_SDADC1(hsdadc);
}else if (hsdadc->Instance == SDADC2) {
STM32_PLC_Analog_Input_SDADC2(hsdadc);
}else if (hsdadc->Instance == SDADC3) {
STM32_PLC_Analog_Input_SDADC3(hsdadc);
}
}