STC12C5A60S2 MCU IO port working mode setting
All I/O ports of STC12C5A60S2 series MCU can be configured by software into one of four working types. The four types are: quasi-bidirectional port (standard 8051 output mode), push-pull output, input only (high impedance) or open-drain output function.
I/O port working type setting
PxM1[7:0]
Note:
Although each I/O port can withstand 20mA sink current in weak pull-up (current limiting resistors such as 1K, 560Ω, etc.) and can output 20mA source current in strong push-pull output (current limiting resistors are also required), the recommended operating current of the entire chip should not exceed 55mA. That is, the current flowing in from MCU-VCC should not exceed 55mA, the current flowing out from MCU-GND should not exceed 55mA, and the overall inflow/outflow current should not exceed 55mA.
Here is a macro definition: _BIN
is used to assign a value to each bit of the register. For example:
assigns 1 to the 7th and 3rd bits of the ADC_CONTR register, and the other bits are 0. The parameters in brackets are bits 7 to 0.
In the TF card program, if the SPI port is set to push-pull (strong pull-up) output, you can write it like this:
Previous article:Liujing MCU Bidirectional Thyristor Interface MDK160
Next article:C language program for I2C communication
Recommended ReadingLatest update time:2024-11-15 07:54
- Popular Resources
- Popular amplifiers
- Automatic identification of garbage trucks
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- Single-chip microcomputer C language programming and simulation
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- 【McQueen Trial】+Motor Control+RGB Color Breathing Light
- Misalignment issues between 3D packaging and planar packaging
- Storage DDR SAMSUNG MICRON
- [Review of SGP40] + Testing the sensor I2C communication with Arduino
- Analysis of the causes of high temperature failure of DCDC power modules
- Combining 51 code to analyze the programming ideas of RFID card reader
- X-NUCLEO-IKS01A3 sensor driver transplantation based on STM8S-DISCOVERY
- TMDSEVM572X development board link emulator
- [Sipeed LicheeRV 86 Panel Review] 3-System Burn-in Test
- [AB32VG1 development board review] OLED screen display driver