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-09 03:07 AM
Read the PWM counter and store in one variable.
Read again the PWM counter until the value differs from the stored value. From both values coun can desipher the counter direction.2016-06-09 03:13 AM
I have read but couldn't find any readable register to check
2016-06-09 05:23 AM
Quoting from RM, ''Center-aligned mode (up/down counting)'' subchapter of any of timers' chapter (except the basic ones which don't have this mode):
In this mode, the direction bit (DIR from TIMx_CR1 register) cannot be written. It is updated
by hardware and gives the current direction of the counter. Can this be any cleaner? JW2016-06-09 06:39 AM
Hi Marc,
The counting direction of the counter is indicated by the DIR bit-fields in TIMx-CR1 register. -Hannibal-2016-06-09 11:22 PM
Thank you all ! But i cant read that register to control my sytstem . Do you know how is it?
2016-06-09 11:56 PM
> But i cant read that register
Why? JW2016-06-10 12:20 AM
I dont know how to read the register :\
2016-06-10 01:21 AM
How did you program the timer, then?
If you use some of the ''libraries'' (SPL or Cube), resort to the documentation of that ''library''. JW [EDIT] if you use Cube, then look at macro2016-06-10 02:29 AM
By having a closer look at the registers.
Which IDE are you using ?