0% found this document useful (0 votes)
26 views3 pages

DEM - Sk-Generation of Delay Using Timer

dd
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)
26 views3 pages

DEM - Sk-Generation of Delay Using Timer

dd
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/ 3

Skill - 6

Title: Generation of delay using timer

Simulate/ test on the microcontroller from 8051 family. Generate the delay of approximately 2
sec using Timer1 in mode 1. Perform the required calculations. Toggle the LEDS connected to
port 3 with the delay of 2 sec.
What is the maximum delay can be generated using timer 1 in mode 0
If delay of 500 ms is to be generated what value have to be loaded in the TH1 and TL1 and
how many iterations are to be set for loop to repeatedly call the timer delay function
( students can do only keil coding and testing, proteus simulation is optional)

Aim/objective

Apparatus/ Tools/ Equipment’s/ Resources used- PPT for explanation of practical, Keil

Theory-

Procedure:
1. prepare the framework for the system
2. List the components required.
3) prepare the schematic
4) Write he the code in C and prepare hex file.
5) Provide this hex file to microcontroller
5) Run simulation and test the system
Code :
#include <reg51.h>
void timerdelay();
void main (void)
{
unsigned int x;
P3=0X55;
while(1)

1
{
P3=~P3;
for(x=0; x<28; x++)
0 {
timerdelay();
}
}
}

void timerdelay(void)
{
TMOD=0x10;
TR1=0;
TL1=0x00;
TH1=0x00;
while(TF1==1);
}

Observation table:
Toggling of LEDs observed at port 3. Change in the delay with different values also observed.
Students to do the calculation for given problem statement

Conclusion- System is implemented and tested


Outcomes/parameters
1) Using integrated development environment (IDE) keil.

2) Microcontroller programming using C

3) circuit connections and I/o communication

4) Integrating the code and schematic

2
3

You might also like