Central processing unit (CPU):
CPU is the main core component of single chip microcomputer, including arithmetic unit, controller and several registers.
Internal data memory (RAM):
MCS-5 1 MCU chip * * * has 256 RAM units, of which the latter 128 unit is occupied by a special register, and only the former 128 unit can be used as a register for users to store readable and writable data. Therefore, the internal data memory usually refers to the128th cell, which is called internal RAM. The address range is 00h-ffh (256b). It is a multi-purpose and multifunctional data memory, with data storage space, general working register, stack, bit address and so on.
Internal program memory (ROM):
As mentioned earlier, MCS-5 1 has a 4KB/8KB byte ROM (4KB for 5 1 series and 8KB for 51series) for storing programs, raw data or tables. Therefore, it is called program memory, or simply internal ram. The address range is 0000h-ffffh (64kb).
Timer/counter
5 1 series * * has two 16-bit timers/counters (52 series * * * has three 16-bit timers/counters) to realize the timing or counting function, and control the computer with its timing or counting results. Timing is achieved by calculating the internal frequency division clock frequency. When using the counter, count the low-level pulses at the P3.4(T0) or P3.5(T 1) port.
Parallel input and output port
MCS-5 1 * * has four 8-bit I/O ports (P0, P 1, P2, P3) for data input and output. Specific functions will be discussed in detail in later chapters.
serial port
MCS-5 1 has a programmable full-duplex serial port to realize serial data transmission between single chip microcomputer and other devices. The serial port is powerful and can be used as a full-duplex asynchronous communication transceiver and shifter. The RXD( P3.0) pin is the receiving port, and the TXD(P3. 1) pin is the sending port.
Interrupt control system
MCS-5 1 MCU has powerful interrupt function, which can meet the needs of different control applications. 5 1 series has five interrupt sources (52 series has six interrupt sources), namely, two external interrupts, two timed interrupts and 1 serial interrupts. All interrupts are divided into two priorities: high priority and low priority. We will also explain the setting of priority in detail later.
Timing and control unit
MCS-5 1 MCU has a high-gain inverting amplifier, XTAL 1 as the base input and XTAL2 as the output. MCS-5 1 chip has a clock circuit inside, but it needs an external clock crystal and a fine-tuning capacitor. The clock circuit generates a clock pulse sequence for the single chip microcomputer.