MG87FE/L2051 MEGAWIN [Megawin Technology Co., Ltd], MG87FE/L2051 Datasheet - Page 23

no-image

MG87FE/L2051

Manufacturer Part Number
MG87FE/L2051
Description
8-bits microcontroll
Manufacturer
MEGAWIN [Megawin Technology Co., Ltd]
Datasheet
10.
MG87FE/L2051/4051/6051 has two Timers/Counters: Timer 0 and Timer 1. All of them can be configured as
timers or event counters.
In the “timer” function, the register is incremented every machine cycle. In other words, it is to count the machine
cycle. Due to 12(6) oscillator periods in a machine cycle, the count rate is 1/12(1/6) of the oscillator frequency.
In the “counter” function, the register is incremented in response to a 1-to-0 transition at its corresponding
external input pin, T0 or T1. In this function, the external input is sampled during S5P2 of every machine cycle.
When the samples show a high in one cycle and a low in the next cycle, the count is incremented. The new count
value appears in the register during S3P1 of the cycle following the one in which the transition was detected.
10.1. Timer0 and Timer1
10.1.1. Mode 0 Structure
The timer register is configured as a 13-bit register. As the count rolls over from all 1s to all 0s, it sets the timer
interrupt flag TFx. The counted input is enabled to the timer when TRx = 1 and either GATE=0 or INTx = 1. Mode
0 operation is the same for Timer0 and Timer1.
10.1.2. Mode 1 Structure
Mode1 is the same as Mode0, except that the timer register is being run with all 16 bits.
This document information is the intellectual property of Megawin Technology.
© Megawin Technology Co., Ltd. 2009 All rights reserved.
QP-7300-03D
23/56
/INTx Pin
/INTx Pin
SYSCLK
SYSCLK
Tx Pin
Tx Pin
GATE
GATE
TRx
TRx
Timers/Counters
MEGAWIN
MAKE YOU WIN
12
12
C//T=0
C//T=1
C//T=0
C//T=1
TLx[4:0]
TLx[7:0]
THx[7:0]
THx[7:0]
MG87FE/L2051/4051/6051
Overflow
Overflow
Preliminary Ver 1.00
TFx
TFx
x = 0 or 1
x = 0 or 1
Interrupt
Interrupt

Related parts for MG87FE/L2051