Our Latest News

Selection of on-chip and off-chip program memory for 80C51 microcontrollers

Most of the 51 series microcontrollers are equipped with a certain amount of program memory ROM, such as the 80C51 chip with 4KB mask ROM memory unit, and the AT89C51 chip with 4KB Flash ROM, both of which have an address range of 0000H~0FFFH.

ROM can be used to store fixed programs or data, such as system monitoring programs, constant tables, etc.

Selection of on-chip and off-chip program memory

The program counter PC of 80C51 is a 16-bit counter, so it can address any cell of 64KB ROM.

1.~EA pin is connected high

~When the content of PC exceeds 0FFFH (4K), the system will automatically switch to off-chip program memory to take instructions, and the address of external program memory will be addressed from 1000H.

2.~EA pin is low

When ~EA pin is connected low, the microcontroller automatically goes to off-chip program memory to fetch instructions (regardless of whether there is program memory inside the chip or not), and the address of external program memory is addressed from 0000H.

A few special cells of program memory

Some addresses at the low end of the program memory are fixed for specific entry addresses, as shown below.

One special group of cells is 0000H~0002H. After system reset, PC=0000H, the microcontroller starts executing the program from 0000H cell.

If it does not start from 0000H, it has to store an unconditional transfer instruction in these 3 cells in order to go to the execution of the specified application.

In addition, there are entry addresses for each interrupt source in program memory, which are assigned as follows.

0003H~000AH – External interrupt 0 interrupt address area

000BH~0012H – Timer/Counter 0 interrupt address area

0013H~001AH – external interrupt 1 interrupt address area

001BH~0022H–Timing/Counter1 interrupt address area

0023H~002AH – Serial interrupt address area

Each interrupt address area has 8 memory cells to store the interrupt service program, but 8 cells are usually not enough to store a complete interrupt service program, so it is often necessary to store an unconditional transfer instruction at the first address of the interrupt address area to go to the real entry address of the interrupt service program.

The unit starting from 002BH is the program memory that the user can use at will.

    GET A FREE QUOTE

    FPGA IC & FULL BOM LIST

    We'd love to

    hear from you

    Highlight multiple sections with this eye-catching call to action style.

      Contact Us

      Exhibition Bay South Squre, Fuhai Bao’an Shenzhen China

      • Sales@ebics.com
      • +86.755.27389663