STC8A8K64D4 Series Manual
-
9.5 A Typical Circuit Controlled by Triode
I/O Pin
R2
15K (3.3K~15K)
10K(3.3K~10K)
R1
R3
VCC
VCC
For pull-up control, it is recommended to add a pull-up resistor R1 (3.3K 10K). If pull-up resistor R1 (3.3K 10K) is not
connected, it is recommended that the value of R2 be above 15K, or use strong push-pull output mode.
9.6 Typical Control Circuit of LED
For Quasi-Bidirectional (weak pull-up) I/O, you can drive the light-emitting diode using sink current mode, where the current
limiting resistance should be greater than 1K oms, preferably not less than 470Ω.
For push-pull (strong pull-up ) I/O, you can drive the light-emitting diode with pull current mode.
9.7 Interconnection of 3V/5V Devices in Mixed Voltage Power Supply
System
When STC's 5V microcontroller is connected to a 3.3V device, the corresponding I/O port of the 5V microcontroller can be
connected with a 330Ω current limiting resistor to the 3.3V device I/O port in order to prevent the 3.3V device from withstanding
5V. The I/O port of the microcontroller is set to open-drain mode, and the internal pull-up resistor is disconnected. The corresponding
3.3V device I/O port is connected to 3.3V via with a 10K pull-up resistor. Then the high level is 3.3V, and the low level is 0V.
330
10K
3.3V
3.3V
device
I/O Pin
5V
microcontroller
I/O Pin
When STC's 3V microcontroller is connected to a 5V device and the corresponding I/O port is used as an input, an isolation
diode can be connected in series to the I/O port to isolate the high voltage part in order to prevent the 3V microcontroller from
bearing 5V. When the external signal voltage is higher than the microcontroller operating voltage, the isolation diode will cutoff,
the state of the read I/O port is high because the I/O port is pulled up to a high level internally. When the external signal voltage is
low, the isolation diode will turn on and the I/O port is clamped at 0.7V. The microcontroller reads I/O port low status as the voltage
is less than 0.8V.
External
input
signal
Microcontroller
I/O Pin
When STC's 3V microcontroller is connected to a 5V device and the corresponding I/O port is used as an output, it can be
isolated with an NPN transistor in order to prevent the 3V microcontroller from bearing 5V. The circuit is as follows.