Sie sind auf Seite 1von 9

Dipesh Sinha Dept.

of Instrumentation and
141809001 Control Engineering

Assignment No.7
1) Write a program to generate 1S delay function using Timer Interrupt
method. Use that function in digital clock for to increment seconds count.
Compare the performance of polling method and interrupt method for
digital clock and comment.

Code:
#include <SST89X5XXRD2.H>
sbit pin=P1^0;
int x;
x=20;
void timer1_ISR (void)interrupt 3
{
TF1=0;
pin=~pin;
TL1=0x00;
TH1=0x00;
}
void main()
{

EA=1;
ET1=1;
TMOD=0x10;
for(x=0;x<20;x++)
TL1=0x4B;
TH1=0xFD;
TR1=1;
while(1);
}

1
Dipesh Sinha Dept. of Instrumentation and
141809001 Control Engineering

2) Write a program to send a character and receive a character to/from hyper


terminal using interrupt method.

Code:

2
Dipesh Sinha Dept. of Instrumentation and
141809001 Control Engineering

Output:

3
Dipesh Sinha Dept. of Instrumentation and
141809001 Control Engineering

3) Create an application to show functioning of external interrupt 0(/INT0).

Code:

4
Dipesh Sinha Dept. of Instrumentation and
141809001 Control Engineering

Output:
a) When no external interrupt is given.

b) When external interrupt is given.

5
Dipesh Sinha Dept. of Instrumentation and
141809001 Control Engineering

4) Consider you are using two or more than two interrupts;you are assigning
high priority to external interrupt_1 than timer_0 interrupt.Create an
application and show the importance of change in priority of the interrupts.

Code:

6
Dipesh Sinha Dept. of Instrumentation and
141809001 Control Engineering

Output:
a) When switch is open then no external interrupt occurs.

b) When switch is close then external interrupt occurs.

7
Dipesh Sinha Dept. of Instrumentation and
141809001 Control Engineering

5) Write a program to transfer your name on serial port by


interrupt method.
Code:

8
Dipesh Sinha Dept. of Instrumentation and
141809001 Control Engineering

Output:
Proteus Showing Error

Das könnte Ihnen auch gefallen