SN8P2711A
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 83
Version 0.1
8.2 TIMER/COUNTER 0 (TC0)
8.2.1 OVERVIEW
The TC0 is an 8-bit binary up counting timer with double buffers. TC0 has two clock sources including internal clock
and external clock for counting a precision time. The internal clock source is from Fcpu or Fosc controlled by TC0X8
flag to get faster clock source (Fosc). The external clock is INT0 from P0.0 pin (Falling edge trigger). Using TC0M
register selects TC0C’s clock source from internal or external. If TC0 timer occurs an overflow, it will continue counting
and issue a time-out signal to trigger TC0 interrupt to request interrupt service. TC0 overflow time is 0xFF to 0X00
normally. Under PWM mode, TC0 overflow is decided by PWM cycle controlled by ALOAD0 and TC0OUT bits.
The main purposes of the TC0 timer is as following.
)
8-bit programmable up counting timer:
Generates interrupts at specific time intervals based on the selected
clock frequency.
)
External event counter:
Counts system “events” based on falling edge detection of external clock signals at the
INT0 input pin.
)
Green mode wake-up function:
TC0 can be green mode wake-up timer. System will be wake-up by TC0 time
out.
)
Buzzer output
)
PWM output
Fcpu
TC0 Rate
(Fcpu/2~Fcpu/256)
Fosc
TC0 Rate
(Fosc/1~Fosc/128)
TC0X8
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