The 8051 Microcontroller and Embedded

(lily) #1
Department of Computer Scien

ce and Information Engineering

National Cheng Kung University, TAIWAN
HANEL

PROGRAMMING


TIMERSTMODRegister


‰Both timers 0 and 1 use the same register, called TMOD (timer mode), to set the various timer operation modes‰TMOD is a 8-bit register


¾The lower 4 bits are for Timer 0 ¾The upper 4 bits are for Timer 1¾In each case,


ƒThe lower 2 bits are used


to set the timer mode


ƒThe upper 2 bits to


specify the operation


Timer1
GATE

C/T

M1

M0

(MSB)

Timer0
GATE

C/T

M1

(LSB)M0
Free download pdf