Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

21bce2119 VL2022230504023 Ast05

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

NAME: BONAM HITESH PHANEENDRA

REG.NO:21BCE2119
SLOT:C1+TC1
1. Develop an Assembly Language Program (ALP) using interrupts to do the
following:
(a) Receive data serially and send to P1
(b) Read port 2, transmit data serially, and give a copy to P0
(c) Make timer 0 generate a square wave of 2 KHz frequency on P 3.6
Assume that XTAL = 11.0592 MHz. Set the baud rate at 9600.

CODE:
ORG 0000H
LJMP MAIN

ORG 000BH
CPL P3.6RETI
ORG 0023H
LJMP SERIAL

ORG 0030H
MAIN:MOV P2,#0FFHMOV
TMOD,#22H MOV TH1,#-3
MOV SCON,#50H MOV
TH0,#1AH MOV
IE,#10010010BSETB TR1
SETB TR0
BACK:MOV A, P2
MOV SBUF,A
MOV P0,A
SJMP BACK

ORG 0100H
SERIAL:JB TI,TRANS
MOV A, SBUF

MOV P1,A
CLR RI
RETI
TRANS:CLR TI
RETI
END
OUTPUT:
2. Develop an Assembly Language Program (ALP) using interrupts to do the following:
(a) Generate a 10 KHz frequency on P2.1 using T0 8-bit auto reload
(b) Use timer 1 as an event counter to count up 1-Hz pulse and display it on P0. The
pulse is connected to EX1.
Assume that XTAL = 11.0592 MHz.

CODE:
ORG 0000H

LJMP MAIN

ORG 001BH

TIMER1_ISR:

INC A MOV

P0, ARETI

ORG 000BH

CPL P2.1

RETI

ORG 0030H

MAIN:

MOV A, #0

MOV TMOD, #12H

MOV TH0, #0D2H

MOV TL0, #TH0

SETB TR0

SETB ET1 SETB

EX1 MOV TH1,

#0

MOV TL1, #0

SETB TR1 MOV

IE, #8EH

WAIT:
SJMP WAIT

END

OUTPUT

THANK YOU

You might also like