Hi All:
I am new to PWM and I'm not understanding how the Clock is related to setting the period. (I'm running a TM4C129.)
If my clock is running at 40Mhz and I wanted to set the Pulse With at 75% (or 30,000,000) clock ticks, I would do the following:
ulClock = 40000000;
PWMGenPeriodSet(PWM_BASE, PWM_GEN_0, ulClock);
PWMPulseWidthSet(PWM_BASE, PWM_OUT_1, ulClock * 0.75);
I'm not sure why I just can set the clock to let's say 100 and do the same thing.
There is something about the Clock parameter that is important here and I'm just not seeing it.
Any thoughts?
Also, when I am controlling motors using PWM, is the PWM hardware taking cycles 'away' from 'normal processing'.
Thus, if I was running 95% PWM on a pin, then the rest of the code is only getting 5% of rest of the processor. Sounds weird; but, had to ask.
Just not seeing this. A high level explanation would be great.
By the way, I have been hacking away at this system for a long long time. Learned a lot. If not for this forum, I would have given up. I am finally getting close to the end of coding. Thanks for all of your help.
Rick