April 3, 2009
I was hoping to avoid wrighting my own software pwm for the pic but it looks like i've arrived there. the motors and tracks I hot glued toghther don't drive straigh so the only way I can think of fixing it is to use PWM to slow down one motor. I know I could use the one hardware pwm to slow down just one motor but thats going to be used in the future for somthing else so I have to create the pwm myself in software.
I like how you can set the hardware and it will continue to work while the pic is doing other things. I'd like to have the same sort of functionallity with the software pwm. this leads me to think that I should use the timers and interrupts to create the PWM. I've been looking for some examples that are simple to follow but I haven't come across a good one yet. I guess what I'm looking for are the basic steps (psuedocode) to creating the PWM on a Pic18XXXX microcontroller.