ht82a836r Holtek Semiconductor Inc., ht82a836r Datasheet - Page 57

no-image

ht82a836r

Manufacturer Part Number
ht82a836r
Description
Usb Audio Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
HT82A836R
Manufacturer:
HOLTEK/合泰
Quantity:
20 000
Programming Considerations
When programming, special attention must be given to
the A/D channel selection bits in the ADCR register. This
ability to reduce power by turning off the internal A/D
function by clearing the A/D channel selection bits may
be an important consideration in battery powered appli-
cations.
Another important programming consideration is that
when the A/D channel selection bits change value the
A/D converter must be re-initialised. This is achieved by
pulsing the START bit in the ADCR register immediately
after the channel selection bits have changed state.
Example: using an EOCB polling method to detect the end of conversion for the HT82A836R.
Start_conversion:
Polling_EOC:
Rev. 1.00
clr EADI
mov a,00000001 B
mov ACSR,a
mov a,00100000B
mov ADCR,a
clr START
Set START
clr START
sz EOCB
jmp polling_EOC
mov a,ADRH
Adr_buffer_h,a
mov a,ADRL
mov adr_buffer_l,a
jmp start_conversion
:
:
:
:
:
; disable ADC interrupt
; setup the ACSR register to select f
; clock
; setup the ADCR register to power up the A/D
; converter
; and select AN0 to be connected to the A/D
; converter
; the following START signal (0-1-0) must be issued
; within 10 instruction cycles
; reset A/D
; start A/D
; poll the ADCR register EOCB bit to detect end
; of A/D conversion
; continue polling
; read conversion result high byte value from the
; ADRH register
; save result to user defined memory
; read conversion result low byte value from the
; ADRL register
; save result to user defined memory
; start next A/D conversion
57
The exception to this is where the channel selection bits
are all cleared, in which case the A/D converter is not re-
quired to be re-initialised.
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.
HT82A836R
SYS
/8 as the A/D
March 20, 2008

Related parts for ht82a836r