In this EasyStep you will discover the basic electrical characteristics of the EC1’s digital inputs. This is a highly condensed extract from the official data sheet of the STM32F372CC chip – about 5 pages’ worth of it. This applies to all digital inputs except input 0, the push button input (separate heading below).
A digital input is a pin that senses the on/off state of something connected to it. How this is done can vary greatly. In the case of the EC1 the inputs are voltage sensitive. The EC1’s processor senses the voltage applied between 0V (common, power supply negative) and the input pin, and based on that decides if it is “high” or “low” A high voltage is anything greater than 2.43V. A low voltage is anything less than 0.94V. Anything in between is indeterminate. Voltages less than 0V or greater than the processor chip’s 3.3V supply voltage can damage the chip (but see the section “5V tolerant inputs” below).
A low input voltage is considered to be ON, and a high voltage is considered to be OFF. This is the opposite of the outputs. We made it this way because it is more likely to be compatible with the most common sensor devices. In this context ON and OFF correspond to True and False results from an Input instruction.
ON/OFF, High/Low, True/False, 1/0 — what gives???
Internal to the processor chip each input pin has a 40KΩ resistor between the input pin and the +3.3V supply. We call this a pull-up resistor, because it pulls the input pin up to 3.3V if there is nothing else connected. This has a few consequences:
- An input pin that is left unconnected will default to the OFF state.
- An open collector NPN transistor can drive the pin directly, with no additional components, providing it has suitable low leakage (“OFF current”)
- A good quality switch with low current-rated contacts can drive the input directly. However, be aware that the very low current through the switch when it is on (about 80µA) will not provide any contact wetting. More information.
![]() | The sketch shows two possible input sources, a switch and an NPN transistor. The 40KΩ resistor is inside the processor chip. |
Confused about “0V”, “common”, “gnd”? click here to see some common terminology.
The push button input
Input 0, which is the onboard push button, is also available on pin 30 of the EC1 board. You can use this input in your application, providing you observe the following constraints:
- The pin has a 10KΩ resistor to 0V, NOT 40KΩ to +3.3V;
- It requires a “high” voltage (+3.3V) for the ON state (opposite of all the other digital inputs);
- If it is held high at power-on or hard reset, the chip will go into reFlash mode and not run your SPLat program. It will be expecting a firmware update instead. See Upgrading the firmware in your EC1
5V tolerant inputs
Many of the pins on the EC1 are “5V tolerant”. That means that when the pin is used as an input, it can be connected to +5V. The EasyStep on the EC1 I/O map specifies which pins are 5V tolerant.
Some interesting ways to blow up your EC1
If you want to blow up your EC1, and void the warranty, here are some things you can do to the inputs:
- Connect an input to any voltage greater than 3.3V, or 5.5V if it’s “5V tolerant”;
- Connect an input to any voltage more negative than 0V;
