2. Microcontrollers for Embedded Systems
• Criteria for Choosing a Microcontroller
• Meeting the computing needs of the task at hand efficiently and cost effectively
• Speed
• Packaging
• Power consumption
• The amount of RAM and ROM on chip
• The number of I/O pins and the timer on chip
• How easy to upgrade to higher performance or lower power consumption versions
• Cost per unit
• Availability of software development tools, such as compilers, assemblers, and
debuggers
• Wide availability and reliable sources of the microcontroller
2
7/19/2022 18EC46
3. Microcontrollers for Embedded Systems
• The 8051 family has the largest number of diversified suppliers
• Intel (original), Atmel, Philips/Signetics, AMD, Infineon (formerly Siemens),
Matra, Dallas Semiconductor/Maxim
• Intel introduced 8051, referred as MCS-51, in 1981
• The 8051 is an 8-bit processor
• The CPU can work on only 8 bits of data at a time
• The 8051 had
• 128 bytes of RAM
• 4K bytes of on-chip ROM
• Two timers
• One serial port
• Four I/O ports, each 8 bits wide
• 6 interrupt sources
3
7/19/2022 18EC46
4. Overview of 8051 family
• There are two other members in 8051 family of Microcontroller.
• They are 8052 and 8031.
• 8052 has all standard features of 8051 with an extra 128 bytes of RAM and an
extra timer. i.e. a total of 256 bytes of RAM and 3 timers.
• It also has 8K bytes of on chip program instead of 4K bytes.
• 8031 Microcontroller is often referred as a ROM less 8051 since it has 0K bytes
of on chip ROM.
• To use this chip we must add external ROM to it.
• Two ports will be lost in the process of adding external ROM.
4
7/19/2022 18EC46
5. Overview of 8051 family
• Comparison of 8051 family
5
7/19/2022 18EC46
7. 8051 Architecture
• CPU(Central Processing Unit)
• Main part of the microcontroller that actually does all the processing works.
• It has control circuit and ALU to perform logical and mathematical operations.
• A user can not access the processor or CPU of the microcontroller.
• The CPU is internally connected or interfaced with the memory units such as
ROM and RAM.
• CPU works according to the instruction or programs stored in the ROM.
• Oscillator and Timers
• Pulse signal generator circuit which provides the pulse signal to the CPU to
complete its operation and to work with cycles per unit time.
7
7/19/2022 18EC46
8. 8051 Architecture
• It is an on-chip crystal oscillator mounted outside of the CPU.
• The crystal frequency of this oscillator is 12 MHz.
• Memory Units
• Has a ROM of 4kb and RAM of 128bytes
• The ROM is used for the preloaded or stored program and according to this
program, the CPU works.
• CPU can read or fetch data from the ROM but it can not write or store any data
to the ROM.
• RAM is used to store data temporarily during the operation or program execution.
CPU can store data into the RAM.
8
7/19/2022 18EC46
9. 8051 Architecture
• Interrupts
• The interrupt is the subroutine call that interrupts the main ongoing program
execution in the CPU and tells to execute another important task or program.
• We can say the interrupts help for the emergency operations.
• There are mainly five interrupt sources in the microcontroller 8051,
• TF0 - it is the Timer 0 overflow interrupt
• TF1 - it is the Timer 2 overflow interrupt
• INT0 - it is an external hardware interrupt
• INT1 - it also an external hardware interrupt
• R1/T1 - it is the serial communication interrupt
9
7/19/2022 18EC46
10. 8051 Architecture
• Input/Output Ports
• There are four parallel 8-bit ports such as P0, P1, P2, and P3.
• These ports are bidirectional and used to carry both address and data.
• Bus
• The system bus connects all the circuits or components(memory, timers, ports) to
the CPU.
• The system bus consists of an 8-bit data bus and a 16-bit address bus.
• The address bus helps to carry the memory addresses where the data is stored
whereas the data bus helps to carry the actual data.
10
7/19/2022 18EC46
11. 8051 Architecture
• Pin Diagram:
• Pins 1 to 8 − These pins are known
as Port 1.
• This port doesn’t serve any other
functions.
• It is internally pulled up, bi-
directional I/O port.
• Pin 9 − It is a RESET pin, which is
used to reset the microcontroller to
its initial values.
11
7/19/2022 18EC46
12. 8051 Architecture
• Pins 10 to 17: Known as Port 3.
• This port serves some functions like interrupts, timer input, control signals, serial
communication signals RxD and TxD, etc.
• Pins 18 & 19 − These pins are used for interfacing an external crystal to get the
system clock.
• Pin 20 − This pin provides the power supply to the circuit.
• Pins 21 to 28 − These pins are known as Port 2.
• It serves as I/O port. Higher order address bus signals are also multiplexed using
this port.
12
7/19/2022 18EC46
13. 8051 Architecture
• Pin 29 − This is PSEN pin which stands for Program Store Enable. It is used to
read a signal from the external program memory.
• Pin 30 − This is EA pin which stands for External Access input. It is used to
enable/disable the external memory interfacing.
• Pin 31 − This is ALE pin which stands for Address Latch Enable. It is used to
demultiplex the address-data signal of port.
13
7/19/2022 18EC46
14. 8051 Architecture
• Pins 32 to 39 − These pins are known as Port 0.
• It serves as I/O port.
• Lower order address and data bus signals are multiplexed using this port.
• Pin 40 − This pin is used to provide power supply to the circuit.
• Block Diagram:
14
7/19/2022 18EC46