当前位置:网站首页>Circuit structure and output mode of GPIO port of 32-bit single chip microcomputer
Circuit structure and output mode of GPIO port of 32-bit single chip microcomputer
2022-07-23 16:32:00 【Taro Salsa】
Or take Huada 32 Bit MCU to explain , In fact, everyone is generally the same structure

Above device analysis :
1、 Protection diode : prevent I/O Pin outside too high 、 Low voltage input , Prevent abnormal voltage from being introduced into the chip and causing the chip to burn . See the previous article for details
2、 switch : The switch is TTL Schottky trigger , Convert an analog signal to 0 and 1 The digital signal of , But when GPIO As ADC When collecting voltage channel , At this time, the signal does not go through the trigger TTL Level conversion .
3、P-MOS、N-MOS: The unit circuit makes GPIO have “ Push pull output ” and “ Open drain output ” The function of
4 Input mode
32 With floating input 、 Pull up input 、 Pull down inputs and analog inputs 4 Input mode .
Floating input mode ,I/O The level signal of the port is determined by the external input , The level state is uncertain , Floating input is usually used to configure USART Of RX Pin , As shown in the figure below :

Pull up input mode ,I/O The port level state remains high , When the input power is low , The level state changes to low level , Finally enter the input data register , As shown in the figure below :

Drop down input mode ,I The level state remains low , When the input power is high , The level status changes from white to high , Finally enter the input data register , As shown in the figure below :

Analog input mode ,I/O Analog signal of the port ( Voltage signal , Not the level signal ) Direct analog input to on-chip peripheral modules , such as ADC Module etc. . Analog inputs are usually used for ADC Analog input , Or low power consumption, power saving, etc , As shown in the figure below :

4 Output mode
Open drain output mode , Set by configuration / Reset register or output data register value , control N-MOS tube , Output to I/O port . Open drain output can only output strong low level , The high level depends on the external resistance ,

Push pull output mode , Set by configuration / Reset register or output data register value , control P-MOS Tube and N-MOS tube , Output to I/O port . Push pull output can be strong 、 Low level , As shown in the figure below :

Multiplexing function open drain output mode 、 The principle of push-pull output mode and open drain output mode of multiplexing function 、 Push pull output mode principle is basically the same , It's just decided by using the multiplexing function output of on-chip peripheral modules ( communication interface (SPI,UART,I 2 C,USB,CAN,LCD etc. )、 Timer 、 Reuse of debugging interface, etc ). Multiplexing function open drain output is usually used for TX1、MOSI、MISO Wait for pin configuration , Push pull output of multiplexing function is usually used for I2C Of SCL、SDA.
Be careful : Know everything GPIO After function , For application scenarios, we should learn to judge when to use what mode , It's worth noting that , For low-power scenarios , We can put IO Configured as analog input , Avoid current leakage
边栏推荐
猜你喜欢

vulnstack红日-4

7月HCIP Datacom认证考试通过

Another award | opensca was selected as the "top ten open source software products in the world" at the China Software Expo

Esp8266 nodemcu flash file system (spiffs)

MySQL - six logs

锁相环工作原理,比如我们8MHZ晶振如何让MCU工作在48MHZ或者72MHZ呢

20220721 beaten content

ESP8266-NodeMCU——从苏宁API获取实时天气

20220721挨揍内容

FPGA-HLS-乘法器(流水线对比普通仿真)
随机推荐
反转链表画图演示
MySQL multi table query_ Cartesian product_ Inner connection_ Implicit connection
MySQL - six logs
Oralce中实现将指定列的指定内容替换为想要的内容
pytest接口自动化测试框架 | 控制测试用例执行
快递单证智能OCR识别,助力物流行业数字化升级
锁相环工作原理,比如我们8MHZ晶振如何让MCU工作在48MHZ或者72MHZ呢
Why build a uilabel? (review liangya Technology)
华为新版Datacom认证介绍
Flutter 组件的生命周期、State 管理及局部重绘 | 开发者说·DTalk
Une solution complète au problème du sac à dos dans la programmation dynamique
[2023 approved in advance] BOE
PgSQL mistakenly deletes PG_ Wal file, service startup failed
Go 接口:深入内部原理
AC自动机和Fail树
Cover - computer knowledge guide
大端模式和小端模式的记忆方法
腾讯云获国际专业流媒体测评肯定:三大场景下视频编码性能全部最优
STM32F103+RFID-RC522模块 实现简单读卡写卡demo「建议收藏」
Esp8266 nodemcu flash file system (spiffs)