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

SN8P2742PDB 参数 Datasheet PDF下载

SN8P2742PDB图片预览
型号: SN8P2742PDB
PDF下载: 下载PDF文件 查看货源
内容描述: [ADC, OP-amp, Comparator 8-Bit Micro-Controller]
分类和应用:
文件页数/大小: 136 页 / 3074 K
品牌: SONIX [ SONIX TECHNOLOGY COMPANY ]
 浏览型号SN8P2742PDB的Datasheet PDF文件第109页浏览型号SN8P2742PDB的Datasheet PDF文件第110页浏览型号SN8P2742PDB的Datasheet PDF文件第111页浏览型号SN8P2742PDB的Datasheet PDF文件第112页浏览型号SN8P2742PDB的Datasheet PDF文件第114页浏览型号SN8P2742PDB的Datasheet PDF文件第115页浏览型号SN8P2742PDB的Datasheet PDF文件第116页浏览型号SN8P2742PDB的Datasheet PDF文件第117页  
SN8P2740 Series  
ADC, OP-amp, Comparator 8-Bit Micro-Controller  
13.5 ADC OPERATION EXAMLPE  
ADC CONFIGURATION:  
; Reset ADC.  
CLR  
ADM  
; Clear TC0M register.  
; Set ADC clock rate and ADC resolution.  
MOV  
B0MOV  
A, #0nmn0000b  
ADR, A  
; nn: ADCKS[1:0] for ADC clock rate.  
; m: ADLEN for ADC reolution.  
; Set ADC high reference voltage source.  
B0BCLR  
FAVREFH  
; Internal Vdd.  
or  
B0BSET  
FAVREFH  
; External reference voltage.  
; Set ADC input channel configuration.  
MOV  
A, #value1  
; Set P4CON for ADC input channel.  
B0MOV  
MOV  
B0MOV  
MOV  
P4CON, A  
A, #value2  
P4M, A  
; Set ADC input channel as input mode.  
; Disable ADC input channels internal pull-up resistor.  
A, #value3  
B0MOV  
P4UR, A  
; Enable ADC.  
B0BSET  
FADCENB  
; Execute ADC 100us warm-up time delay loop.  
CALL  
100usDLY  
; 100us delay loop.  
; Select ADC input channel.  
MOV  
OR  
A, #value  
ADM, A  
; Set ADCHS[2:0] for ADC input channel selection.  
; Enable ADC input channel.  
B0BSET  
FGCHS  
; Enable ADC interrupt function.  
B0BCLR  
B0BSET  
FADCIRQ  
FADCIEN  
; Clear ADC interrupt flag.  
; Enable ADC interrupt function.  
; Start to execute ADC converting.  
B0BSET FADS  
Note:  
1.  
When ADENB is enabled, the system must be delay 100us to be the ADC warm-up time by  
program, and then set ADS to do ADC converting. The 100us delay time is necessary after  
ADENB setting (not ADS setting), or the ADC converting result would be error. Normally, the  
ADENB is set one time when the system under normal run condition, and do the delay time  
only one time.  
2.  
In power saving situation like power down mode and green mode, and not using ADC function,  
to disable ADC by program is necessary to reduce power consumption.  
SONiX TECHNOLOGY CO., LTD  
Page 113  
Version 2.0  
 复制成功!