Professional Documents
Culture Documents
Lab Task 09 (Frequency 2500 HZ)
Lab Task 09 (Frequency 2500 HZ)
Theory Microcontroller:
A microcontroller is a compact integrated circuit designed to govern a specific operation in
an embedded system. A typical microcontroller includes a processor, memory and input/output
(I/O) peripherals on a single chip.
Microcontroller 8051:
8051 microcontrollers are designed by Intel in 1981. It is an 8-bit microcontroller. It is built with
40 pins DIP (dual inline package), 4kb of ROM storage and 128 bytes of RAM storage, 2 16-bit
timers. It consists of are four parallel 8-bit ports, which are programmable as well as addressable
as per the requirement. An on-chip crystal oscillator is integrated in the microcontroller having
crystal frequency of 12 MHz.
Procedure The hardware way of starting and stopping the timer by an external source is
achieved by making GATE=1 in the TMOD register
Load the TMOD value register indicating which timer (timer 0 or timer 1) is to be
used, and the timer mode (mode 2) is selected
Load the TH registers with the initial count value
Start timer
Keep monitoring the timer flag (TF) with the JNB TFx, target instruction to see
whether it is raised
Get out of the loop when TF goes high
Clear the TF flag
Go back to Step4, since mode 2 is auto-reload
Results and
Conclusions