Professional Documents
Culture Documents
M Usama Farooq
BS EE 5 th (B)
MP and MC LAB
Submitted to Rizwan Gillani
LAB#3
Task#3.1
#include<reg51.h>
void delay()
{ TMOD=0x01;
TL0=0xfd;
TH0=0x4b;
TR0=1;
while(TF0==0);
TR0=0;
TF0;
void main()
P2=0xff;
delay();
P2=0x00;
delay();
}
Task#3.2
#include<reg51.h>
void main()
int i;
P2=0x7f;
for(i=0;i<3500;i++);
P3=0x00;
for (i=0;i<3500;i++);