HT49CV5 Holtek Semiconductor, HT49CV5 Datasheet - Page 27

no-image

HT49CV5

Manufacturer Part Number
HT49CV5
Description
A/D
Manufacturer
Holtek Semiconductor
Datasheet
Note:
The following programming example illustrates how to setup and implement an A/D conversion. The method of polling
the EOCB bit in the ADCR register is used to detect when the conversion cycle is complete.
Example: using EOCB Polling Method to detect end of conversion
Start_conversion:
Polling_EOC:
Rev. 1.20
Register
ADR
clr
mov
mov
mov
mov
clr
set
clr
sz
jmp
mov
mov
jmp
PCR1
D0~D7 is the A/D conversion result data bit LSB~MSB.
0
0
1
1
EADI
a,00000001B
ACSR,a
a,00110000B
ADCR,a
:
:
START
START
START
EOCB
polling_EOC
a,ADR
adr_buffer,a
:
:
Start_conversion
Bit7
D7
ACS1
0
0
1
1
PCR0
0
1
0
1
Bit6
D6
; disable ADC interrupt
; setup the ACSR register to select f
; setup ADCR register to configure Port PB0~PB3 as A/D inputs
; and select AN0 to be connected to the A/D converter
; reset A/D
; start A/D
; poll the ADCR register EOCB bit to detect end of A/D conversion
; continue polling
; read conversion result from the ADR register
; save result to user defined memory
; start next A/D conversion
; As the Port B channel bits have changed the following START
; signal (0-1-0) must be issued within 10 instruction cycles
Analog Input Channel Selection
Bit5
D5
AN3
PB3
PB3
PB3
Port B Configuration
3
Bit4
ACS0
D4
27
0
1
0
1
PB2
PB2
PB2
AN2
2
Bit3
D3
SYS
/8 as the A/D clock
Bit2
D2
AN1
AN1
PB1
PB1
HT49RV5/HT49CV5
1
Analog Channel
Bit1
AN0
AN1
AN2
AN3
D1
April 14, 2006
PB0
AN0
AN0
AN0
0
Bit0
D0

Related parts for HT49CV5