![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
I want to run two cordless drill motors through MC33886DH-s with PIC16F876A. The MC33886DH uses two inputs to control the direction of the motors, but the PWM is applied to the pin, that is LOW at the time. So when running in one direction, I need to PWM on pin, when running in reverse - another. And since I want to run 2 motors, I'd need 4 PWM outs. Is there any other way to solve the problem, aside from getting a new pic?
__________________
Here...let me improve it for you! *Puff of smoke* ....oops... |
|
|
|
|
|
|
(permalink) |
|
Simple you dont drive it directly whith PWM.
You use PWM to pullwon 2 normal I/O pins
__________________
Il give you shocking experience. |
|
|
|
|
|
|
(permalink) |
|
but I need to PWM two pins alternately.
Say I use PinA and PinB for controlling one motor. So when moving forward, I'd keep PinA HIGH and PWM PinB. And for reverse I need to hold PinB HIGH and PWM PinA.
__________________
Here...let me improve it for you! *Puff of smoke* ....oops... |
|
|
|
|
|
|
(permalink) |
|
look through the microchip website at some of the larger 18F series chips ... many of them have "motor control" modules, called ECCP or Enhanced Capture Compare PWM, where the PMW module is capable of driving multiple H-bridge chips in various configurations (more pwm outputs)
|
|
|
|
|
|
|
(permalink) |
|
yeah well that's what I wanted to know... if there was any other way, except changing PIC's.. So I guess I'm going to have to look for an alternative H-bridge for my motors.
__________________
Here...let me improve it for you! *Puff of smoke* ....oops... |
|
|
|
|
|
|
(permalink) |
|
ok..I started wondering something... I would be set, if there was a way to switch I/O-s with an extra logic gates or something like that.
Or maybe with a couple of transistors? Create a low power H-bridge, use PIC PWM pin for one input, take +5V for the other and a second PIC pin to control the direction of the small H-bridge? That could work, couldn't it?
__________________
Here...let me improve it for you! *Puff of smoke* ....oops... |
|
|
|
|
|
|
(permalink) |
|
The usual way is to apply the PWM to an 'enable' input on the H-bridge, and use either one or two I/O lines to set the direction - most small H-bridge IC's have this facility!.
Basically you need to design your H-bridge accordingly, the two PWM channels should be all you need!. |
|
|
|
|
|
|
(permalink) | |
|
Quote:
__________________
Here...let me improve it for you! *Puff of smoke* ....oops... |
||
|
|
|
|
|
(permalink) | ||
|
Quote:
|
|||
|
|
|
|
|
(permalink) |
|
well if they crash and burn on me, then I'll get some high power MOSFETS and put together a new H-bridge. But since these are the options I have right now, I'll have to find a way to get the job done with those IC-s.
Someone recommended to use 74HCT00-s to toggle the PWM and the second PIC output. But I have no idea how to accomplish that...
__________________
Here...let me improve it for you! *Puff of smoke* ....oops... |
|
|
|
|
|
|
(permalink) |
|
Its simple look have two normal I/O pins drive the H brihgt trough a resistor. Then have an diode to the PWM pin.So the at the PWM signal will pull down the I/O pin.So you make the I/O go high an the PWM will pul it down trough the diode.
This is the simplese way to drive an H bridge whith no enable fuction. An more profesional method would be AND gates.
__________________
Il give you shocking experience. |
|
|
|
|
|
|
(permalink) |
|
Heres an schem
__________________
Il give you shocking experience. |
|
|
|
|
|
|
(permalink) |
|
ok, so this should work?
SL1 and SL2 - motor outs SL3 - motor and H-bridge power SL4 - +5V power SV1 - to PIC
__________________
Here...let me improve it for you! *Puff of smoke* ....oops... |
|
|
|
|