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.