MP Project
MP Project
SEMESTER: 4
21UIT406-MICROPROCESSOR BASED
SYSTEM DESIGN
Total
Problem
Identification
& analysis
Implementation
&
Demonstration
Evaluating
Problems
Aim:
To Write an ALP using 8051 for Timer / Counter and to Find the
value for TMOD if we want to program Timer 0 in mode 2, use 8051
XTAL for the clock source, and use instructions to start and stop the
timer. And also
Solution:
The role of the TMOD register, we will look at the timer’s modes
and how they are programmed
to create a time delay.
Because modes 1 and 2 are so widely used, we describe each
of them in detail.
Mode 1 programming
The following are the characteristics and operations of mode 1:
1)It is a 16-bit timer; therefore, it allows values of 0000 to FFFFH to be
loaded into the timer’s registers TL and TH.
2)After TH and TL are loaded with a 16-bit initial value, the timer must
be started. This is done by “SETB TRO” for Timer 0 and “SETB TR1″
for Timer 1.
Timer
The 8051 uses two registers to handle and control the working of the
Timer registers. One of these registers is
TMOD. The other is TCON.
• TMOD (Timer mode register) – The timer registers can
operate in four different modes.
We’ll take a look at all these modes in a jiffy. But the point is,
the selection of the functioning
mode is done in this register. Additionally, the overall function
of the timer registers, whether
to work as timers or counters, is done here too.
Mode 2:
Mode 3:
RESULT:
Thus , the successfully verified.