I am using 16f873 and SN745510 to drive DC motors. To be able to change direction of motor, I connect CCP1 to ENABLE pin of h-brigde, RC3 to 1A and RC4 to 2B. | | CCP1 ------------> | 1,2EN 1Y|-----------MOTOR(+) | | RC3 --------------> | 1A 2Y|-----------MOTOR(-) RC4 --------------> | 2A | | | My idea was when RC3 sets +5V(I set RC3 output) and RC4 sets 0V(RC4 input), the output 1Y follows CCP1 waveforms and this motor moves with this duty cycle. The motor moves the other direction when I flip RC3 and RC4. But the frequency of PWM is about 100HZ and duty cycle is 15% When I saw the 1Y pin with oscilloscope, I couldn't see the square wave but saw-tooth wave. 2Y stayed almost 0V with tiny square wave following CCP1 signal. So, this method didn't work to change direction, apparently. Any other idea? PS. My PIC circuit is ready to accept a command from PC through RS232(asynchronous mode). How can I make my host assembler file executable? I don't know how I can establish a communication between PIC and PC. Thank you. --chunhee song ---------- > From: Quentin > To: PICLIST@mitvma.mit.edu > Subject: Driving a H-bridge with PWM. > Date: Friday, May 19, 2000 12:28 AM > > Hi > I want to control the speed of a motor (24V,10A) with one PWM with > direction and brake on a 16c87x. > AFAIK the PWM is available on one output only and cannot be moved to > another output (to change direction). > I will be using two motors, so both available PWM outputs will be used. > I am also doing A/D, so I think I might have some timing problems if I > use software generated PWM. > Any nifty PIC ideas? > > I am trying to avoid using external Logic (but will if I have to). > There are also some H-bridge gate drivers (for MOSFET) out there and > there are motor driver IC's. But I have not found a gate driver that has > the logic I need. The motor driver IC's got the logic but not the power. > Any ideas on this? > > Thanks > Quentin