参数资料
型号: SN8P1603K
厂商: SONIX Technology Co., Ltd.
英文描述: 8-Bit Micro-Controller
中文描述: 8位微控制器
文件页数: 64/94页
文件大小: 540K
代理商: SN8P1603K
SN8P1600
8-bit micro-controller
SONiX TECHNOLOGY CO., LTD
Page 64
Revision 1.94
PWM PROGRAM DESCRIPTION
Example: Setup PWM1 output from TC1 to PWM1OUT (P5.3). The external high-speed oscillator clock is
4MHz. The duty of PWM is 30/256. The PWM frequency is about 1KHz. The PWM clock source is from
external oscillator clock. TC1 rate is Fcpu/4. The TC1RATE2~TC1RATE1 = 110. TC1C = TC1R = 30.
MOV
A,#01100000B
B0MOV
TC1M,A
; Set the TC1 rate to Fcpu/4
MOV
A,#0x00
;First Time Initial TC0
B0MOV
TC1C,A
MOV
A,#30
; Set the PWM duty to 30/256
B0MOV
TC1R,A
B0BCLR
FTC1OUT
; Disable TC1OUT function.
B0BSET
FPWM1OUT
; Enable PWM1 output to P5.3 and disable P5.3 I/O function
B0BSET
FTC1ENB
; Enable TC1 timer
Note1: The TC1R is write-only register. Don’t process them using INCMS, DECMS instructions.
Note2: Set TC1C at initial is to make first duty-cycle correct. After TC1 is enabled, don’t modify TC1R
value to avoid duty cycle error of PWM output.
Example: Modify TC1R registers’ value.
MOV
A, #30H
; Input a number using B0MOV instruction.
B0MOV
TC1R, A
INCMS
BUF1
; Get the new TC1R value from the BUF1 buffer defined by
B0MOV
A, BUF1
; programming.
B0MOV
TC1R, A
Note3: That is better to set the TC1C and TC1R value together when PWM1 duty modified. It protects the
PWM1 signal no glitch as PWM1 duty changing.
Note4: The TC1OUT function must be set “0” when PWM1 output enable.
Note5: The PWM can work with interrupt request.
相关PDF资料
PDF描述
SN8P1603P 8-Bit Micro-Controller
SN8P1603Q 8-Bit Micro-Controller
SN8P1603S 8-Bit Micro-Controller
SN8P1603X 8-Bit Micro-Controller
SN8P1604 8-Bit Micro-Controller
相关代理商/技术参数
参数描述
SN8P1603P 制造商:SONIX 制造商全称:SONIX 功能描述:8-Bit Micro-Controller
SN8P1603Q 制造商:SONIX 制造商全称:SONIX 功能描述:8-Bit Micro-Controller
SN8P1603S 制造商:SONIX 制造商全称:SONIX 功能描述:8-Bit Micro-Controller
SN8P1603X 制造商:SONIX 制造商全称:SONIX 功能描述:8-Bit Micro-Controller
SN8P1604 制造商:SONIX 制造商全称:SONIX 功能描述:8-Bit Micro-Controller