欢迎访问ic37.com |
会员登录 免费注册
发布采购

SN8P1604AK 参数 Datasheet PDF下载

SN8P1604AK图片预览
型号: SN8P1604AK
PDF下载: 下载PDF文件 查看货源
内容描述: 8位微控制器 [8-Bit Micro-Controller]
分类和应用: 微控制器
文件页数/大小: 94 页 / 531 K
品牌: SONIX [ SONIX TECHNOLOGY COMPANY ]
 浏览型号SN8P1604AK的Datasheet PDF文件第60页浏览型号SN8P1604AK的Datasheet PDF文件第61页浏览型号SN8P1604AK的Datasheet PDF文件第62页浏览型号SN8P1604AK的Datasheet PDF文件第63页浏览型号SN8P1604AK的Datasheet PDF文件第65页浏览型号SN8P1604AK的Datasheet PDF文件第66页浏览型号SN8P1604AK的Datasheet PDF文件第67页浏览型号SN8P1604AK的Datasheet PDF文件第68页  
SN8P1600  
8-bit micro-controller  
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  
B0MOV  
MOV  
A,#01100000B  
TC1M,A  
A,#0x00  
; Set the TC1 rate to Fcpu/4  
;First Time Initial TC0  
B0MOV  
TC1C,A  
MOV  
A,#30  
; Set the PWM duty to 30/256  
B0MOV  
TC1R,A  
B0BCLR  
B0BSET  
B0BSET  
FTC1OUT  
FPWM1OUT  
FTC1ENB  
; Disable TC1OUT function.  
; Enable PWM1 output to P5.3 and disable P5.3 I/O function  
; 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  
B0MOV  
A, #30H  
TC1R, A  
; Input a number using B0MOV instruction.  
INCMS  
B0MOV  
B0MOV  
BUF1  
A, BUF1  
TC1R, A  
; Get the new TC1R value from the BUF1 buffer defined by  
; programming.  
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.  
SONiX TECHNOLOGY CO., LTD  
Page 64  
Revision 1.94  
 复制成功!