Share this

A Brief Discussion on the Usage of Special I/O IO in STC Microcontrollers

2026-04-06 03:30:01 · · #1

Under normal circumstances, after power-on reset, all I/O ports of the 51 microcontroller are at a high level by default and operate in quasi-bidirectional I/O mode. However, microcontrollers from the STC15 series onwards have four operating modes for I/O. An I/O with multiplexing function will not be in quasi-bidirectional I/O mode after power-on reset. We need to pay more attention to these pins when using them.

1. PWM-related pins

In the STC15 series microcontrollers, the 12 IOs related to PWM2 to PWM7 are in high-impedance input mode by default after power-on reset. When external output is required, the user needs to set them to push-pull output or quasi-bidirectional IO mode through the program.

In the STC8 series microcontrollers, all PWM-related I/Os are in quasi-bidirectional I/O mode after reset. Users can choose to set them to open-drain output mode when programming (downloading) the program through ISP software. Similarly, users can also set them to the desired working mode through the program.

2. Low voltage reset pin P2.0

In the STC15 series microcontrollers, the low-voltage reset pin RSTOUT_LOW is mostly located on pin P2.0, while a few models have it on pins P1.0 and P3.3. The user can select whether this pin is high or low during ISP programming (programming). When the microcontroller's supply voltage is lower than the threshold voltage (around 1.8V for 3V microcontrollers and around 3.2V for 5V microcontrollers), the RSTOUT_LOW pin will output a low level; when the supply voltage is higher than the threshold voltage, the RSTOUT_LOW pin will output the level set by the user during ISP programming (programming).

In the STC8 series microcontrollers, the low-voltage reset pin (RSTCV) is located on pin P2.0. The initial power-on reset level can be set by the user during ISP programming (programming). When the microcontroller's supply voltage is below 1.6V, the microcontroller will output a high level on pin P2.0/RSTCV. Only when the microcontroller's supply voltage rises above 1.6V will the microcontroller output the user-set level on pin P2.0/RSTCV during ISP programming (programming).

3. Reset pin RST

In the STC15 series microcontrollers, the reset pin (RST) varies depending on the specific model. In the STC15 series, the reset pin can be used as a general-purpose I/O port. Users can configure the function of the RST pin during ISP programming (programming via I/O). When configured as a general-purpose I/O port, the reset pin will be set to quasi-bidirectional I/O mode after power-on reset. The microcontroller identifies the user's settings for the RST pin during the previous ISP programming (programming) and then adjusts the RST reset pin accordingly.

4. XTAL1 and XTAL2 pins

In the STC15 series microcontrollers, the XTAL1 and XTAL2 pins are located on pins P1.7 and P16 by default. These two pins are not necessarily in quasi-bidirectional I/O mode after power-on reset. When these pins are used as clock inputs or crystal oscillator connection pins, they are in high-impedance input mode. This can be determined by whether the user selected the internal IRC clock during ISP programming (downloading). Upon power-on, the microcontroller sets these two pins to high-impedance input mode and then checks whether the user selected the internal IRC clock during the previous ISP programming (downloading) process. If the user selected the internal IRC clock, the microcontroller will set this I/O to quasi-bidirectional I/O mode. If the user did not select the internal clock, the microcontroller will retain the initially set high-impedance input mode.

Note: Incorrect selection here will result in the inability to download the program. For example, if the user selects not to use the internal IRC clock, but there is no crystal oscillator or clock source connected to the two external clock pins of the microcontroller, the download will fail.

Since the STC8 microcontroller does not require an external reset or external crystal oscillator, the reset and clock pins will not present any special issues for the STC8 series. In fact, the STC8 series does not have a dedicated external reset pin, but it does have an external clock pin. The STC8 has three clock source selections, internally using clock source selection registers, clock control registers, and other clock-related registers for selection and control. Therefore, there will be no special issues with the clock pins, and we have not discussed them here.

Disclaimer: This article is a reprint. If there are any copyright issues, please contact us promptly for deletion (QQ: 2737591964). We apologize for any inconvenience.

Read next

CATDOLL 123CM Momoko (TPE Body with Soft Silicone Head)

Height: 123cm Weight: 23kg Shoulder Width: 32cm Bust/Waist/Hip: 61/54/70cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22