KEMBAR78
Assignment Test1 | PDF | Office Equipment | Classes Of Computers
0% found this document useful (0 votes)
10 views4 pages

Assignment Test1

The document outlines an assignment test for the Digital Circuits and Microcontroller Lab at SRI Ramakrishna Engineering College, detailing the course outcomes and specific tasks related to the 8051 microcontroller. It includes instructions for calculating square wave frequency using Timer 1 and controlling an LED with an external interrupt. The assignment is designed for students in their fourth semester, with a maximum score of 20 marks and a time limit of 30 minutes.

Uploaded by

Sri Dhar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views4 pages

Assignment Test1

The document outlines an assignment test for the Digital Circuits and Microcontroller Lab at SRI Ramakrishna Engineering College, detailing the course outcomes and specific tasks related to the 8051 microcontroller. It includes instructions for calculating square wave frequency using Timer 1 and controlling an LED with an external interrupt. The assignment is designed for students in their fourth semester, with a maximum score of 20 marks and a time limit of 30 minutes.

Uploaded by

Sri Dhar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

SRI RAMAKRISHNA ENGINEERING COLLEGE

[Educational Service: SNR Sons Charitable Trust]


[Autonomous Institution, Reaccredited by NAAC with ‘A+’ Grade]
[Approved by AICTE and Permanently Affiliated to Anna University, Chennai]
[ISO 9001:2015 Certified and all eligible programmes Accredited by NBA]
VATTAMALAIPALAYAM, N.G.G.O. COLONY POST, COIMBATORE – 641 022.

Assignment Test
Date 23.04.2025 Department II
Semester IV Class/section II - A/B
Maximum marks 20 Time 30 Minutes
Course Code & Title: 20EC223 Digital Circuits and Microcontroller Lab
Course Outcomes Addressed:
CO4: Explain the internal architecture, addressing modes and the instruction sets of 8051.

1. Explain how the square wave frequency is determined from the given 8051
assembly program using Timer 1, and calculate the resulting frequency at pin
P1.5 when the XTAL is 11.0592 MHz and the timer is loaded with the value
7634H.

1. TIMER VALUES
Program
MOV TMOD, #10H ; Select Timer 1, Mode 1 (16-bit timer mode)
AGAIN: MOV TL1, #34H ; Load low byte of timer (TL1 = 0x34)
MOV TH1, #76H ; Load high byte of timer (TH1 = 0x76 → total =
0x7634)
SETB TR1 ; Start Timer 1

WAIT: JNB TF1, WAIT ; Wait until Timer 1 overflows (TF1 = 1)


CLR TR1 ; Stop Timer 1
CPL P1.5 ; Toggle P1.5 (next half cycle of square wave)
CLR TF1 ; Clear Timer 1 overflow flag
SJMP AGAIN ; Repeat
2. Explain how the 8051 microcontroller uses the INT1 external interrupt to
control an LED connected to pin P1.3 based on the falling edge of a pulse at
P3.3.

PROGRAM:
ORG 0000H
LJMP MAIN
; ------------------------
; ISR for External Interrupt INT1 (P3.3)
; ------------------------
ORG 0013H
SETB P1.3 ; Turn ON LED at P1.3
MOV R3, #255 ; Load delay count
BACK: DJNZ R3, BACK ; Delay loop
CLR P1.3 ; Turn OFF LED
RETI ; Return from interrupt
; ------------------------
; Main Program
; ------------------------
ORG 0030H
MAIN: SETB TCON.2 ; Set INT1 as edge triggered (IT1 = 1)
MOV IE, #10000100B ; Enable INT1 (EX1) and global interrupt (EA)
HERE: SJMP HERE ; Stay in infinite loop

You might also like