Interfacing Relay With 8051
Interfacing Relay With 8051
Interfacing Relay With 8051
with 8051
Microcontroller
www.pantechsolutions.net
RELAY INTERFACE WITH 8051
org 00h
back: mov a,#00h
mov P1,a
acall secdelay
mov a,#01h
mov P1,a
acall secdelay
Sjmp back
Secdelay: mov r5,#25
H3: mov r4,#55
H2: mov r3,#ff
Djnz r3,h1
Djnz r4,h4
Djnz r5,h5ret
DelayMs(200);
}
} void DelayMs(unsigned int n)
{
unsigned int i,j;
for(j=0;j<n;j++)
{
for(i=0;i<1000;i++);
}
}