2016-06-09 02:57 AM
Hello masters ,
Is there any kind of way or register that PWM counter is counting up or down in center aligned mode? I need to control the system depends on up counting. So i have to check timer counts up or down . #discovery #output #pwm #stm32f42016-06-12 10:20 PM
I use True Studio and just dont know
reading syntax
of the stm32f4 standart peripheral library . I mean how to write a code to read a register :\2016-06-13 02:03 AM
SPL does not appear to have a dedicated function or macro for this particular purpose, but I don't use SPL.
However, have a look into [SPL's directory]\Libraries\CMSIS\Device\ST\STM32xxxx directory, there are stm32yyyyxx.h headers there, which contain everything you need for direct register access: defines for addresses of every peripheral, struct typedefs for registers of that peripheral, and defines for bits/fields within those registers. So, #include the appropriate stm32yyyyxx.h header (you most probably have that included already, directly or indirectly), and then you can write something like if (TIM1->CR1 & TIM_CR1_DIR) { // counting down } else { // counting up } JW2016-06-14 12:46 AM
Thank you all, especially Jan, last code helped me to solve the problem, I have started project with SPL . So i cant change it anymore . maybe i can try HAL Library at next project .