2016-09-20 04:55 AM
Hi there
I am trying to set up the output compare value of timer3 in my STM32F030 to trigger a single channel, single shot ADC conversion every 60ms. I'd like to use the HAL drivers (see UM1785, I am bulding the project around the CubeMX). How do I setup the trigger? I suppose I have to write a 16 bit value somewhere to program the OC timeout suited for 60ms. Should I use HAL_TIM_OC_MspInit API? how?I cannot find example code around, please advicemany thanks2016-09-21 02:25 AM
Hi stanzani,
The easy way that you keep the ready-to-use example provided by ST your help source. I recommend that you check the example ''ADC-TriggerMode'' in firmware package at this path: STM32Cube_FW_F0_V1.6.0\Projects\STM32091C_EVAL\Examples\ADC\ADC_TriggerMode You will figure out then out the TIM and ADC are configured. In example, The timer is used to trigger an ADC measure at 20 KHz. -Hannibal-