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