SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 88
Version 2.0
TC0 PULSE GENERATOR CONFIGURATION:
; Reset TC0 timer.
CLR
TC0M
; Clear TC0M register.
; Set TC0 rate.
MOV
A, #0
nnn
0000b
B0MOV
TC0M, A
; Set TC0 clock source.
B0BCLR
FTC0CKS
; TC0 clock source is Fcpu.
; or
B0BSET
FTC0CKS
; TC0 clock source is Fhosc.
; Set TC0C and TC0R register for pulse width.
MOV
A, #
value1
; TC0C must be equal to TC0R.
B0MOV
TC0C, A
B0MOV
TC0R, A
; Set pulse output phase.
B0BCLR
FTC0DIR
; High pulse and low idle status.
; or
B0BSET
FTC0DIR
; Low pulse and high idle status.
; Set pulse output trigger source.
B0BCLR
FCM0SF
; Pulse output trigger source is PWM0OUT bit.
; or
B0BSET
FCM0SF
; Pulse output trigger source is comparator 0 output edge.
; Enable pulse output and TC0 timer.
B0BSET
FTC0PO
; Enable pulse output function.
B0BSET
FTC0ENB
; Enable TC0 timer.