Microcontroller Architecture
The simplest microcontroller architecture consists of a microprocessor, memory, and input/output. The microprocessor consists of a central processing unit (CPU) and the control unit (CU).
The CPU is the brain of a microprocessor and is where all of the arithmetic and logical operations are performed. The control unit controls the internal operations of the microprocessor and sends control signals to other parts of the microprocessor to carry out the required instructions.
Memory is an important part of a microcomputer system. Depending upon the application we can classify memories into two groups: program memory and data memory. Program memory stores all the program code. This memory is usually a read-only memory (ROM). Other types of memories, e.g. EPROM and PEROM flash memories, are used for low-volume applications and also during program development. Data memory is a read/write memory (RAM). In complex applications where there may be need for large amounts of memory it is possible to interface external memory chips to most microcontrollers.
Input/Output (I/O) ports allow external digital signals to be connected to the microcontroller. I/O ports are usually organized into groups of 8 bits and each group is given a name. For example, the 8051 microcontroller contains four 8-bit I/O ports named P0, P1, P2, and P3. On some microcontrollers the direction of the I/O port lines are programmable so that different bits of a port can be programmed as inputs or outputs. Some microcontrollers (including the 8051 family) provide bi-directional I/O ports. Each I/O port line of such microcontrollers can be used as inputs and outputs. Some microcontrollers provide ‘open-drain’ outputs where the output transistors are left floating (e.g. port P0 of the 8051 family). External pull-up resistors are normally used with such output port lines.