51 MCU storage program and data

Beginner 51 always has such a question, after downloading the program from the computer to the development board, where is the program going? In C51, where are the users or applications, system programs and data stored?

51 single-chip microcomputer from the physical structure, can be divided into on-chip, off-chip program memory, on-chip off-chip data memory.

51 MCU function, there are program memory, on-chip data memory, special function registers, bit address space, off-chip data memory.

Program memory

The program memory of the 51 MCU is used to store code and some fixed table constants.
The addressable program memory space is 64KB.

From the physical point of view, the 51 single-chip microcomputer can be divided into: on-chip, off-chip program memory, as the addressing space, the addressing rules are: first in the slice, outside the slice, the slice is continuous outside the slice, and does not overlap.
Figure: Addressing program for 51 MCU program memory.

51 MCU storage program and data

How does the microcontroller execute the instructions?
Figure:

51 MCU storage program and data

Their addresses are shared regardless of on-chip program memory or off-chip program memory. If the 4KROM is on-chip, the address is 0x0000-0x0FFF, and the address space of the external ROM is from 0x1000-0xFFFF. Whether this part of 0x0000-0x0FFF of the external ROM can be used depends on the level value of the EA pin of the microcontroller. When EA=1, this part of the internal ROM is used. This part of the external ROM is wasted; when EA=0, this part of the external ROM is used, and the internal ROM is wasted. To read data from the CODE segment, use the assembled MOVC instruction. The MCU will automatically determine from which memory to fetch data based on the MOVC instruction, the EA state, and the address value to be read.

The program address space can generally be arranged and used according to the user's needs, but the cpu executes the entry address of the special program, and the user must store the corresponding program according to the regulations.
The special program entry address is as follows:

51 MCU storage program and data

Data memory

The internal and external data memory of the 51 MCU is two independent address spaces and should be addressed separately.
On-chip data memory address space "00H-FFH", RAM address space "00H-7FH" special function register SFR address space "80H-FFH"
Off-chip data memory address space "0000H-FFFFH"
Figure:

51 MCU storage program and data

In order to make the storage space of the on-chip data memory reasonably, different functional areas are divided for the low 128-byte RAM.
Figure:

51 MCU storage program and data

51 MCU storage program and data

Bit addressing area, address space 20H-2FH, 16 units, a total of 128 bits.

Data buffer, address space 30H-7FH, a total of 80 units.

Clamped Pneumatic Mixer

Pneumatic Paint Mixer,Clamped Pneumatic Mixer,Pneumatic Mixing Paint Mixer,Clamping Bucket Air Mixer

RUDONG HONGXIN MACHINERY CO.,LTD , https://www.rdhxmfr.com

This entry was posted in on