0
\$\begingroup\$

I'd like to drive a 16kHz PWM signal at 0.5mA into the input of a motor driver expecting logic levels of 0V for LOW and 12V for HIGH, and expecting a PWM signal around this frequency. The PWM signal will be generated by an Arduino Uno (ATmega328 mcu) with 0-5V logic (0V LOW, and 5V HIGH), and capable of driving 40mA max.

The motor driver PWM input will be used by the driver to produce a PWM output at the motor, with real power to rotate the motor. So, this input PWM is just a low-current 0.5mA signal, NOT a high-current PWM. The PWM duty cycle controls throttle. Let's assume that a 10% duty cycle error is the max acceptable, meaning that the slew rate must be this or better:

1/16000 cycles/sec * 0.1 * 1e6 us/sec = 6.25 us rise time from 0 to 12V

So, slew rate must be 12V / 6.25us = 1.92V/us, or 0.52us/V (however you want to look at it), or better.

The motor driver input registers a HIGH from 2/3 * 12 = 8V to 1.25 * 12 = 15V, and a LOW from -0.5V to 1/3 * 12 = 4V.

It's been suggested here that a MAX232 can also be used to convert a 0-5V input PWM to a 0-12V output PWM to be used as a logic signal to a motor driver requiring 0-12V PWM logic.

Is there some MAX232 chip configuration which makes this possible, to convert 0-5V input to 0-12V output, to be used with PWM?

I don't believe there is, and have instead suggested using a half-H-bridge IC to do the job. I've received a lot of push-back and criticism for some reason for suggesting an H-bridge IC, however, and I'd like to know if I'm missing something here, and if so, what.

Here's the MAX232 datasheet. It indicates it requires a single 5V supply to Vcc to accept 0 to 5V input logic levels and convert them to -7V to +7V output logic levels (see VOH and VOL in table in section 7.6 of datasheet) in order to convert 5V TTL logic to +/-12V (or similiar: +/-7V is good enough) RS-232 logic levels. (Of course, it does this in reverse too, but I only care about this direction).


Update:

My conclusions:

You don't know what you don't know until you either know it, or know you don't know it.

So, after already having thought about it myself, and now after seeing a couple answers here, it still seems to me that a MAX232 definitely isn't suited for this job unless one is mistaken about what the motor input signal voltage range is, and it can actually handle the RS232's -7V as a valid LOW input signal and +7V as a valid HIGH input signal.

If that is not the case, choose something other than a MAX232 chip to do the job.

\$\endgroup\$
11
  • 1
    \$\begingroup\$ That can't be answered without knowing the PWM frequency, and what kind of load will the motor driver input present to the signal, and what kind of slew rate does the motor driver input require. Please add this info. However, I also don't see how a MAX232 specifically could be used for this, unless connected in a very unconventional way to external 12V for V+ and for 0V as V-. However, it seems that the device which requires PWM is unknown, and it's PWM input parameters are unknown, so until they are known, the question is not answerable, only guesses can be made. \$\endgroup\$ – Justme Oct 14 '20 at 20:11
  • 1
    \$\begingroup\$ Great, now we still need the information about the device with PWM input, to know if it can be driven with MAX232 output or not. It is impossible to say if something will work or not, if we don't have the information what we are connecting to. \$\endgroup\$ – Justme Oct 14 '20 at 20:38
  • 1
    \$\begingroup\$ Is there a reason you can't just use a logic-level MOSFET to do this? \$\endgroup\$ – evildemonic Oct 14 '20 at 20:49
  • 1
    \$\begingroup\$ Reasonable assumptions maybe, but I just wanted to be sure. Does the motor controller have a name, part number, or data sheet to know if the input is high impedance or low impedance? \$\endgroup\$ – Justme Oct 14 '20 at 20:49
  • 2
    \$\begingroup\$ @Gabriel Fair enough. If you can't invert the input signal, you would need 2 FETs and 2 resistors instead of one each. This would still be easier/cheaper/faster for most circuit builders than trying to crowbar in a MAX232 which could barely do the job, if at all. \$\endgroup\$ – evildemonic Oct 14 '20 at 21:38
2
\$\begingroup\$

It is highly unlikely that it will be worth it to convert a MAX232 circuit to drive this PWM.

MAX232 in general uses the supplied 5V to make +/- 7 volts with a charge pump, it might be possible to make it drive 0V and 12V, but it would require an external 12V supply, and while being within absolute maximum ratings, this kind of configuration is not shown in datasheets or application notes.

Perhaps it would be better to use a FET gate driver for this, they are designed to take in logic level signals and level convert them into higher voltages such as 12V.

\$\endgroup\$
1
  • \$\begingroup\$ Sounds good to me. It's what I suspected. I'll leave the question open for now though to draw more answers just in case. \$\endgroup\$ – Gabriel Staples Oct 14 '20 at 21:01
2
\$\begingroup\$

Why not use a level-shifter, a part designed to do this. You need to find one that can translate up to 12V, a CD4504 seems to fit. Of course, you will need a 12V supply.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.