EE303 Microprocessor Interfacing & Programming,: Quiz - 4 (10 Marks, 15 Minutes)
EE303 Microprocessor Interfacing & Programming,: 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);