What is the best way to convert maples 3.3v pwm to 5 volt pwm to run sabertooth motor controller
pwm voltage from 3.3v to 5 V to run sabertooth motor controller
(5 posts) (4 voices)-
Posted 4 years ago #
-
It should be possible to directly connect the Maple to the Sabertooth motor controller to feed it a 3.3V PWM signal which should be enough for it to indicate a logical high (A quick search doesn't reveal the microcontroller the controller is using, so I can't be certain). However, if you wish to convert the signal to a 5V PWM signal, I'd recommend the Sparkfun Logic Level Converters:
http://www.sparkfun.com/products/8745Posted 4 years ago # -
jonsrr - I looked at a sabertooth motor controller at http://www.dimensionengineering.com/sabertooth2x5.htm
There don't appear to be any outputs back from the sabertooth controller to the microcontroller.
So there doesn't seem to be any need to step a signal down from 5V to 3.3V.
It appears you only need to step up from 3.3V to 5V.
So you don't need anything like a Sparkfun logic level converter, which is designed to connect in 5V to 3.3V in either direction.As crenn says, you could drive the signal directly.
There are a bunch of Maple output pins which are '5V tolerant'. That means they can be connected to 5V.
http://leaflabs.com/docs/hardware/maple.html#master-pin-map
For example the pin-map says D5 to D9 are 5V tolerant, and have timer outputs on them.
These pins can be pulled up to 5V with a resistor connected from the pin to 5V.The pinMode for the pin will need to be PWM_OPEN_DRAIN
NEVER use any other pin mode.When the PWM signal is low (0), the pin pulls the voltage down (so use a 1K+ pull-up resistor so that the pin can drive the signal, I'd probably use 2.2K), and when the PWM signal is high (1), the output pin is high-impedance, and is pulled up to 5V by the resistor.
Job done.
Total cost about $0.02, and you may be able to find the parts locally.A disadvantage of using a pull-up resistor is the rise time is a bit slower than actively driving the signal. There isn't enough data on the sabertooth data sheet I looked at, so maybe ask them. It isn't likely an issue if you are running PWM at 1KHz.
So another way is to use 74HCT logic gates. They are specified to translate lower input voltages (2.4V = logic high) to 5V outputs:
http://en.wikipedia.org/wiki/Logic_familyAny 74HCT logic will trigger from the 3.3V-logic outputs of the Maple, and drive a 5V signal.
So for example almost any of these could be used:
http://uk.rs-online.com/web/c/semiconductors/standard-speciality-logic/buffer-line-driver/?sort-by=P_breakPrice1&sort-order=asc&view-type=Grid&applied-dimensions=4294825665&lastAttributeSelectedBlock=Range&sort-option=Priceor if you are in the USA, try digikey.com or mouser for 74HCT parts, e.g.
http://www2.mouser.com:80/Semiconductors/Logic-ICs/Buffers-Line-Drivers/_/N-50nah?Keyword=74hct&FS=True&Ns=Pricing%7C0
There are buffers which will do the job, but literally anything will work. So gates can be used
http://www2.mouser.com:80/Semiconductors/Integrated-Circuits-ICs/Logic-ICs/Gates-AND-NAND-OR-NOR/_/N-6j787?P=1z0y244Z1z0yhhsZ1z0y3wa&Ns=Pricing%7c0&FS=TrueThere are single input buffers, but logic gates work fine too, wire the inputs together. Cost about $0.20.
Connect the input to the PWM pin without any pull-up resistor, and the output to the sabertooth.
In this case, the pinMode will be PWM because the pin is driving both high and low.(full disclosure: I am nota member of LeafLabs staff)
Posted 4 years ago # -
This controller appears to be a standard microcontroller generating a 32KHz PWM output. It's almost certain that it will accept a 3.3V input as a valid input level.
A rarely-considered level converter is a gate driver. There are inexpensive, and can output high current at 20V or even 30V if needed.
Posted 4 years ago # -
becker -
A rarely-considered level converter is a gate driver. There are inexpensive, and can output high current at 20V or even 30V if needed.
Good point. I agree they are rarely considered (I forgot in this case), are reasonably low-cost, provide some isolation between input and output, and do make good singe-direction level converters. As you point out, they are good for more than 3.3V to 5V.
For example
http://uk.farnell.com/mosfet-drivers
http://uk.rs-online.com/web/c/semiconductors/power-management/mosfet-power-drivers/?searchTerm=MOSFET+driver&sort-by=P_breakPrice1&sort-order=asc&sort-option=Price&applied-dimensions=4294880203&lastAttributeSelectedBlock=Number%20of%20DriversSome of them come in DIP packages, so they can be used to breadboard a solution, for example some of these are in DIP packages:
http://www.microchip.com/ParamChartSearch/chart.aspx?branchID=9010&mid=11It is worth noting that they need to be powered from the higher voltage, e.g. 5V and not 3.3V.
I am tinkering around with my own 3A+ two DC motor/1 stepper motor drive (directly driven from the Maple, no other processor), so I'll be interested in experience with the sabertooth.
[In this case specific case, I'd be tempted to connect directly, with a pull-up resistor, or use a $0.20 74HCT buffer/logic chip.]
(full disclosure: I am not a member of LeafLabs staff)
Posted 4 years ago #
Reply
You must log in to post.