[Joonas] has been following TI’s ‘getting started’ tutorials for their new Stellaris Launchpad. Everything had been going swimmingly until [Joonas] reached the fourth tutorial on interrupts. To the ire of LEDs the world over, implementing PWM on the new Stellaris Launchpad is a somewhat difficult task. After banging his head against the documentation for hours, [Joonas] finally cracked his PWM problem and decided to share his discoveries with the world.
The Stellaris has a PWM mode for its six hardware timers, but unfortunately there are no PWM units on the chip. Solving this problem required making two 16-bit timers out of a single 32-bit one. This allowed [Joonas] to specify a ‘load’ and ‘match’ value.
After coding this up, [Joonas] discovered the PWM timer only works on two of the Launchpad’s pins. Hours of Googling later, he had real PWM on his Stellaris Launchpad.
Given the amount of time [Joonas] spent on this problem, we’re glad to help all the other frustrated Stellaris tinkerers out there by sharing this.