Ryan Starret

Can't write to PWM Registers (MC9S08QG8)

Discussion created by Ryan Starret on Mar 3, 2007
Latest reply on Mar 4, 2007 by bigmac
Hi eveyone.

This problem is pretty simple to explain. When I write to either PWM register on the MC9S08QG8 nothing happens the first several times I try. For example:

while (counter less than 100){

At the end of 100 loops TPMC0V would be about 10 and my counter would be 100. I can watch this behaviour when I step through the code and it's severely affecting my robot's control system. Any ideas?