# Generic question about interfacing a microcontroller with a device: when is the current limit a problem?

I have an Arduino Board, to be precise many models, but let say I want to interface a ATmega328p with another integrated circuit (all is running at 3.3 V). In this case I want to connect Arduino with a A4988 microstepping Driver. As everybody knows each output pin of the Arduino Board can source or sink max. 40 mA of current. Looking in the datasheet of the driver I find such electrical characteristics:

which clearly state that the max current 20 uA is.

Now, I don't know whether under those circustances possible is, to connect each Arduino Output Pin with the control logic of the driver directly or not. So here a few questions:

1. If is it possible to connect both devices directly, how can I make sure that the arduino board doesn't source 40 mA into the driver destroying it? Comparing max current of input and output is the right way to be sure, that nothing is going to fry??
2. If the current must be sinked to max. 20 uA (because the motor driver is the weakest component in this simple circuit), then I would insert a resistor. But how to dimension it? All what I know is that the output of the arduino board can output 3.3 V as Voltage and max 40 mA. At the input's side I know that a logic O is any voltage between 0 and 0.99 V (3.3 x 0.3 as per datasheet). So I would write:

$$R = \frac{(V_{output} - V_{input})}{I_{max_{driver}}} = \frac{(3.3 - 0.99)}{(20 * 10^-6)} \approx 120 k\Omega$$

Is this consideration right or I'm missing something very important or doing a mistake somewhere??

I'm not really sure about the 2nd idea because in the datasheet there is a clear example on how it should be connected with a microcontroller:

But is the depicted example real or is a really simplification which cannot be used but just reconsidered for each different possible microcontroller?

• The depicted example is likely real. Just imagine the legal liability if manufacturers published schematic diagrams with lots of parts with real values, but something critical missing, without printing a big warning. Inputs consume the amount of current they need. Imagine the difficulty of making something work where an ability to supply more than enough current broke the device using the current. Your mobile phone charger would blow up when you plugged it into the main; mains can supply, maybe, 60Amps, but the phone charger only needs 0.05Amp. A car battery would blow up a headlamp, etc. Commented Jan 25, 2016 at 0:56