0% found this document useful (0 votes)
4 views

Lect 2 ETEN403 Microcontroller and Embedded System Applications

The document outlines the basic characteristics and components of microcontrollers and embedded systems, focusing on the CPU's role in fetching and executing instructions. It details various types of registers, including general-purpose and special-purpose registers, and their functions within the CPU. Additionally, it covers arithmetic and logical operations, memory and I/O control lines, and interrupt handling mechanisms.

Uploaded by

Farid Tijjani
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Lect 2 ETEN403 Microcontroller and Embedded System Applications

The document outlines the basic characteristics and components of microcontrollers and embedded systems, focusing on the CPU's role in fetching and executing instructions. It details various types of registers, including general-purpose and special-purpose registers, and their functions within the CPU. Additionally, it covers arithmetic and logical operations, memory and I/O control lines, and interrupt handling mechanisms.

Uploaded by

Farid Tijjani
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

2/1/2022

Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.


1
ETEN403 Microcontroller and Embedded System Applications

COMPUTER
SYSTEM

CPU

INTER
CONNECTION

MEMORY
I/O DEVICES

ETEN403 Microcontroller and Embedded System Applications Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.

1
2/1/2022

Basic Characteristics are


 Both data and instructions are stored in R/W memory
 The contents of R/W memory are accessed by location
 Instructions are accessed and executed sequentially
n
DATA “
SYSTEM BUS “
&

PROGRAM

2
1

CPU
I/O 0
R/W MEMORY
CPU is responsible for sequentially fetching instruction and data from the
memory and stored temporarily inside the CPU and then execute one after
the other. The result may be stored inside the CPU or back to the memory.

Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.


3
ETEN403 Microcontroller and Embedded System Applications

Basic Characteristics are


CPU

REGISTERS I SYSTEM BUS


N MEMORY
ALU T
E
TIMING R
& F
CONTROL A
UNIT C I/O
E
µp (CPU-ON-A-CHIP)

Different components presents in micro-processor in other words the sub-


components present inside the CPU.

Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.


4
ETEN403 Microcontroller and Embedded System Applications

2
2/1/2022

Register is a set of flip-flop, which are used to store


instruction and data

i. the size of data,

ii. the size of instructions,

iii. the size of address to store?


Note:
In case of 8085 most of the registers are 8-bit because is an 8-bit processor

Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.


5
ETEN403 Microcontroller and Embedded System Applications

 General Purpose Register

 Special Purpose Register

Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.


6
ETEN403 Microcontroller and Embedded System Applications

3
2/1/2022

 ACCUMULATOR- it stores 1 of the operant that will be


process by the ALU

 PROGRAM COUNTER- it keep tracks of the memory


location
 STATUS REGISTER- it reflects the outcome of
instruction execution on:

a) Overflow
b) Outcome (‘+tive’ or ‘_tive’)
c) Parity of the result

Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.


7
ETEN403 Microcontroller and Embedded System Applications

 STACK POINTER- is used to implement one very


important data structure ‘STACK’. It is used for

many applications particularly interrupt handling.

Whenever a sub-routing call is performed, STACK

will be required to store information to be used after

returning from interrupt i.e. after sub-routing call.

Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.


8
ETEN403 Microcontroller and Embedded System Applications

4
2/1/2022

 User Accessible
 Not User Accessible

General Purpose
User Accessible
Special Purpose

Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.


9
ETEN403 Microcontroller and Embedded System Applications

MAR

Not MDR

User
Accessible IR

TEMP

Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.


10
ETEN403 Microcontroller and Embedded System Applications

5
2/1/2022

• Hold ADDR before it comes to ADDR bus for


accessing memory & I/O devices
MAR
• Used as buffer register to store data, which is
access through the system bus that are read
MDR from memory & I/O devices

• Used to temporarily hold instruction before it is


being decoded and executed by the µP
IR

Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.


11
ETEN403 Microcontroller and Embedded System Applications

• Used to hold intermediate


