1. IO input design skills
01: Resistors or capacitors should be reserved on the lines that are prone to ESD intrusion, such as key input ports. If necessary, add components to enhance the system's ability to resist ESD.
02: Set the internal pull-up resistor of the chip to prevent signal detection errors during suspension;
03: In a high anti-interference environment, try not to use external interrupt detection signals, and use the query method.
2. IO output design skills
01: Loads with high noise should be designed with optocoupler isolation and noise absorption circuits;
02: When using dangerous loads, software pulse drive can be considered through capacitive coupling;
Through C1, the transistor can be automatically shut down when the MCU crashes.
03: The load should consider the driving capability of the chip output port, the driving current should not be too large, and the pull current and sink current of the entire MCU should be considered;
It is recommended that the value of R2 should not be less than 330 ohms.
04: Hardware protection should be considered when driving components such as motors. When the microcontroller is reset, the transistor can be automatically turned off using resistor R3.
3. IO level matching design
01: Level matching issues usually need to be paid attention to during data communication. If the operating voltages of the two communicating microcontrollers are different, the level conversion issue needs to be considered.
02: The traditional way of level conversion is to convert through components such as diodes, transistors or optocouplers, or it can be converted through dedicated level conversion chips.
4. Design in IO sleep mode
01: Unused IO
A: Set to output mode
( 1) Set the output low level. It is recommended to connect the IO to VSS during PCB design.
( 2) Set the output high level. It is recommended to connect the IO to VDD during PCB design.
B: Set to input mode
( 1) When the internal pull-up resistor is not enabled, it is recommended to connect the IO to VSS or VDD during PCB design;
( 2) When the internal pull-up resistor is enabled, you can leave it unconnected or connect the IO to VDD during PCB design.
02: Input port
Please enable the pull-up resistor and do not make the IO high-impedance state.
The internal pull-up resistor is a MOS tube structure, and enabling it will not increase the power consumption of the microcontroller.
03: Output port
Do not allow external circuits to leak.
丨The article is organized to spread relevant technologies, the copyright belongs to the original author丨
丨If there is any infringement, please contact us to delete丨
|