BM Dept., Govt. Engg. College, Gandhinagar Page 49
EXPERIMENT NO. 12
AIM: Write a program to measure frequency of external pulses given at the timer 0 input pin.
Display pulses on the LCD connected at port P1.
Circuit diagram:
Interfacing details:
• LCD data lines are connected to port P1.
• Control lines RS (Register select) is connected with port pin P3.0, Enable line connected
with pin P3.1, read/write line connected with P3.2.
• Opto-coupler PC817 is used to provide optical isolation between signal to be measured
and microcontroller. We can connect input signal with amplitude up to 12V to the opto-
coupler. We may connect 230V AC signal by using series resistor of 47K at the input of
opto-coupler. Pulses from the opto-coupler PC817 connected to timer input pin T0.
Program:
;To measure frequency of external pulses using 89C51
;LCD Interfacing details:
;Port 1 Drives data lines, P3.0-RS,P3.1 EN,P3.2 RW
;Signal connected through optocoupler PC817 at pin T0 (P3.4)
ORG 00H
AJMP START
ORG 03H
RETI
ORG 0BH
RETI
ORG 13H
RETI
Comments to this Manuals