2015-06-30 01:23 AM
Hi.
I'm trying to run TIM_OCToggle example from SPL 1.4.0. It works in general, but I think it isn't correct: all frequencies are equals. I checked it by oscilloscope. Waveforms are the same and shifted each other. As described in readme.txt, different pins should generates different frequencies. What wrong? I want get two signals with different frequencies 1:32 | 1:16 | 1:8 . and #stm32f4 #discovery #!stm32f4-disco #timers2015-06-30 02:56 AM
Hm.. Reference manual RM0090 in the section 18.4.7 says:
Bit 3 OC1PE: Output compare 1 preload enable
... Note: 1: These bits can not be modified as long as LOCK level 3 has been programmed (LOCK bits in TIMx_BDTR register) andCC1S=00
(the channel is configured in output).And CC1S bit:
Note: CC1S bits are
writable only when the channel is OFF
(CC1E = 0 in TIMx_CCER). Function TIM_OC1PreloadConfig( TIMx, TIM_OCPreload) doesn't check it. Timers 2, 3, 4, 5 don't have BDTR bit (developers, please correct RM!); but CCxS sets first than OCxPE if I catch it right.2015-07-01 01:03 AM
Sorry, all.
I use GCC and of course utility 'make'. I didn't include 'stm32f4xx_it.c' in list compiled and linked files! PS: Compiler didn't report about error. I hoped read it. Why? Usually, when I use global variables in interrupt, I declared its in file with interrupt body and use variable in main.c and other files. In the example variables declared in main.c . I know, my way is wrong but it can be usefully.