51 single chip microcomputer structure:
Thinking structure is important:
As can be seen from the figure above, the memory of the 51 microcontroller is divided into two parts: program memory ROM and data memory RAM, which is different from the computer
Program Memory ROM:
1. Program memory ROM, as the name implies, is where programs are stored. Program instructions guide the microcontroller to complete the set functions.
2. The 51 MCU has a 16-bit PC to indicate the location of the program instruction that the CPU will execute next time in the ROM. Since the PC pointer is 16 bits long, the size of the MCU's program memory ROM is 2^16 = 64Kb, from 0000 to FFFFH.
3. ROM can also be divided into on-chip ROM and off-chip ROM
On-chip ROM:
The 8051 chip has 4KB of ROM, with an address range from 0000H to 0FFFH.
Off-chip ROM:
Externally expandable, generally from 1000H to FFFFH, 64KB
PS: So the question is, how does the 51 microcontroller distinguish between internal ROM and external ROM?
The distinction between on-chip ROM and off-chip ROM:
When the microcontroller has both on-chip ROM and off-chip ROM, some duplicate address ranges will be generated.
In order to solve the problem of distinguishing between on-chip and off-chip ROM, the 51 microcontroller sets a control line EA (low level is valid), so
EA = 0 => valid => access to on-chip memory
EA = 1 => Invalid => On-chip memory is ignored
The essential principle:
That is, when the value of PC is greater than a certain value, the external memory will be accessed, and when the value of PC is less than a certain value, the internal memory will be accessed. This value is determined by the size of the memory capacity. In the 8051 microcontroller, the on-chip ROM = 4KB, so when PC is less than 0FFFH, the on-chip ROM is accessed.
Specific implementation process:
When EA = 0, access the external ROM directly from 0000H without hesitation
When EA = 1, PC starts accessing the on-chip ROM from 0000H. When PC is greater than 0FFFH, it switches to accessing the off-chip ROM, as shown in the figure:
There are 7 special addresses in the program memory ROM:
That is, the entry addresses of 7 external interrupts, each address is separated by 8 address units, which is obviously not enough to store the terminal service program, so jump instructions are generally stored in these 7 special addresses to jump to the corresponding interrupt service program.
Data Memory RAM:
1. RAM memory generally stores data needed during the operation of the microcontroller and temporarily generated data, and needs to be able to read and write quickly. It will be lost when power is off.
2. Like ROM, RAM is also divided into on-chip RAM and off-chip RAM
On-chip RAM:
1. 00H~1FH: working register area, also known as general register, 32 bytes, 8 bytes per group, total 4 groups.
In the special function register chapter, the RS0 and RS1 bits of the flag register PSW are used to select one of the four groups of registers to work, that is, one of the groups in this position is selected.
2. 20H~2FH: Bit addressing area, 16 bytes, 128 bits. The 128 bits in this address space can be accessed bit by bit. Each bit has an address. The addressing space is 00H ~ 7FH, as shown in the figure:
In the 20H~2FH space, each bit address is reassigned an address 00H ~ 7FH, thereby achieving bit-by-bit access.
3. General RAM area: also known as user RAM area, 80 bytes, for 52 series, generally from 30H to FFH for user use, the unused address units in the first two areas can also be used as user units
4. Stack area and stack pointer
It is usually set after the 2FH unit, avoiding the working register area and the bit addressing area. The typical application is the sub-function call:
Off-chip RAM:
Similar to ROM, RAM can be expanded through an external bus to obtain a larger storage space. Since the external bus width is 16 bits, the maximum external expansion is 64KB, and the address range is 0000H~FFFFH
Previous article:51 single chip microcomputer C51 program
Next article:51 single chip microcomputer working cycle and timing
Recommended ReadingLatest update time:2024-11-23 16:15
Recommended posts
- Add pet interaction to BL808 (realize picture rotation, picture coloring, screen touch function)
- RememberwhenwementionedLVGLinthepreviousarticles,wementionedthatwheninitializing,inadditiontoinitializingthedisplayoutput(lv_port_disp_init();),wealsomentionedinitializingtheinputfunction(lv_port_indev_init();).Inthis
- tobot Domestic Chip Exchange
- The magnetic field formed by a wire in a vacuum
- TheformulaB=μHcanbefoundinvariousmaterials,butthecalculationrelationshipbetweenthecurrentofasingleidealwireinavacuumandH(magneticfieldstrength)cannotbefound.Somepeoplemaysay:Ithassomethingtodowiththeinducta
- bigbat Switching Power Supply Study Group
- Which one has faster sampling speed, ADS1220 or AD7799?
- Cananyonetellmewhichonehasfastersamplingrate,ADS1220orAD7799?Thankyou! "Whichonesamplesfaster,theADS1220ortheAD7799?" Can'tIfindthesetwotypesofchipsinthedatasheet? I'manewbieandIdon'tknowhowtoseeit.
- chenbingjy Analog electronics
- UTC time zone conversion of single chip microcomputer
- 1.Background IhavedoneaprojectonSTM32low-powersignalacquisitionbefore,usingtheSTM32L031microcontroller.Theprojectrequirementsareasfollows: Thedeviceispoweredbyabattery,detects
- fish001 Microcontroller MCU
- Automotive Ethernet (2nd) from BMW Kirsten Matheus
- Background Recently,IwasfortunatetoparticipateinasurveyonthecurrentstatusanddevelopmenttrendsofautomotiveEthernet.Iwasveryfortunatetoreadthearticlefrom JilinUniversityMaster'sReviewPaper,learn
- rockafe3in1 Automotive Electronics
- Ek314 How to upgrade Ubuntu 12.04 to 14.04?
- ,Helvetica,SimSun,sans-serif]Afriendasked:Afterbooting,apromptappears:DoyouwanttoupgradetoUbuntu14.04?AfterclickingUpgrade,apromptappearswhenproceedingtothesecondstep:W:Failedtofetchhttp://ports.ubuntu.com/di
- myzrcherry Industrial Control Electronics
- Popular Resources
- Popular amplifiers
- 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
- Preprocessing Design of Intelligent Vehicle Path Image Recognition Based on FPGA
- CC4035-4-bit shift register
- EEWORLD University - Using the 75 W TAS6424-Q1 Class D Audio Amplifier for DC and AC Load Diagnostics
- 【Mil MYS-8MMX】Part 3: Bluetooth scanning and connection
- Xilinx FPGA configuration design.pdf
- Regarding the low power consumption problem of the domestic MCU HC32L110, please give me some advice.
- EEWORLD University Hall----Live playback: High-performance i.MX RT processors help smart nodes achieve machine learning without Internet access
- Install Firefox on Ubuntu system of Xunwei 3399 development board
- Help, failed to create new IP core
- Take a look at the $1.95 million Bugatti pool table: it uses a gyroscopic servo leveling system and is as stable as an old dog on the boat