Lab 9B Counting Pulses: Lab Manual For "The 8051 Microcontroller .."
Lab 9B Counting Pulses: Lab Manual For "The 8051 Microcontroller .."
COUNTING PULSES
OBJECTIVES:
To program the 8051 timer/counter as an event counter.
.
REFERENCE:
Mazidi and McKinlay, The 8051 Microcontroller ., Chapter 9.
MATERIALS:
MDE8051 Trainer
8051 Keil Compiler
Square wave generator
For this lab you need an external source of the square wave. This can be
from a signal generator (or some call it a function generator).
ACTIVITY 1
Connect the square wave from function generator to pin P3.4 for Timer
0 and set the frequency to 1 Hz. Write and run a program for counter/timer 0
to count up from 00 to a maximum of 255 (FFH) as each pulse is fed into the
8051. The count is displayed in binary on the 8 LEDS of 8051 Trainer. Notice
that the binary numbers displayed for the count goes from 00 to FF
(00000000- 11111111 in binary or 00 -255 in decimal).
LAB 9B
WORKSHEET
Name:
Date:
Class: