1. Introduction
This is the test circuit board made for the STM32 microcontroller. The main purpose is to verify whether the software development tools are functioning normally in the newly installed computer. The microcontroller software can now be downloaded via probe clips. Below, using this test circuit board, we will perform a hazardous measurement. We will measure the output current of the STM32 I/O ports. A total of six I/O ports from PB3 to PB7 are guided to the external breadboard via pin headers. Let’s directly measure how much short-circuit current can be output to ground after these ports are set to high and low levels.

2. Measurement Results
Using software, we set PB7 as the output pin and set it to high level. Now let’s measure the change in the microcontroller’s operating current at this time. When the output pin is floating, the microcontroller’s operating current is 32mA. Connecting this pin to ground, we can see that the microcontroller’s operating current rises to 82mA. The additional 50mA is the current output from the I/O port. Although the high level output from the microcontroller’s I/O port is forcibly pulled down to ground, the microcontroller still operates very happily. The surface temperature does not increase much; it seems that the short circuit of the port is just a piece of cake for it.


Don’t blame me for being ruthless; let’s continue to increase the output ports. We will increase the output ports to two, both set to high-level output and forcibly pulled down to 0V. At this time, the microcontroller’s operating current changes to 125mA. This should be an additional 40mA. Increasing the ports to three, the operating current changes to 168mA. Four I/O ports short-circuited to ground, the current changes to 204mA. Five I/O ports short-circuited to ground, the operating current changes to 237mA. Six I/O ports short-circuited to ground, the operating current changes to 274mA. Since I only brought out six I/O ports, this test can only stop here.

Number of Short-Circuited I/O Ports | Operating Current (mA) |
---|---|
1 | 85 |
2 | 125 |
3 | 168 |
4 | 204 |
5 | 237 |
6 | 274 |
With six I/O ports outputting high level and short-circuited to ground, the microcontroller is now functioning normally. However, the temperature has increased a bit. From the test data, it can be seen that the short-circuit current for each I/O port is about 40mA.

Next, let’s test the situation of low-level short circuit. Set all six I/O ports to low-level output. Then connect them all to the 3.3V power supply. The microcontroller’s operating current increases to 240mA, which is 30mA less than the previous 274mA for short-circuiting to ground. It can be seen that the microcontroller can still operate normally, and the temperature has also increased. Through this test, it can be seen that the microcontroller’s output I/O ports have current limiting protection for general short circuits.

Conclusion
This article tested the short circuit situation of the STM32 microcontroller’s I/O ports. Short circuiting high level to ground and low level to power supply results in a short-circuit current of about 40mA. Even with six ports short-circuited simultaneously, the microcontroller can still function happily.
Test Circuit Board for STM32 Microcontroller: https://blog.csdn.net/zhuoqingjoking97298/article/details/135913547?csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22135913547%22%2C%22source%22%3A%22zhuoqingjoking97298%22%7D
[2]Setting External Editor for EWARM IDE: https://zhuoqing.blog.csdn.net/article/details/135918525