Introduction Microcontrollers 08
Introduction Microcontrollers 08
Lecture 1
Introduction to microcontrollers
• Advantages of transistors
Usually lower cost and smaller than tubes, especially in small-signal circuits.
• Lower power consumption, less waste heat
• Can operate on lower-voltage supplies.
• Long life span
1960 birth of logic gates
History of microcontroller
If we will go back to history the 8051 microcontroller was first invented
in the year 1980 by the microprocessor giant Intel and gradually it
has been accepted worldwide and with the every coming days the
importance of the 8051 microcontroller is escalating. When it was
invented by the Intel, it was developed by means of NMOS technology
(N-type metal-oxide-semiconductor or Negative Channel MOS), but as
NMOS technology but it was not very effective.
In order to increase the effectiveness and the productivity the Intel has
remodeled it by implementing the technology of CMOS (Complementary
Metal Oxide Semiconductor) technology and a new edition came into
existence with a letter ‘C’ in the title name so that it can meet the
demand and can perform up to the mark. The new edition of the 8051
micro controller has two buses and out of which one for the program
and other for data so that it can perform well.
Microprocessor and Microcontroller development history
Summary History
Functions of µC / µP
digital devices
INTERRUPTS
PORTS -connect or interface I/o devices directly
µP µC
• PC can perform several tasks • Microcontroller is typically
simultaneously (e.g. type in dedicated to the same task
homework while playing music)
• Central Processing Unit
Store
programs
peripherals
Determines processing speed
µP based system
µP based system
The fetch-decode-execute cycle is a key feature of the von Neumann architecture and
consists of seven stages:
1. The memory address held in the program counter (PC) is copied into the memory
address register (MAR).
2. The address in the program counter is incremented (increased) by one. The
program counter now holds the address of the next instruction to be fetched.
3. The processor sends a signal along the address bus to the memory address held in
the MAR.
4. The instruction or data held in that memory address is sent along the data bus to
the memory data register (MDR).
5. The instruction or data held in the MDR is copied into the current instruction
register (CIR).
6. The instruction or data held in the CIR is decoded and then executed. Results of
processing are stored in the accumulator (ACC).
7. The cycle returns to step one.
The fetch-decode-execute cycle
Processor Signal sent
Memory adds copied MAR
• The CPU contains a clock which, along with the CU, is used to
coordinate all of the computer's components. The clock
sends out a regular electrical pulse which synchronizes (keeps
in time) all the components.
The von Neumann architecture, which is also known as the von Neumann model and Princeton
architecture, is a computer architecture based on the 1945 description by the mathematician and
physicist John von Neumann. This describes a design architecture for an electronic digital
computer with parts consisting of a Central Processing Unit (CPU) containing an Arithmetic
Logic Unit (ALU) and Processor Registers; a Control Unit containing an instruction register
and program counter; a memory to store both data and instructions; external mass storage;
and input and output mechanisms.
The meaning has evolved to be any stored-program computer in which an instruction fetch and a
data operation cannot occur at the same time because they share a common bus. This is
referred to as the von Neumann bottleneck and often limits the performance of the system.
Von- Neumann architecture
summary
Von Neumann architecture is the design upon which many general purpose computers are based. The key
elements of von Neumann architecture are:
A processor based on von Neumann architecture has five special registers which it uses for processing:
• the program counter (PC) holds the memory address of the next instruction to be fetched from primary
storage
• the memory address register (MAR) holds the address of the current instruction that is to be fetched from
memory, or the address in memory to which data is to be transferred
• the memory data register (MDR) holds the contents found at the address held in the MAR, or data which
is to be transferred to primary storage
• the current instruction register (CIR) holds the instruction that is currently being decoded and executed
• the accumulator (ACC) is a special purpose register and is used by the arithmetic logic unit (ALU) to hold
the data being processed and the results of calculations
https://www.bbc.co.uk/bitesize/guides/zhppfcw/revision/3
Harvard architecture
• clock speed
• cache size
• number of cores
Clock speed
• Clock speed is the number of pulses the central processing unit’s
(CPU) clock generates per second. It is measured in hertz (Hz).
• The faster the clock speed, the faster the computer is able to run
fetch-decode-execute cycles. This means that it can process more
instructions in the same amount of time.
•
• CPU clocks can sometimes be sped up by the user. This process is
known as overclocking. When the number of pulses per second is
increased, more fetch-decode-execute cycles can be performed and
more instructions can be processed in a given time. This increases
performance, but also requires more power, which results in a
greater need for heat dissipation and can strain the life of the
battery. Overclocking causes the CPU to work harder and produce
more heat, which can lead to long-term damage to the hardware.
Cache
• It behaves like a bridge that communicates with different components and activities
happening inside the single chip.
• Customized programming option available in microcontroller makes it more reliable and
user friendly.
• CPU is incorporated with on board registers which are divided into two types data
registers and addressing registers.
• Data registers also known accumulators are used for logic and shifting instructions.
• Addressing registers are used for holding the addresses for memory data accessing.
The stack pointer is referred as a address register which directs to the memory used for
hardware stack. Hardware stack is used for interrupt calls and returns and for
subroutine calls and returns.
• Hardware stack pointer design is not compulsory, some CPU comes with a single link
register, which behaves like a deep stack on the CPU and helps in fast subroutine calls
and returns.
• A microcontroller CPU is capable of executing series of instructions some of which are
data manipulation instructions, some are logic instruction and some are shifting
instructions.
I/O