i want to control four wheel for my robot to control speed and direction
i want to control four wheel for my robot to control speed and direction
To control the dc motors the simplest option is to use a couple of so called H-bridges. These allow your microcontroller to control both the speed and the direction of dc motors.
You can simply use pwm to control the speed, looking at the datasheet of the 16f877 it seems that it only has 2 hardware pwm outputs. This means that if you want to control each motor sepperatly you will have to implement 2 software pwm ports, besides using the 2 hardware pwm ports.
AML,
You could try to use an external breakoutboad for driving several motors from a single port.
What that really amounts to is using another microcontroller with more motor control ports, or several small motor controllers in a row. This new system would interpret the singal coming in from the PIC 16F877a and control the motors according to how you design the software. This would be a good option if the motors are high powered and needed a separate driver circuit anyway.
For ease, I recommend getting a PIC with more control ports, if you want to bypass additional boards.
Cabe