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.

Intermittent DC Motor on H-Bridge

Status
Not open for further replies.

Dalaran

New Member
I am trying to run a DC motor using a L293DNE H-Bridge and PIC16F684. Pins 2 and 7 of the bridge are connected to 2 PORTC pins on the PIC. The PIc compares 2 analogue inputs and if A > B set PORTC.0 high and PORTC.4 low, and vice versa if A < B. There is a region in the middle that both ports go low if the inputs are sufficiently close. I can post code if anyone is interested but it was initially checked with LEDs connected to the ports and everything worked perfectly.

This is the connections of the H-Bridge.
**broken link removed**

Always when the PIC is first started the DC motor runs smoothly in the direction it is intended. I am currently using 2 voltage dividers to set the voltages on the two analogue pins on the PIC. CCW direction always works fine but when I try to set it to the CW rotation it gets all jittery and starts and stops a few times a second.

Any ideas what might be going on?

Thanks.
 
Without seeing the entire circuit with the PIC included, one thing I did notice just briefly glancing at the datasheets is that the PIC outputs indicate CMOS and the inputs for the bridge IC are TTL. Unless you have some kind of buffer this might mean your ICs are incompatible.
 
Thanks for the info. Interesting thought, but using the link suggested and the 1k resistor to ground since I am using the same supply has had no effect.

I didn't really think necessary to include the PIC circuit since the outputs are just directly connected to the H-brdige (1k to ground now) and the 2 analogue input pins are from voltage dividers. I also have a 100nF cap across pic power/ground.

Any other ideas are appreciated.

Thanks.
 
One other thing, you didn't mention if you have the EN (enable) pin connected to anything. Just something else to check.

OK, one suggestion...as a troubleshooting aid, might I suggest diconnecting the PIC from the bridge and driving the bridge inputs with direct voltage signals from your supply. Flip flop them with a switch or something. I realize you tried the resistor per the link but I would take it one step further. One of the best troubleshooting techniques is to "divide and conquer". If the bridge drives the motor properly with a manual test like this then you have no alternative but to suspect the PIC is not working properly with the bridge chip.
 
Also, you are using the 293D variety correct? Just to make sure, you aren't using the external clamp diodes right? The datasheet specifies that the "D" chip has internal diodes.
 
Excellent help, thank-you. Although has not solved the problem yet lol. The enable is tied high and I must have totally forgot about the diodes on the output circuitry. I read that they were internal on the D version but must have slipped my mind when I was building it. I removed them but it has still not solved the problem. Thanks for the help though.
 
I've done a little more testing and it seems that when I switch back to CW rotation and the motor seems to almost jam up the output pins on the PIC are not driving the correct voltage. Under the CCW rotation that works fine I have almost exactly 0V and 5V at RC0 and RC4 respectively. However when the motor struggles I only measure ~0.35V on both RC0 and RC4.

What could cause this sort of behaviour in the PIC?

Thanks.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top