Hi.
I'm trying to make a 2 wheel self-balancing robot - right in the initial phases.
I am using a PIC microcontroller (PIC18F4220 or PIC18F4620) and a L298N Full H-bridge.
I have learned how to use PWM to control speed of the individual motors - but only in one direction.
Currently, I can controle 1 motor for speed and direction using the 2 PWM pins on the PIC. I would like to control both motors for speed and direction (independantly) using the PWM outputs from the PIC. How can I do this with just 2 PWM pins available on the PIC? Do I need a different PIC with more PWM outputs or is there a way to accomplish this using just 2 PWM outputs?
Any help will be highly appreciated!
Thanks.
ashrau
I'm trying to make a 2 wheel self-balancing robot - right in the initial phases.
I am using a PIC microcontroller (PIC18F4220 or PIC18F4620) and a L298N Full H-bridge.
I have learned how to use PWM to control speed of the individual motors - but only in one direction.
Currently, I can controle 1 motor for speed and direction using the 2 PWM pins on the PIC. I would like to control both motors for speed and direction (independantly) using the PWM outputs from the PIC. How can I do this with just 2 PWM pins available on the PIC? Do I need a different PIC with more PWM outputs or is there a way to accomplish this using just 2 PWM outputs?
Any help will be highly appreciated!
Thanks.
ashrau
Attachments
Last edited: