Unit 1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 52

U23CC381- MICROPROCESSORS AND MICROCONTROLLERS

COURSE INSTRUCTOR : Mrs.N.BANUPRIYA, AP(Sl.G)/ CCE


U23CC381- MICROPROCESSORS AND MICROCONTROLLERS

Course Objectives
1. Gain proficiency in 8085 assembly language programming.

2. Understand 8051 microcontroller hardware concepts.

3. Familiarize with interfacing techniques for 8051 on-chip


peripherals using C programming.

4. Learn methods to integrate microcontrollers with real-time


applications.

5. Develop skills in designing embedded systems using various


embedded boards.
2
Course Outcome
Upon completion of the course, students shall have ability to

CO1: Apply proficiency in 8085 architecture to implement


assembly language programs.

CO2: Apply knowledge of 8051 microcontroller hardware

CO3: Explore interfacing techniques in 8051 on-chip


peripherals using C programming.

CO4: Apply interfacing techniques to integrate


microcontrollers with real-time applications.

CO5: Design an embedded system for real-world applications


using various embedded boards
3
PROJECTS

There are several websites where you can find simple and innovative projects
implemented using 8051 and Arduino microcontrollers. Few popular ones:

Instructables: Visit: Instructables - Arduino Projects

Hackster.io: Visit: Hackster.io - Arduino Projects | Hackster.io - 8051 Projects

Arduino Project Hub: Visit: Arduino Project Hub

Electronics Hub: Visit: Electronics Hub - 8051 Projects

Circuit Digest: Visit: Circuit Digest - Arduino Projects | 8051 Projects

4
Unit-I: Introduction to 8085 Microprocessor

RISC and CISC processors; 8085 Architecture: Pin

description; interrupt processing; operand addressing;

assembler directives; instruction set (commonly used

instructions only)
MICRO+PROCESSOR

Vacuum Tubes-1st
Generation Computers
MICRO+PROCESSOR
MICRO+PROCESSOR
Which one of these need a processor now?
What is a Microprocessor ? A microprocessor is a tiny electronic chip(IC) that acts
as the brain of a computer. It helps the computer to think, solve problems, and do
tasks quickly

What is an IC?

• With a complex digital circuit comprising of adders, registers, etc

• Capable of processing given Data, according to the Instructions given


(program)
July 23, 2024 10
A simple Microprocessor based system:

July 23, 2024 11


8085 can process 8 bits (2^8 = 0–255) of data in one clock cycle

Then came Pentium 5, i3, i5 and i7, i9…

July 23, 2024 12


The speed at which a microprocessor can execute the
instructions is called the clock speed.

Then came Pentium 5, i3, i5 and i7, i9…


July 23, 2024 13
Intel 8085

July 23, 2024 14


Intel 8085
Features of Intel 8085:

• 40-pin DIP chip


• 8-bit data and 16-bit address bus
• With 16-bit address,
8085 can access 216 = 65536 = 64KB memory locations
• 8-bit Flag register with 5 flags
• Operates with power supply of +5 volts and Gnd
• Max Clock frequency is 12 MHz

July 23, 2024 15


Intel 8085
Pin Diagram:

July 23, 2024 16


Intel 8085
Pin Diagram:

July 23, 2024 17


Intel 8085
Pin Diagram:

July 23, 2024 18


Intel 8085
Pin Diagram:

July 23, 2024 19


Intel 8085
Pin Diagram:

July 23, 2024 20


Intel 8085
Pin Diagram:

July 23, 2024 21


Intel 8085
Pin Diagram:

July 23, 2024 22


Intel 8085
Pin Diagram:

July 23, 2024 23


Intel 8085
Pin Diagram:

July 23, 2024 24


Intel 8085
Pin Diagram:

July 23, 2024 25


Intel 8085
Pin Diagram:

July 23, 2024 26


Intel 8085
Pin Diagram:

July 23, 2024 27


Intel 8085
Pin Diagram: INTERRUPTS IN 8085

July 23, 2024 28


Intel 8085
Pin Diagram: INTERRUPTS IN 8085

July 23, 2024 29


Intel 8085
Pin Diagram:

July 23, 2024 30


Intel 8085
Pin Diagram:

July 23, 2024 31


Intel 8085
Pin Diagram:

July 23, 2024 32


Intel 8085
Pin Diagram:

July 23, 2024 33


Intel 8085
Architecture:

July 23, 2024 34


Intel 8085
Register Organization:

July 23, 2024 35


Intel 8085
Flag register:

July 23, 2024 36


An Introduction to Microprocessor

Interrupt:
It is a signal that stops the execution of current program in microprocessor
and transfers the program control to a sub-program (ISR) related to
interrupted device.

July 23, 2024 37


An Introduction to Microprocessor

Interrupt:

Priority
Hardware Interrupts:
1. TRAP
2. RST 7.5
3. RST 6.5
4. RST 5.5
5. INTR

Software Interrupts:
1. RST n (n = 0 ~ 7)

July 23, 2024 38


Intel 8085
Instruction format:

• The 8085 has 74 instructions and 246 combinations in it.


