Using atmel company: AT89S52
Use the burning tool: progisp
Writing tool: Keil uVision
Development board used: Sirius TLX-1C development board
The subsequent codes have been packaged: https://download.csdn.net/download/f_zmmfs/10560847 (delete for infringement)
structure:
It integrates an 8-bit CPU, 4K bytes of ROM, 128 bytes of RAM, four 8-bit parallel I/O ports, a full-duplex serial port, two 16-bit timers/counters, and five interrupt sources.
CPU: Consists of calculation and control logic, as well as an interrupt system and some external special function registers
RAM: used to store data that can be read and written, such as intermediate results of calculations, final results, and data to be displayed; (non-memory)
ROM: used to store programs, some original data and tables;
I/O port: Four 8-bit parallel I/O ports, which can be used as both input and output;
T/C: Two timers/counters, which can work in both timing mode and counting mode;
Interrupt control system for five interrupt sources
A full-duplex UART (Universal Asynchronous Receiver Transmitter) serial I/O port for serial communication between MCUs or between MCU and microcomputer;
The oscillator and clock generation circuit are built in, and the quartz crystal and fine-tuning capacitor need to be connected externally. The maximum oscillation frequency depends on the model and performance of the microcontroller.
Level:
Two levels of digital circuits: 0 1
TTL level: 1——+5v 0——0v (for microcontroller)
RS232 level: 1——+12v 0——-12v (for computer serial port)
Therefore, the communication between the computer and the microcontroller requires the addition of a level conversion chip max232
Common data types:
Special data types:
Common header files:
Usually there are:
reg51.h reg52.h math.h ctype.h stdio.h stdlib.h absacc.h
reg51.h reg52.h (define special function registers and bit registers);
math.h (defines common mathematical operations)
Common bit operations:
>> << (bit shift right bit shift left)
& | (bitwise AND bitwise OR)
^ ~ (bitwise exclusive or bitwise inversion)
Summarize:
Steps for MCU development:
1. Analyze and implement functions: split the functions into modules to implement them - what chip to use
2. Analyze the chip: study the chip manual and understand how to use the chip (parameters, key points of operation, timing diagram, examples) - how to use the chip
3. Combination chip: connect the chip to the MCU according to a certain logic, construct a complex circuit (already constructed MCU development board) - put the chips together
4. Analyze the pin diagram: Construct the information interaction logic between the MCU IO and the chip (development board schematic diagram) - study the combination principle
5. Code implementation: Control IO ports to achieve data interaction - write down your ideas
Previous article:[C51 self-study notes] Flashing light + running light (four methods) + 74HC573 chip + keil4 software simulation (debug)
Next article:[C51 Getting Started Notes] Single Bus Protocol + DS18B20
- Popular Resources
- Popular amplifiers
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
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- What should I do if the current of the small motor is too large when it starts and the microcontroller is reset?
- MSP430 driver function for LCD1602
- Watch the video to win a JD card | Taixiang test of Shuige cheats
- The motor coil is an inductive load, so the current in the coil will have a certain delay relative to the load voltage on the coil.
- Summary of national competition experience sharing
- How to understand the equivalent of capacitors passing AC
- [NXP Rapid IoT Review] +6. Guide to Translation Display Elements
- MicroPython driver porting for STTS751
- Please recommend a PAL video signal equalization chip or amplifier chip
- [RVB2601 creative application development] SVM40 UART communication implementation