Why Can MCU Pins Only Recognize Voltage Signals?

For MCU chips, whether configured as input or output, the ultimate object of operation is a voltage signal, not a current signal. This is something everyone should be clear about.

If the external input is a current signal, it needs to be converted into a voltage signal through hardware circuitry. The MCU program collects and processes the voltage data, then calculates the current data in reverse, as shown in the figure below:

Why Can MCU Pins Only Recognize Voltage Signals?

So, why can MCU pins only recognize voltage signals?

This question was asked by a friend who was considering switching to embedded software development. At that time, I could only provide a partial answer. After researching and organizing the information, it turns out this is related to the physical properties of semiconductors, the principles of digital circuit design, and their practical application requirements. Let’s elaborate on this.

1. Semiconductor Working Principles

Transistors as Basic Units:

The input pins of an MCU are essentially connected to internal transistor circuits, such as CMOS or TTL gate circuits. Transistors switch between conducting and non-conducting states based on the high or low voltage levels, where high voltage represents logic “1” and low voltage represents logic “0”.

Voltage-sensitive Gate:

Taking MOSFETs (Metal-Oxide-Semiconductor Field-Effect Transistors) as an example, their gates are controlled by voltage (not current) to turn on, with very high input impedance, consuming almost no current. Therefore, MCU pins are sensitive to voltage changes and do not respond directly to current changes.

2. Standardization of Digital Circuits

Definition of Logic Levels:

Digital circuits rely on preset voltage thresholds, such as TTL where above 2.0V is considered high level and below 0.8V is considered low level. Of course, the thresholds defined by different MCU manufacturers may vary, and one can refer to the electrical parameters section of the MCU datasheet, such as the voltage threshold specifications in the STM32G4 series datasheet, as shown in the figure below:

Why Can MCU Pins Only Recognize Voltage Signals?

Current signals cannot directly match these standards unless converted into voltage signals through hardware circuits or dedicated chips. Just as we usually bind high and low levels with voltage data.

Anti-interference:

Voltage signals are relatively easier to maintain stability on PCB traces, while current signals are susceptible to line impedance or noise, leading to logical misjudgments.

3. Input Protection and Interface Design

Electrostatic Protection:

MCU pins typically have built-in ESD protection diodes. These components clamp the voltage to prevent damage but are sensitive to overcurrent. Therefore, external current-limiting resistors are generally required in hardware design, as shown in the figure below:

Why Can MCU Pins Only Recognize Voltage Signals?

Impedance Matching:

A high input impedance voltage detection circuit can reduce the loading effect on the signal source. However, directly detecting current may interfere with external circuits.

4. Types of Signals in Practical Applications

Sensor Interfaces:

Most sensors (such as temperature/humidity/light/weight sensors) output analog voltage signals. If current signals need to be processed, such as the common 4-20mA industrial standard, they must be converted to voltage using precision resistors before being input to the MCU, or an external ADC chip can be used to read the voltage signal, with the MCU reading ADC data via SPI bus, etc. Some ADC chips have very high integration, eliminating the need for complex external comparator hardware circuits. Those interested in such integrated solutions can look into them, as shown in the figure below:

Why Can MCU Pins Only Recognize Voltage Signals?

Analog Input:

ADC (Analog-to-Digital Converter) pins also detect voltage signals; current signals must first be converted to voltage signals.

There is a concept of analog voltage and digital voltage, but it seems there is no concept of analog current and digital current.

5. Power Consumption and Integration

Low Power Design:

Voltage detection circuits have very low power consumption, suitable for battery-powered scenarios; directly measuring current may require additional circuitry, increasing power consumption and chip complexity.

Integration Limitations:

MCU processes focus on high-density digital circuits, integrating current detection modules (such as current mirrors) would occupy more silicon area, increasing chip costs.

The author has elaborated on several reasons why MCU pins can only recognize voltage signals. I hope this article can be helpful to everyone.

Why Can MCU Pins Only Recognize Voltage Signals?

END

Author:dffzh

Source:21ic ForumRecommended ReadingWhy is C++ Rarely Used in Microcontroller Development?5 Recommended Lightweight Microcontroller File SystemsCrash! Another Case of Microcontroller Freezing→ Follow for More Updates ←

Leave a Comment