• 8085 instructions size is 1 byte, 2 bytes and 3 three bytes.
• Each instruction of 8085 has 1 byte opcode.

July 23, 2024 39


Intel 8085
Addressing Modes:
Every instruction of a program operates on a data.
The method of specifying the data to be operated by the instruction
is called Addressing.

The 8085 has the following 5 different types of addressing.

1. Immediate Addressing Eg. ADI 15H

2. Direct Addressing Eg. LDA 4200H


3. Register Addressing Eg. MOV A, B
4. Register Indirect Addressing Eg. LDAX B, MOV A,M (LXI H, 4200)
5. Implied Addressing Eg. CMA

July 23, 2024 40


Intel 8085
Instruction set:
Data Transfer Arithmetic Logical Branching Machine control

MOV Rs, Rd ANA Rs


MOV M, Rs ADD Rs ANA M
MOV Rd, M ADD M ANI d8
MVI Rd, d8 ADI d8
MVI M, d8 ADC Rs ORA Rs
ADC M ORA M
LDA a16 ACI d8 ORI d8 JMP a16
LDAX rp J<cond> a16
LHLD a16 EI
SUB Rs XRA Rs DI
LXI rp, d16 XRA M
SUB M CALL a16
STA a16 SUI d8 XRI d8
C <cond> a16 SIM
STAX rp SBB Rs
CMP Rs RET RIM
SHLD a16 SBB M
SBI d8 CMP M RETI
SPHL CPI d8 NOP
XTHL
XCHG INR Rs RAL PCHL HLT
INR M RLC RST n
PUSH rp INX rp
PUSH PSW RAR
POP rp RRC
POP PSW DCR Rs
DCR M CMA
IN a8 DCX rp CMC
OUT a8 STC

21 20 19 8 6

July 23, 2024 41


Intel 8085
Machine Cycles and Timing Diagram:
The machine cycles are the basic operations performed by the processor,
while instructions are executed.

The time taken for performing each machine cycle is expressed


in terms of T-states.

One T-state is the time period of one clock cycle of the microprocessor.

The various machine cycles are


1. Opcode fetch …………….. - 4 / 6 T
2. Memory Read ……………. - 3 T
3. Memory Write ……………. - 3 T
4. I/O Read ………………….. - 3T
5. I/O Write …………………. - 3T
6. Interrupt Acknowledge - 6 / 12 T
7. Bus Idle …………………… - 2/3T
July 23, 2024 42
Intel 8085
Instruction Execution & Machine Cylces:

July 23, 2024 43


Programming Intel
8085

July 23, 2024 44


Intel 8085 - Programming

Steps in Programming for a Microprocessor

• Understand the problem


• Device an algorithm for the given problem
• Identify the instructions that suits for the steps in algorithm
• Validate the program
• Verify the results

July 23, 2024 45


Intel 8085 – Programming

8085 – Programming Exercise #1


Write an ALP for 8085 to multiply two 8-bit numbers.
Assume two 8-bit data are in memory locations 4200 & 4201.

LOGIC:

• There is no direct multiplication instruction in 8085.


So, Multiplication is done through repeated addition.
Example: 3 x 2 = (3 + 3) or (2+2+2)
• Take two 8-bit numbers from memory and store it in 2 registers (B & C).
• Clear Acc and start adding first number for second number of times
• Store the result (in Acc) in another memory location (4202)

July 23, 2024 46


Intel 8085 & 8086 - Programming :
Write an ALP for 8085 to multiply two 8-bit numbers.

LDA 4200
MOV B, A

LDA 4201
MOV C, A

MVI A, 00

ADD B (Loop)

DCR C

JNZ Loop

STA 4202

HLT

July 23, 2024 47


Intel 8085 - Programming #2:

Write an ALP for 8085 to divide two 8-bit numbers.


Assume Divisor and Dividend (8-bit data) are in memory locations 4200 & 4201.

LOGIC:

• There is no direct division instruction in 8085.


• So, Division is done through repeated Subtraction
Example: 10/3= 10-3-3-3 = 1 (remainder)
• Take two 8-bit numbers from memory and store it in 2 registers (A & B).
• Clear C Register and start comparing Divisor with Dividend
• Whenever Divisor is bigger, Subtract dividend from Divisor and Increment C
• Store the remainder (in Acc) in memory location (4202)
• Store the quotient (in C reg) in memory location (4203)

July 23, 2024 48


Intel 8085 - Programming #2:
Write an ALP for 8085 to divide two 8-bit numbers.

MVI C,00

LDA 4200
MOV B, A

LDA 4201

CMP B (Loop)
JC (Store)

SUB B

INR C
JMP Loop

STA 4202 (Store Remainder)

MOV A, C
STA 4203 (Store Quotient)
July 23, 2024 49
HLT
Intel 8085 - Programming #3:
Write an ALP for 8085 to find the largest number in an array.
Given: Array size (4200H) Array Starting location (4201H)

July 23, 2024 50


Thank you
For your patient listening…

July 23, 2024 51


Assessment ….

https://forms.gle/jq1rDjLPTHNPzqMc7

July 23, 2024 52

You might also like