Professional Documents
Culture Documents
Microcontrollers
Lecture 17
04/04/2022
Introduction
What is microprocessor?
Microprocessor is a programmable integrated device that
has computing and decision making capability similar to
that of central processing unit.
What is microcontroller?
Microcontroller is a small computer on a single integrated
circuit chip. A microcontroller typically contains one or
more processor cores, along with additional peripherals
(memory, serial interface, timer, etc.) on the same chip
Basic Block Diagram of
Microcontroller
To connect the system we need buses- Address bus, Data bus, Control bus
Function of timer is to produce delay
Two types of delay-Hardware delay and Software delay
Hardware delay- more expensive, more power consuming, more complex
Still have massive advantage of using Hardware delay
Difference
Microprocessor Microcontroller
It is only a processor, so memory and I/O Microcontroller has a processor along
components need to be connected with internal memory and I/O
externally. components.
It has no RAM,ROM, I/O units, timers and It has a CPU along with RAM, ROM, and
other peripherals on the chip. other peripherals embedded on a single
chip
Uses an external bus to interface Uses an internal controlling bus
Due to external components, the total Due to the presence of less external
power consumption is high. components, the total power
consumption is less.
Microprocessor-based systems can run at Microcontroller based systems run up to
a very high speed because of the 200 MHz or more depending on the
technology evolved. architecture.
• Auxiliary carry
0111 0001
0111 0101
= 1110 0110 AC=0
Program Status Word
• F0 Flag
General purpose flag available to the programmer
• Overflow Flag
This flag is set whenever the result of a signed number operation is too
large. It is used to detect errors in signed arithmetic operation. Eg.
Addition of two positive numbers and got a negative number, so OF
will be et to 1
• Parity Flag
When result has even number of 1’s, it is set to 1
• Register Bank Status
128 byte of internal RAM is divided into 4 register banks and in every
register bank we have 8 registers. (00-07H),(08-0FH)….
Memory Organization
128 Byte
RAM
Memory Organization
Register Bank
Default Register Bank = Register Bank 0
Each register bank has unique address
Only one register bank can be used at a time
Eg. MOV A,R0;
MOV A,00H;
How to move data from one register bank to another
(Bank 0 to Bank 2)
SETB PSW.4
CLR PSW.4
MOV A,R0
Memory Organization
Bit addressable read/write memory-
It is byte and bit addressable.
Eg (Byte addressable) MOV A,#03H;
MOV 26H,A;
Eg. (Bit addressable) SETB 32H
CLR 32H