51 MCU memory

Publisher:blazingsLatest update time:2022-04-20 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

51 single chip microcomputer structure:

Thinking structure is important:

insert image description here

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:

insert image description here

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.

insert image description here

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:

insert image description here

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:

insert image description here

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:

insert image description here

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

Reference address:51 MCU memory

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

Android 11 is now available on x86 PCs: no problem for old machines with 2G memory
       The Android x86 project has finally been upgraded to the underlying Android 11.   This innovation has been achieved in the latest Bliss OS 14 version. Of course, the version is currently in the development stage and there is still a lot of work to be done.   Bliss OS is built based on native Android 11, but man
[Mobile phone portable]
s3c2440 memory controller and SDRAM basic test
In the LED and serial port programs we experimented with earlier, the CPU sent the address to a specific register and wrote the corresponding bits in the register to meet the control requirements. The first type is GPIO gate circuits such as LEDs, and the second type is protocol types such as serial ports. These are
[Microcontroller]
s3c2440 memory controller and SDRAM basic test
ARM bare metal development bootloader memory initialization
1. Looking at memory from the inside Memory has become an indispensable component of PCs and embedded devices due to its fast access speed and simple access method. 1. Classification of memory Memory is divided into DRAM and SRAM, among which DRAM includes SDRAM, DDR, and DDR2. DRAM: Its basic component is a sma
[Microcontroller]
ARM bare metal development bootloader memory initialization
OK6410A Development Board (VIII) 100 linux-5.11 OK6410A Kernel Space Virtual Memory Layout
Physical Memory The physical memory may be large or small (256M or 512M or 1G or 2G or 4G), here we take PHY_MAX Here https://blog.csdn.net/u011011827/article/details/117413163 "Should arm32 configure CONFIG_HIGHMEM" tells ARM physical memory configuration required in different situations If we want to configure h
[Microcontroller]
Samsung's first-quarter earnings remain unchanged despite sluggish memory demand and consumer electronics market
According to foreign media reports, Samsung's consumer electronics sales have been weakened by the global epidemic. At the same time, driven by the epidemic, the demand for home schooling and office work has surged, stimulating the growth of Samsung's memory chip demand. Under these combined effects, Samsung's first-q
[Mobile phone portable]
Memory Unit and Bit Address in C51
The RAM in the microcontroller is composed of 8 bits per unit, that is, each 8-bit binary number is a storage unit. The RAM has a total of 256 such storage units. The first 128 units are general storage units, and the last 128 units are special function registers. Each storage unit is like a house, and the rooms in
[Microcontroller]
OPPO Reno5 5G two models now available on the benchmark platform: both equipped with 8GB RAM
OPPO is expected to launch the Reno5 series of smartphones in China soon. According to previous reports, the series may have three models and use different chips from Qualcomm and MediaTek. Now, two of them have been spotted on Geekbench. Foreign media exposed the Geekbench listing of the upcoming OPPO Reno5 series
[Mobile phone portable]
The purpose of RAM in microcontroller
A single-chip microcomputer is a small computer. Although a flea is small, it has all the organs and can even jump very high! Naturally, a data storage system is indispensable for a large computer, and a small single-chip microcomputer also has it, and it is often integrated with the CPU, making it more compact and fl
[Microcontroller]

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
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号