2016-07-05 03:44 AM
Hi Sir/Madam:
I've encounter a issue about setting Time base on STM32F030R8.I used TIM14 to be time base.When I check the 10ms time base in stm32f0xx_it.c.That was worked normally.2016-07-05 05:29 AM
Not sure exactly what's going on here, but your variable needs to be volatile. I'd recommend toggling the GPIO at each event.
2016-07-05 06:26 AM
Hi Ben,
Even I don't know why you are waiting 10 times to set the flags in the IRQ_Handler, you should ensure that the declaration ofCCR variable in stm32f0xx_it.c fileas follow:extern __IO uint16_t TIM14_CCR_VAL;
-Hannibal-
2016-07-05 06:44 AM
Hannibal do you think??? TIM14_CCR_VAL is macro.
Only flag variable nedd to be volatile. But anyway this code is mess. TIM14_CCR_VAL isn't visiblefor all files where is used. So this code will never compile succesfull.2016-07-05 07:53 AM
Hi , you would change it to a volatile vaiable.
To get more help, I recommend to get a look to ''TIM_TimeBase'' example in at this path STM32Cube_FW_F0_V1.2.0\Projects\STM32072B_EVAL\Examples\TIM\TIM_TimeBase You can aslo use tool to generate correctly your initialization code and start you project development. -Hannibal-2016-07-05 09:44 AM
The OP is clearly not using HAL/Cube. Examples exist within the SPL, and on the forum.
I'd test this by toggling a GPIO, and not having it running under a debugger. I'm not sure why the trace has missing pulses, but I'm not willing to spend my time diagnosing it.2016-07-06 01:22 AM
Hi clive1, Hannibal and dembek.radoslaw.001
I make a mistake in TIM14_CCR_VAL.It should be set volatile not define in a file. (But, IAR don't show any error or warning before change the variable).After that, it still lose the pulse waveform(I used the example code from en.stsw-stm32140).Thank you for your reply.