EC1 EasySteps

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).

Expert summary

Got the right firmware?

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.

If your background is not in the electronics field, we may confuse you a bit with the way we refer to power supply pins, grounds, “common” terminals etc. In electronics we generally quote all voltages in relation to an assumed common or reference terminal. That common terminal is often called “ground”, “gnd” or “circuit ground”. It may or may not actually be tied to a physical ground point, for instance mains power supply earth.

In SPLat boards we usually label the “ground” terminal “0V”. On boards that are powered off an external DC power supply (which is most off-the-shelf boards), 0V is the terminal connected to the negative terminal of the power supply. Measured relative to that pin, therefore, the positive power supply pin will be 24V (or 12V or whatever the supply voltage is) positive. We then say “we have a +12V supply”. All boards contain a voltage regulator chip to feed the microprocessor and/or other logic chips. In the EC1 this chip generates 3.3V nominal (many other boards use 5V). Its output voltage is said to be +3.3V, again measured relative to the 0V terminal.

Similarly, all input and output voltages are also measured relative to the 0V terminal, and will in virtually all cases be positive voltages. For example, on most SPLat models the input voltage threshold for digital inputs, and analog input and output voltages, are measured relative to 0V.

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:

  1. The pin has a 10KΩ resistor to 0V, NOT 40KΩ to +3.3V;
  2. It requires a “high” voltage (+3.3V) for the ON state (opposite of all the other digital inputs);
  3. 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;