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-23 08:05
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- It is found that domestic manufacturers like to polish the logo and model outside the chip.
- Registration for the 2021 STM32 Summit and Fan Carnival online live broadcast has begun!
- BleuNRG-1 one master and multiple slaves master module search interval setting
- How to use iic to make LCD screen display
- Design of MSP430 and MMC/SD card interface
- An Engineer's Guide to Temperature Sensing
- Analysis of Rectification Circuit and Filter Circuit
- Learn more about logic analyzers
- What is the status of lithium battery?
- Method for testing FPGA logic unit based on BIST using ORCA structure