Silly question
teganburns
Posts: 134
So I have the prop chip hooked up to two geared motors that require little power. I had one wire from the motor to pin 38 (3.3 v) on the prop demo board, and the second wire form the motor to Gnd. That worked perfectly. Then i wrote a simple program to give high on pin 0 and the motor wouldn't move. i measured amps and voltages and it should have been working perfectly fine. (gave the same measurements as pin 38) I'm not sure what my problem is here...?
Comments
A simple transistor driver with a protection diode is a much better way to go about this.
-Phil
Assuming so, it won't / didn't work for the following reason:
You didn't say how much current the motor takes. Usually there's a starting current (starting from a stopped state), a lower running current (once the motor is running at speed), and a highest stall current (when the motor is mechanically prevented from moving). A Propeller I/O pin can only provide a certain amount of current. The transistors that make up the output side of the I/O pin circuitry are a certain size and, because of that and how they're constructed, there's only a certain amount of current they can supply. In the case of a Propeller I/O pin, the current is 40mA (see the datasheet for details). Very few motors will operate at that current. I'll bet the starting current is maybe 250mA and the running current maybe 150mA. The stall current may well be close to an Ampere.
Typically, you use an I/O pin to turn on a switching transistor which controls the current to the motor. Nuts and Volts Column #6 discusses this in the context of a Basic Stamp, but the same thing applies to any microcontroller including the Propeller. Only the value of the base resistor would be different (due to the lower voltage used).
I'm guessing you're using a QuickStart board. While the QuickStart is a board to demonstrate the Propeller chip, it is not the "prop demo board".
The Propeller Demo Board (currently on sale) doesn't have a pin 38.
It looks like Phil and Mike have the motor question covered.
It's also common to use a H-bridge chip when controlling a motor with a microcontroller.
-Phil
The Quickstart board ,sorry
And the H-Bridge Chip looks amazing and thank you all!
As I said... we aren't supposed to do this for all kinds of reasons... but my Quickstart survived and the motor turned. http://www.goldmine-elec-products.com/prodinfo.asp?number=G18335... $3. and it has an encoder with 563 steps per revolution... so not only can you go very slowly... but you can accurately assess just how slowly you are going. The problem is that to go backwards you need some kind of switches...that's where the h-bridge comes in... you can use reed switches to make sure you understand the logic ... radio shack has them... they say 5V... but they work with the Propeller just fine.
My guess is that your motor is periodically drawing enough current to cause the Prop to suffer from the electronic version of vertigo. try the following: put a momentary switch on the 3.3v line to your motor. Load some other program that blinks something somewhere into EEPROM. Then load your program into RAM. Wait till everything stops blinking and push the momentary button... your EEPROM program will probably be running when you are done.
don't see how to get rid of this:)
Just because it survived doesn't mean it wasn't damaged. You may have severely shortened the life of your QuickStart. As Phil mentioned earlier, a motor presents more problems to the Propeller than just the high current. There are very good reasons why "We aren't supposed to do this sort of thing."
I wasn't about to ask... "hey what happens if I try to draw more than 50milliamps out of a pin?" I could look it up... but that would take time... why not just do it?
Firstly that no-load rating is already exceeding the Prop pins current rating in the worst case and of course no motor starts up pulling the same current as no-load
rating (wheels or no wheels), its cold start current will be an order of magnitude higher probably.
If by diode protected you mean the the inbuilt protection diodes then you perhaps don't realize that these are tiny, and will tolerate a few milliamps or so only.
They are designed purely to prevent low voltage static discharge damage. Pass too much current through them for too long and they will fry. Pass too much
current even briefly and you risk sending the chip into a latch-up state which may destroy it (and cannot be stopped without powering it down).
It also takes time to order a replacement board
It does take time to order replacement boards... that is why it is very important to have spares. PropellerPowered has a deal on... time to order a few:)
Thanks guys,
Rich
-Phil
Change that "tiny" to "really tiny"!