SN8P2501D
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 72
Version 1.5
8.3 TC0 8-BIT TIMER/COUNTER
8.3.1 OVERVIEW
The TC0 timer is an 8-bit binary up timer with basic timer, event counter, buzzer and PWM functions. The basic timer
function supports flag indicator (TC0IRQ bit) and interrupt operation (interrupt vector). The interval time is
programmable through TC0M, TC0C, TC0R registers. The event counter is changing TC0 clock source from system
clock (Fcpu) to external clock like signal (e.g. continuous pulse, R/C type oscillating signal
…). TC0 becomes a counter
to count external clock number to implement measure application. TC0 also builds in buzzer and PWM functions. The
cycle/resolution of buzzer and PWM are controlled by TC0 timer clock rate and TC0R registers, so the buzzer and
PWM with good flexibility to implement IR carry signal, motor control and brightness adjuster
…The main purposes of
the TC0 timer are as following.
8-bit programmable up counting timer:
Generate time-out at specific time intervals based on the selected clock
frequency.
Interrupt function:
TC0 timer function supports interrupt function. When TC0 timer occurs overflow, the TC0IRQ
actives and the system points program counter to interrupt vector to do interrupt sequence.
Event Counter:
The event counter function counts the external clock counts.
PWM output:
The PWM is duty/cycle programmable controlled by T0rate and TC0R registers.
Buzzer output:
The Buzzer output signal is 1/2 cycle of TC0 interval time.
Green mode function:
All TC0 functions (timer, PWM, Buzzer, event counter, auto-reload) keep running in green
mode and no wake-up function.
Fcpu
TC0 Rate
(Fcpu/2~Fcpu/256)
INT0
(Schmitter Trigger)
TC0CKS
TC0ENB
CPUM0,1
TC0C
8-Bit Binary Up
Counting Counter
TC0R Reload
Data Buffer
Up Counting
Reload Value
TC0 Time Out
Compare
ALOAD0
R
S
TC0 Time Out
Auto. Reload
TC0 / 2
Buzzer
Internal P5.4 I/O Circuit
P5.4
PWM
PWM0OUT
TC0OUT
ALOAD0, TC0OUT
Load