English
Language : 

SN8P2608 Datasheet, PDF (85/112 Pages) SONiX Technology Company – 8-Bit Micro-Controller
) Set TC1 timer function mode.
B0BSET
FTC1IEN
or
B0BSET
FTC1OUT
or
B0BSET
FPWM1OUT
) Enable TC1 timer.
B0BSET
FTC1ENB
SN8P2608
8-Bit Micro-Controller
; Enable TC1 interrupt function.
; Enable TC1OUT (Buzzer) function.
; Enable PWM function.
; Enable TC1 timer.
8.3.7 TC1 TIMER NOTICE
When TC1C value changes from “0xFF” to not “0xFF”, TC1IRQ is set “1” whether TC1 is operating or not. If TC1IRQ =
0 and TC1C is changed by program, TC1IRQ might be set as TC1C is from “0xFF” to not “0xFF”. The condition makes
unexpected TC1 interrupt occurring.
¾ Example: TC1C = 0xFF and TC1IRQ = 0. TC1IRQ will set as “1” when TC1C is cleared by program (TC1C =
0).
MOV
B0MOV
A, #0
TC1C, A
; Clear TC1C.
; TC1IRQ changed from “0” to “1”.
B0BSET
FTC1IEN
; Enable TC1 interrupt function and system jumps to interrupt
; vector (ORG 8) at next cycle.
If TC1C changing in system operating duration is necessary, to disable TC1 interrupt function (TC1IEN = 0) before
changing TC1C value. The solution can avoid unexpected TC1 interrupt occurring and example is as following.
¾ Example: TC1C = 0xFF and TC1IRQ = 0. Clearing TC1C must be after TC1 interrupt disable.
B0BCLR
FTC1IEN
; Disable TC1 interrupt function.
MOV
B0MOV
A, #0
TC1C, A
; Clear TC1C.
; TC1IRQ changed from “0” to “1”.
B0BCLR
FTC1IRQ
; Clear TC1IRQ flag.
B0BSET
…
…
FTC1IEN
; Enable TC1 interrupt function.
’ Note: Disable TC1 interrupt function first, and load new TC1C value into TC1C buffer. This way can avoid
unexpected TC1 interrupt occurring.
8.4 PWM1 MODE
SONiX TECHNOLOGY CO., LTD
Page 85
Version 1.4