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

SN8F2250B 参数 Datasheet PDF下载

SN8F2250B图片预览
型号: SN8F2250B
PDF下载: 下载PDF文件 查看货源
内容描述: 8位微控制器 [8-Bit Micro-Controller]
分类和应用: 微控制器
文件页数/大小: 133 页 / 1554 K
品牌: SONIX [ SONIX TECHNOLOGY COMPANY ]
 浏览型号SN8F2250B的Datasheet PDF文件第87页浏览型号SN8F2250B的Datasheet PDF文件第88页浏览型号SN8F2250B的Datasheet PDF文件第89页浏览型号SN8F2250B的Datasheet PDF文件第90页浏览型号SN8F2250B的Datasheet PDF文件第92页浏览型号SN8F2250B的Datasheet PDF文件第93页浏览型号SN8F2250B的Datasheet PDF文件第94页浏览型号SN8F2250B的Datasheet PDF文件第95页  
SN8F2250B Series  
USB 2.0 Full-Speed 8-Bit Micro-Controller  
8.5.4 PWM PROGRAM EXAMPLE  
¾
Example: Setup PWM0 output from TC0 to PWM0OUT (P5.4). The clock source is internal 6MHz. Fcpu =  
Fosc/1. The duty of PWM is 30/256. The PWM frequency is about 6KHz. The PWM clock source is from  
external oscillator clock. TC0 rate is Fcpu/4. The TC0RATE2~TC0RATE1 = 110. TC0C = TC0R = 30.  
MOV  
B0MOV  
A,#01100000B  
TC0M,A  
; Set the TC0 rate to Fcpu/4  
; Set the PWM duty to 30/256  
MOV  
A,#30  
B0MOV  
B0MOV  
TC0C,A  
TC0R,A  
B0BCLR  
B0BCLR  
B0BSET  
B0BSET  
FTC0OUT  
FALOAD0  
FPWM0OUT  
FTC0ENB  
; Set duty range as 0/256~255/256.  
; Enable PWM0 output to P5.4 and disable P5.4 I/O function  
; Enable TC0 timer  
’
¾
Note: The TC0R is write-only register. Don’t process them using INCMS, DECMS instructions.  
Example: Modify TC0R registers’ value.  
MOV  
B0MOV  
A, #30H  
TC0R, A  
; Input a number using B0MOV instruction.  
INCMS  
NOP  
BUF0  
; Get the new TC0R value from the BUF0 buffer defined by  
; programming.  
B0MOV  
B0MOV  
A, BUF0  
TC0R, A  
’
Note: The PWM can work with interrupt request.  
SONiX TECHNOLOGY CO., LTD  
Page 91  
Version 1.1  
 
 复制成功!