PWM on 52223EVB

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PWM on 52223EVB

2,252 Views
PopsStack
Contributor I
I am trying to get the PWM up and running on the 52223EVB but am battling to fathom out hte PAR for Port TD.
 
Chapter 12 shows the various ports and the memory map does not show anything for PORT TD, unless I am overlooking something simple (more than likely).
 
I have calculated the scaling value for the PWMSCLA register and for clock A but am a little confused as to the vlaue that is requried for the period register PWMPERn register.
 
Do I have to calc this value or is this a counter that is generated.
 
Thanks
Labels (1)
0 Kudos
3 Replies

420 Views
p_vagnoni
Contributor III
Hello Pops,
 
the value in the register PWMPER give you the upper limit of value in register PWMDTY.
 
 
0 <= PWMDTY <= PWMPER
 
So if you want more "precision" you hhave to use maximum value (255 = 0xFF): you should use 256 different value of output, but if you have your "analogic" value not in an 8 bit format (e.g. you have a variable 0 to 100) you should use the maximum value of your variable (100) to avoid software "conversion" (you have to convert your 0-100 var in a 0-255 value and after write in PWMDTY).
 
I hope it will help you.
 
Paolo
0 Kudos

420 Views
PaoloRenzo
Contributor V
Hi!

Maybe this spreedsheet could be useful. Just remember almost all PWM registers are 8-bit size, except PWMPER register, when you concatenate 2 PWM channels (16-bits)

Good luck!

Paolo
0 Kudos

420 Views
PaoloRenzo
Contributor V
The spreedsheet, just remove .txt in file name
0 Kudos