Introduction: 51 MCU is a general term for all MCUs compatible with Intel 8031 instruction system. The ancestor of this series of MCUs is Intel's 8031 MCU. Later, with the development of Flash ROM technology, 8031 MCU has made great progress and become one of the most widely used 8-bit MCUs.
1. Circuit Diagram
The current that needs to flow through a diode to light up is generally 3mA~10mA, and the voltage drop across the diode is 1.6V~1.7V.
2. Light up the diode:
(1) Bit operation: sbit led0=P0^0; led0=0; //Assignment of a single bit
(2) Bus operation: P0=0xfe; //11111110 The entire 8-bit pin is assigned a value
3. Software simulation:
Click the d icon on the toolbar, double-click a line to set a breakpoint; if you want to use software simulation to view the execution time of a statement, you must set the crystal frequency to the same frequency as the MCU in Options for target -> target -> Xtal (MHz). (Machine cycle = 12* crystal cycle = 12* system clock cycle, the higher the crystal frequency, the faster the MCU executes. The frequency of 11.0592M is generally used for serial communication between MCUs and MCUs or hosts)
4. When the EA pin 31 of the 51 single-chip microcomputer is connected to a high level, instructions are read from the on-chip memory for execution; when the level is low, the off-chip memory is read.
5. In the 51 single-chip microcomputer, P1, P2, and P3 all have pull-up resistors, but P0 does not. Therefore, if you want to use P0 as a normal I/O port, you need to add a pull-up resistor (such as a resistor array).
6. After some compilers are completed, they will automatically loop the program you wrote in an infinite loop. If you want the program to stop after a certain statement, just add "while (1);" after the statement.
7. #include the function _crol(k, 1) for shifting /*Assume k is 11111110, after the function is executed, k is 11111101*/.
8. After the 51 microcontroller is powered on, the default I/O port state is high level.
Previous article:Capacitive sensor measurement system module circuit design square wave generation circuit
Next article:51 MCU IO port input and output mode
- Popular Resources
- Popular amplifiers
- Learn ARM development(14)
- Learn ARM development(15)
- 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)
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
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- High frequency induction welding system based on GD32
- 5 Key Considerations for IoT Devices
- Developing Keil MDK-ARM Projects with VisualGDB
- [Sipeed LicheeRV 86 Panel Review] 5-Porting Python3 to the Development Board
- GD32F103RC burning problem
- How much processor overhead does Tracealyzer require to trace an RTOS?
- [RVB2601 Creative Application Development] Environmental Monitoring Terminal 03-Using LVGL to Design the Interface
- Weekly evaluation information delivered to you, keep up to date with new evaluation trends!
- Why does the value of the ad7747 ready register remain unchanged?
- Advantages of Integrated Current Sensing