100% found this document useful (1 vote)
68 views

EE303 Microprocessor Interfacing & Programming,: Quiz - 4 (10 Marks, 15 Minutes)

This document provides instructions for a quiz on designing a turnstile application using a microprocessor. Students are asked to: 1) Design an application to determine when the 10,000th person has entered a fairground using a turnstile sensor on P3.5 and a light on P1.7 to indicate when the count is reached. 2) The application should use interrupts to count each turnstile rotation and turn on the light when the 10,000th rotation occurs. 3) The document provides a partial code sample for the interrupt service routine and main program to serve as a starting point for the quiz.

Uploaded by

Umair Hameed
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
68 views

EE303 Microprocessor Interfacing & Programming,: Quiz - 4 (10 Marks, 15 Minutes)

This document provides instructions for a quiz on designing a turnstile application using a microprocessor. Students are asked to: 1) Design an application to determine when the 10,000th person has entered a fairground using a turnstile sensor on P3.5 and a light on P1.7 to indicate when the count is reached. 2) The application should use interrupts to count each turnstile rotation and turn on the light when the 10,000th rotation occurs. 3) The document provides a partial code sample for the interrupt service routine and main program to serve as a starting point for the quiz.

Uploaded by

Umair Hameed
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

EE303 Microprocessor Interfacing & Programming, Fall 2015

Quiz – 4 [10 Marks, 15 minutes]

Roll # _______________________

Design a turnstile application to determine when the 10,000 th person has entered a fairground. Assume
(a) a turnstile sensor connects to P3.5 and genertes a pulse each time the turnstile is rotated and (b) a light
is connected to P1.7 that is on when P1.7= 1 and off otherwise. Use interrupts.

#include <reg51.h>
sbit bulb = P1^7;
unsigned char z =255;
void T1_ISR (void) interrupt 3
{
bulb=1;
//call delay
EE303 Microprocessor Interfacing & Programming, Fall 2015
Quiz – 4 [10 Marks, 15 minutes]

Roll # _______________________
//bulb = 0;
ET1=0;
//TH1=0XFF;
//TL1=0XFA;

}
void main (void)
{
EA=1;
ET1= 1;
TMOD=0X50;
TH1=0XD8;
TL1=0XF0;
TR1=1;
bulb =0;
while(1);

You might also like