PDA

View Full Version : Running a motor from the PWM pins.


ante
07-20-05, 04:26 PM
I have a motor hooked up in the PWMB5 pin, from what I can tell using a conditional statement involving the redled.

I tried using PWMB5 ON, and n PWMB5 PWM-PERIOD and OUT.
The motor is a 27 khz one, so n is 67500000000000.

I have no idea how to get this motor running. I don't even know if I should plug in an externl power supply to it, or if IsoPod will supply it from it's power cable.

Dave
07-20-05, 04:42 PM
PWM pins from any processor can not directly run a motor. It is required to have an h-bridge as a buffer between the microcontroller pins and the motor, and that h-bridge can vary depending on the requirements of the motor being used.

Please send the type of motor (brushed, manufacturer, voltage and current requirements) and perhaps a specific h-bridge can be recommended.

If you are attempting to signal an RC Servo (Futaba, HiTec, etc) then that can be done directly as these have their own internal h-bridge.

Please let me know what type of motor is to be driven.

cmmffhc
07-24-05, 09:25 PM
Hi,

i think n should not be such a big number:

freq (hz) = 2500000 / n

hence it should be somewhere around 92?

I use a 100 hz hitec servo motor and my n is 25000... hence what i enter in the code is:

DECIMAL
25000 PWMB5 PWM-PERIOD
HEX
2500 PWMB5 PWM-OUT

You don't have to use PWMB5 ON because that is only for a digital output of "1"...

Edu Garcia
07-26-05, 12:21 PM
Hi! Can somebody help me? I´m a student and I´m working with DSP56F803 and my problem is when I try to use PWM and ADC at the same time. The program give me an interrupt 52.

Thanks

nmitech
07-26-05, 01:23 PM
I can't simulate the problem you have. Can you attach you program here?

ante
07-31-05, 04:38 PM
This is an Airtronics RC servo, so it should have an internal h-bridge.


I managed to get it hooked up, properly, it's an absolute motor, so I can set PWM-OUT to a number, and the motor will go to that location every time. I don't know how to tell what a full revolution is, though. Is there any way to tell what 360 degrees is without guessing?