Friday 26 February 2016

Assignment -Microprocessor

Assignment 1:-

1.
Analyze the architecture and pin diagram of 8085 microprocessor.
2.
Understand and describe the internal operations of
i)
DMA Controller,8257
ii)
Programmable Interval timer,8254
iii)
Programmable Peripheral interface,8255
3.
Understand and describe the internal operations of
(1)
Programmable Interrupt controller,8259
(2)
USART,8251
(3)
Programmable Keyboard and Display Interface.8279


Assignment 2:-

4.
Analyze the architecture and pin diagram of 8051 microcontroller.
5.
Analyze the architecture and pin diagram of 8086 microprocessor.
6.
Compare and contrast differences between microprocessor and microcontroller  (viz., register structure and addressing modes, instruction set).

INTERFACING STEPPER MOTOR USING 8085.

INTERFACING STEPPER MOTOR USING 8085.

INTERFACING 8255 WITH 8085
AIM:
            To interface  stepper motor using programmable peripheral interface 8255 with 8085 and study its characteristics in I/O-mode.0
KITS REQUIRED:
            8085 mp kit,  DC regulated power supply, 26 pin frc cable ,stepper motor interface ,stepper motor

Programmable Peripheral Interface 8255
 I/O MODES:
            Control Word:


MODE 0 – SIMPLE I/O MODE:
                                  This mode provides simple I/O operations for each of the three ports and is suitable for synchronous data transfer. In this mode all the ports can be configured either as input or output port.
            Let us initialize port A,B,C  as output port






ADDRESS
OPCODE
LABEL
MNEMONICS
OPERAND
COMMENT
8C00


MVI
A,80
All ports are o/p ports
8C01





8C02


OUT
43H
Out to control reg
8C03





8C04


MVI
A,88
Initialize bit pattern
8C05





8C06

LOOP
OUT
40H
PA0-PA3 bit control the motor
8C07





8C08


CALL
DELAY (8C20)

8C09





8C0A





8C0B


RRC/RLC

To rotate left or right
8C0C


JMP
LOOP

8C0D





8C0E







DELAY PROGRAM



8c20

delay
PUSH
PSW

ADDRESS
OPCODE
LABEL
MNEMONICS
OPERAND
COMMENT
8C21


LXI
H,0001

8C22





8C23





8C24

D2
LXI
D,FFFF

8C25





8C26





8C27

D3
DCX
D

8C28


MOV
A,E

8C29


ORA
D

8C2A


JNZ
D3

8C2B





8C2C





8C2D


DCX
H

8C2E


MOV
A,H

8C2F


ORA
L

8C30


JNZ
D2

8C31





8C32





8C33


POP
PSW

8C34


RET






OBSERVATION:

Microprocessor-8085-LARGEST/SMALLEST ELEMENT IN AN ARRAY

LARGEST ELEMENT IN AN ARRAY


AIM:

                To find the largest element in an array.
ALGORITHM:

  1. Place all the elements of an array in the consecutive memory locations.
  2. Fetch the first element from the memory location and load it in the accumulator.
  3. Initialize a counter (register) with the total number of elements in an array.
  4. Decrement the counter by 1.
  5. Increment the memory pointer to point to the next element.
  6. Compare the accumulator content with the memory content  (next  element).
  7. If the accumulator content is smaller, then move the memory content  (largest element) to the accumulator. Else continue.
  8. Decrement the counter by 1.
  9. Repeat steps 5 to 8, until the counter reaches zero.
  10. Store the result (accumulator content) in the specified memory location.

RESULT:

                Thus the largest number in the given array is found out.








PROGRAM:

ADDRESS
OPCO
DE
LABEL
MNEMONICS
OPERAND
COMMENTS
8001


LXI
H,8100
Initialize HL reg. to 8100H
8002




8003




8004


MVI
B,04
Initialize B reg with no. of comparisons (n-1)
8005




8006


MOV
A,M
Transfer first data to acc.
8007

LOOP1
INX
H
Increment HL reg.  to point next memory location
8008


CMP
M
Compare M & A
8009


JNC
LOOP
If A is greater than M then go to loop
800A




800B




800C


MOV
A,M
Transfer data from M to A reg
800D

LOOP
DCR
B
Decrement B reg
800E


JNZ
LOOP1
If B is not Zero go to loop1
800F




8010




8011


STA
8105
Store the result in a memory location.
8012




8013




8014


RST 5

Stop the program

OBSERVATION:

INPUT
OUTPUT
ADDRESS
DATA
ADDRESS
DATA
8100

8105

8101




8102




8103




8104





 SMALLEST ELEMENT IN AN ARRAY

AIM:

To find the smallest element in an array.

ALGORITHM:

  1. Place all the elements of an array in the consecutive memory locations.
  2. Fetch the first element from the memory location and load it in the accumulator.
  3. Initialize a counter (register) with the total number of elements in an array.
  4. Decrement the counter by 1.
  5. Increment the memory pointer to point to the next element.
  6. Compare the accumulator content with the memory content  (next  element).
  7. If the accumulator content is smaller, then move the memory content  (largest element) to the accumulator. Else continue.
  8. Decrement the counter by 1.
  9. Repeat steps 5 to 8  until the counter reaches zero
  10. Store the result (accumulator content) in the specified memory location.

RESULT:

          Thus the smallest number in the given array is found out.



PROGRAM:

ADDRESS
OPCODE
LABEL
MNEMONICS
OPERAND
COMMENTS
8001


LXI
H,8100
Initialize HL reg. to 8100H
8002




8003




8004


MVI
B,04
Initialize B reg with no. of comparisons (n-1)
8005




8006


MOV
A,M
Transfer first data to acc.
8007

LOOP1
INX
H
Increment HL reg.  to point next memory location
8008


CMP
M
Compare M & A
8009


JC
LOOP
If A is lesser than M then go to loop
800A




800B




800C


MOV
A,M
Transfer data from M to A reg
800D

LOOP
DCR
B
Decrement B reg
800E


JNZ
LOOP1
If B is not Zero go to loop1
800F




8010




8011


STA
8105
Store the result in a memory location.
8012




8013




8014


RST 5

Stop the program







OBSERVATION:

INPUT
OUTPUT
ADDRESS
DATA
ADDRESS
DATA
8100

8105

8101




8102




8103




8104