result, which is apply to
the ALU or to other
TEMP functions

Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.


12
ETEN403 Microcontroller and Embedded System Applications

6
2/1/2022

ACC (8)
GENERAL
B (8) C (8)
D (8) E (8) PURPOSE
H (8) L (8)
REGISTERS
PC (16)
SP (16)
PSW  Flag bit  S – Z – AC – P - CY
CARRY

PARITY

AUXILIARY CARRY

ZERO

SIGN

Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.


13
ETEN403 Microcontroller and Embedded System Applications

• Whenever there is carry at the


CARRY output this flag bit should be set

• It reflect the parity of the result if


PARITY not odd

AUXILIARY • Some times you have to implement


4-bit data, so, carry coming out
CARRY from the 4th bit, is reflected on AC

Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.


14
ETEN403 Microcontroller and Embedded System Applications

7
2/1/2022

ZERO • It indicates when result is (0) or


not.

• It indicates the sign of the result.

SIGN If S=+ then the MSB of the data at


the output of the ACC is (0),
otherwise it will be (1).

Note: Flag bits are very important for implementing various types of
control loops or decision making & they are useful in writing programs for
different applications.

Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.


15
ETEN403 Microcontroller and Embedded System Applications

Registers should be pair when dealing with 16-bit ADDR

BC • Cascading register B
&C

DE • Cascading register D
&E

HL • Cascading register H
&L

Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.


16
ETEN403 Microcontroller and Embedded System Applications

8
2/1/2022

ARITHMETIC OPERATIONS
 ADDITION
 SUBTRACTION
 INCREMENT
 DECREMENT Note: Arithmetic operation are restricted
to 8-bit DATA.
LOGICAL OPERATIONS 16-bit and 32-bit ADDITION will not be
 AND possible. One has to write program for
such bits additions.
 OR
 EXOR
 NOT
 CLEAR
 COMPARE
 SHIFT/ROTATE
Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.
17
ETEN403 Microcontroller and Embedded System Applications

MEMORY AND I/O CONTROL LINES


 R/W  STATUS LINES
 IO/M  ADDRESS LINES
 READY/WAIT  DATA LINES
 ALE
CPU AND BUS CONTROL
 RESET
 INTERRUPTS-This is necessary to achieve interrupts on
different data transfer.
 BUS REQUEST/BUS GRAND LINES- This is necessary to
achieve DMA mode of data transfer.
UTILITY LINES  POWER SUPPLY
 CLOCK LINES Vcc GND
 I/O LINESSERIAL I/O LINES
Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.
18
ETEN403 Microcontroller and Embedded System Applications

9
2/1/2022

Vcc
+5V GND
TRAP
AD0-7

8
INTERRUPT RST 7.5
INPUTS
RST 6.5
A8-15
CPU RST 5.5

0
& INTR RD
BUS
CONTROL INTA
WR
RESET-IN

8
RESET-OUT IO/M MEMORY
AND
HOLD ALE I/O
CONTROL
HLDA READY

5
CRYSTAL X1
INPUTS
X2 S0
STATUS
SERIAL SID
S1 LINES
I/O SOD
LINES

Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.


19
ETEN403 Microcontroller and Embedded System Applications

RST 7.5 SOD


INTR INTA RST 5.5 RST 6.5 TRAP SID

INTERRUPT CONTROL SERIAL I/O CONTROL

INTERNAL DATA BUS

ACC TEMP FLAGS IR B C


D E
Vcc 
H L
ALU INS.
DECODER
Vss  PC
SP
X1 INC/DEC
TIMING & CONTROL
X2

CLK READY WR S0 S1 HOLD RESET-OUT ADDR/DATA


OUT ADDR BUS
RD ALE IO/M HLDA RESET-OUT
BUS

A8-15 AD0-7 20
ETEN403 Microcontroller and Embedded System Applications Lecturer: Engr. Dr. M. J. MUSA MCOREN, MNIAE, MIAENG, MMACE.

10

You might also like