Hardware Reference
In-Depth Information
If you look carefully at the chart, there is a dodgy area where the GPIO output can be
as low as V OH ³ 1 . 3 V and still be in spec as far as the Raspberry Pi is concerned . We see that
the L298 considers signals V IL £ 1 . 5 V as a low . Worse, only voltages ³ 2 . 3 V are considered
high by the L298. The good news is that the L298 input current is very low:
L298
Symbol
Parameter
Test Conditions
Typ
Max
Unit
I IH
High-voltage input current
V I = H £ V SS - 0 . 6 V
30
100
mA
The input current necessary to drive the L298 input high is a maximum of 100 μA.
The lowest configured output drive capability of a GPIO pin is 2 mA. The L298 input
current requirement is thus only 5% of the minimum current drive available. If the GPIO
pin had to drive a 2 mA signal, its output voltage might be as low as 1.3 V. But having to
supply only 100 μA of signal current means that the GPIO voltage should be almost as
high as it can go.
For this reason, it is not that unreasonable to expect the GPIO output voltage to
be near 3 V (allowing for a drop from the +3.3 V supply). However, we must allow for
variation in the +3.3 V power supply as well. If the supply is within the standard range
of +3.125 to +3.465 V, and we allow a GPIO output drop of, say, 0.3 V due to the output
transistor R on , then the unloaded GPIO output voltage could be as low as 3 . 135 - 0 . 3 =
2 . 835 V . This is only 0.535 V above the minimum V IH = 2 . 3 V that we need for the L298.
This is cutting things rather close, but sufficient for hobby and educational use (for
products that are sold, you would want a greater margin for error). If this remains a
concern for a project build, external pull resistors to +3.3 V can be added.
The DMM Check
The final word is the voltage measurement of the L298 chip's inputs. You must make
certain there is no pull-up resistor to +5 V on the PCB. The datasheet doesn't indicate that
any L298 chip internal pull-up resistors exist. But seeing is believing, so don't skip this
check. A purchased PCB is more likely to contain pull-up resistors than not.
Without attaching it to the Pi, supply the circuit with +5 V for its logic (the motor
supply need not be applied). When using the onboard regulator, supply the +12 V to the
+VS input instead. Then check the voltage appearing at the EnA, EnB, In1, In2, In3, and
In4 inputs. When measured, there should be nearly no voltage present (with respect
to ground). If you read +5 V instead, the PCB likely has provided a pull-up resistor
somewhere. For the enable inputs, jumpers may need to be removed. Do not wire these
inputs to the Raspberry Pi until these inputs have passed this check. Anything measured
less than 0.6 V is probably OK. Measurements higher than this probably mean a defective
driver IC or a wiring error.
If you are supplying the L298 logic from a separate +5 V supply, it is a good idea to
perform one more test with the +12 V (or higher) motor supply applied. The measured
voltage at each input pin should remain as before, near zero. Anything else suggests a bad
PCB or defective L298 chip leaking current into the inputs.
 
 
Search WWH ::




Custom Search