Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PWM Problems

Status
Not open for further replies.

Dalaran

New Member
I am using the PWM of the PIC16F886 to control the "enable" pin of an H-Bridge. By doing this I hope to achieve speed control of the DC motor attached. I am using 2 PIC pins to control the motor direction and the PWM on the enable.

Scoping the CCP1 pin of the PIC PWM output looks exactly as expected. Having a frequency generator simulating the PIC PWM also works as expected giving speed control to the motor.

However when I connect the PIC PWM to the enable pin I have weird things happening. Another pin is simply connected to an LED/resistor to light up when the motor is on, this LED blinks violently when the PWM output is attached to the h-bridge. Oscilloscope results shows that the output port pins of the PIC all remain low ~90-95% of the time and then spike high (if they should be in the high state or remain low if they should be low). The power to the PIC however is quite stable. When PWM is set to 100% duty cycle and acts as a logic high everything works as expected.

Anyone with any ideas what is going on here? This has had the best of me for 48 hours now. All help appreciated thanks.

edit: Further confused, when the motor supply of the h-bridge is connected to a different PSU the PWM output of the pic works. When connected to the un-regulated supply (~6.5V dropped to 5V for the PIC/H-bridge I/O) using the same PSU I get the above action...
 
Last edited:
Schematics and part numbers. I suspect you are using the Enable pin incorrectly. Is there an Input pin on the H-bridge controller?

Again, schematics and part numbers.
 
No delays in between changes? Could be even dangerous for the driving circuit, I guess.

It looks just a drawing to explain the idea not an actual circuit. BTW what with an H bridge this thing has to do?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top