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

HT46R065D 参数 Datasheet PDF下载

HT46R065D图片预览
型号: HT46R065D
PDF下载: 下载PDF文件 查看货源
内容描述: 增强A / D型MCU,具有高电流LED驱动器 [Enhanced A/D Type MCU with High Current LED Driver]
分类和应用: 驱动器
文件页数/大小: 114 页 / 744 K
品牌: HOLTEK [ HOLTEK SEMICONDUCTOR INC ]
 浏览型号HT46R065D的Datasheet PDF文件第65页浏览型号HT46R065D的Datasheet PDF文件第66页浏览型号HT46R065D的Datasheet PDF文件第67页浏览型号HT46R065D的Datasheet PDF文件第68页浏览型号HT46R065D的Datasheet PDF文件第70页浏览型号HT46R065D的Datasheet PDF文件第71页浏览型号HT46R065D的Datasheet PDF文件第72页浏览型号HT46R065D的Datasheet PDF文件第73页  
HT46R064D/065D/066D  
Enhanced A/D Type 8-Bit OTP MCU with LED Driver  
A/D Programming Example  
The following two programming examples illustrate how to setup and implement an A/D conversion.  
In the first example, 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 an EOCB polling method to detect the end of conversion  
clr  
mov  
mov  
mov  
mov  
mov  
EADI  
a,00000001B  
ACSR,a  
PCR, 00000001B  
a,00000000B  
ADCR,a  
; disable ADC interrupt  
; select fSYS/8 as A/D clock and ADONB=0  
; setup ADCR register to configure Port as A/D inputs  
; and select AN0 to be connected to the A/D converter  
:
:
Start_conversion:  
clr  
set  
clr  
START  
START  
START  
; reset A/D  
; start A/D  
Polling_EOC:  
sz  
EOCB  
; poll the ADCR register EOCB bit to detect end  
; of A/D conversion  
; continue polling  
; read low byte conversion result value  
; save result to user defined register  
; read high byte conversion result value  
; save result to user defined register  
jmp  
mov  
mov  
mov  
mov  
polling_EOC  
a,ADRL  
adrl_buffer,a  
a,ADRH  
adrh_buffer,a  
:
start_conversion ; start next A/D conversion  
jmp  
Note: To power off ADC module, it is necessary to set ADONB as ²1².  
Example: using the interrupt method to detect the end of conversion  
clr  
mov  
mov  
mov  
mov  
mov  
EADI  
a,00000001B  
ACSR,a  
PCR,00000001B  
a,00000000B  
ADCR,a  
; disable ADC interrupt  
; select fSYS/8 as A/D clock and ADONB=0  
setup ADCR register to configure Port as A/D inputs  
; and select AN0 to be connected to the A/D  
:
:
Start_conversion:  
clr  
set  
clr  
clr  
set  
set  
START  
START  
START  
ADF  
EADI  
EMI  
:
; reset A/D  
; start A/D  
; clear ADC interrupt request flag  
; enable ADC interrupt  
; enable global interrupt  
:
:
; ADC interrupt service routine  
ADC_:  
mov  
mov  
mov  
acc_stack,a  
a,STATUS  
status_stack,a  
:
; save ACC to user defined memory  
; save STATUS to user defined memory  
:
a,ADRL  
adrl_buffer,a  
a,ADRH  
adrh_buffer,a  
mov  
mov  
mov  
mov  
; read low byte conversion result value  
; save result to user defined register  
; read high byte conversion result value  
; save result to user defined register  
:
:
EXIT_ISR:  
mov  
mov  
a,status_stack  
STATUS,a  
a,acc_stack  
ADF  
; restore STATUS from user defined memory  
; restore ACC from user defined memory  
; clear ADC interrupt flag  
mov  
clr  
reti  
Note: To power off ADC module, it is necessary to set ADONB as ²1².  
Rev. 1.00  
64  
January 12, 2011  
 复制成功!