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

HT46C63 参数 Datasheet PDF下载

HT46C63图片预览
型号: HT46C63
PDF下载: 下载PDF文件 查看货源
内容描述: A / D with LCD型8位MCU [A/D with LCD Type 8-Bit MCU]
分类和应用: 微控制器和处理器
文件页数/大小: 44 页 / 323 K
品牌: HOLTEK [ HOLTEK SEMICONDUCTOR INC ]
 浏览型号HT46C63的Datasheet PDF文件第19页浏览型号HT46C63的Datasheet PDF文件第20页浏览型号HT46C63的Datasheet PDF文件第21页浏览型号HT46C63的Datasheet PDF文件第22页浏览型号HT46C63的Datasheet PDF文件第24页浏览型号HT46C63的Datasheet PDF文件第25页浏览型号HT46C63的Datasheet PDF文件第26页浏览型号HT46C63的Datasheet PDF文件第27页  
HT46R63/HT46C63  
The following two programming examples illustrate how to setup and implement an A/D conversion. In the first exam-  
ple, the method of polling the EOCB bit in the ADCR register is used to detect when the conversion cycle is complete,  
whereas in the second example, the A/D interrupt is used to determine when the conversion is complete.  
Example: using EOCB Polling Method to detect end of conversion  
clr INTC0.3  
mov a,00100000B  
mov ADCR,a  
; disable A/D interrupt in interrupt control register  
; setup ADCR register to configure Port PB0~PB3 as A/D inputs and select  
; AN0 to be connected to the A/D converter  
mov a,00000001B  
mov ACSR,a  
; setup the ACSR register to select fSYS/8 as the A/D clock  
Start_conversion:  
clr ADCR.7  
set ADCR.7  
clr ADCR.7  
; reset A/D  
; start A/D  
Polling_EOC:  
sz ADCR.6  
; poll the ADCR register EOCB bit to detect end of A/D conversion  
; continue polling  
jmp polling_EOC  
mov a,ADR  
mov adr_buffer,a  
; read conversion result from the high byte ADR register  
; save result to user defined register  
:
:
jmp start_conversion  
; start next A/D conversion  
Example: using Interrupt method to detect end of conversion  
set INTC0.0  
set INTC0.3  
; interrupt global enable  
; enable A/D interrupt in interrupt control register  
mov a,00100000B  
mov ADCR,a  
; setup ADCR register to configure Port PB0~PB3 as A/D inputs and select  
; AN0 to be connected to the A/D converter  
mov a,00000001B  
mov ACSR,a  
; setup the ACSR register to select fSYS/8 as the A/D clock  
start_conversion:  
clr ADCR.7  
set ADCR.7  
; reset A/D  
; start A/D  
clr ADCR.7  
:
:
; interrupt service routine  
EOC_service routine:  
mov a_buffer,a  
; save ACC to user defined register  
; read conversion result from the high byte ADR register  
; save result to user defined register  
mov a,ADR  
mov adr_buffer,a  
clr ADCR.7  
set ADCR.7  
clr ADCR.7  
; reset A/D  
; start A/D  
mov a,a_buffer  
reti  
; restore ACC from temporary storage  
Rev. 1.90  
23  
May 17, 2004  
 复制成功!