You are on page 1of 2

TIMER PROGRAMING TO

GENERATE DELAYS OF DIFFERENT TIMES

LAB # 05
Required Components:
♦ AT89C51
♦ LED Bar
♦ Keil Software
♦ Proteus

Write a program to show that blinking of led’s by 50ms delay .


Program :
#include<reg51.h>
void delay()
{
TMOD=0x01;
TL0=0xED;
TH0=0xEA;
TR0=1;
while(TF0==0);
TR0=0;
TF0=0;
}
void main()
{
while(1)
{
P1=0x00;
delay ();
P1=0xFF;
delay();
}
}

Proteus Implementation:

You might also like