HWPWM with higher resolution

Questions on other types of hardware and getting it talking to the ARM CPU
Post Reply
Posts: 1463
Joined: Fri Oct 19, 2012 5:11 am

HWPWM with higher resolution

Post by YahooArchive » Fri Jan 25, 2013 3:59 pm

>from the help line
>I was reading the manual and doing the programming in basic my application for
this MCU would be a 4 quadrant H-Bridge controller at 400amps.. The problem I
see is the pwm outputs have to run a 16khz in my application and provide at
least 256 pulse width points to provide throttle control for the H-Bridge.. If I
am reading the manual correctly at 16khz I would only have 70 pulse width points
available.. Is this a correct assumption or am I missing something..

HWPWM (source in BASIClib) was written for 1 usec timing. The Timer counters
can run faster (up to 15 MHz) so finer control is possible.

For instance, to get 5 MHz or 200 nsec resolution, change the prescale value
below to 3.

SUB HWPWM ( channel, cycletime, hightime ) ' channel are 1-8
DIM prescale as integer
DIM divider as integer

prescale = 15 ' (CCLK/PBSD/1000000) as the peripherals run at 15 MHz
divider = 0

Post Reply