ht82j30r Holtek Semiconductor Inc., ht82j30r Datasheet - Page 33

no-image

ht82j30r

Manufacturer Part Number
ht82j30r
Description
Ht82j30r/ht82j30a -- 16 Channel A/d Mcu With Spi Interface
Manufacturer
Holtek Semiconductor Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
HT82J30R
Manufacturer:
HOLTEK
Quantity:
155
the EOCB flag may have an undefined value, which may
produce a false end of conversion signal. To initialise
the A/D converter after the channel selection bits have
changed, then, within a time frame of one to ten instruc-
tion cycles, the START bit in the ADCR register must
first be set high and then immediately cleared to zero.
This will ensure that the EOCB flag is correctly set to a
high condition.
Summary of A/D Conversion Steps
The following summarises the individual steps that
should be executed in order to implement an A/D con-
version process.
Rev. 1.10
Step 1
Select the required A/D conversion clock by correctly
programming bits ADCS1 and ADCS0 in the ACSR
register.
Step 2
Select which channel is to be connected to the internal
A/D converter by correctly programming the ACS3~
ACS0 bits which are also contained in the ADCR register.
Step 3
Select which pins on Port B and Port C are to be used
as A/D inputs and configure them as A/D input pins by
correctly programming the PCR3~PCR0 bits in the
ACSR register.
Step 4
If the interrupts are to be used, the interrupt control
registers must be correctly configured to ensure the
A/D converter interrupt function is active. The master
interrupt control bit, EMI, in the INTC interrupt control
register must be set to 1 and the A/D converter inter-
rupt bit, EADI, in the INTC register must also be set to
Step 5
The analog to digital conversion process can now be
initialised by setting the START bit in the ADCR regis-
1 .
A/D Conversion Timing
33
Note:
The A/D conversion timing diagram shows graphically
the various stages involved in an analog to digital con-
version process and its associated timing.
The setting up and operation of the A/D converter func-
tion is fully under the control of the application program
as there are no configuration options associated with
the A/D converter. After an A/D conversion process has
been initiated by the application program, the
microcontroller internal hardware will begin to carry out
the conversion, during which time the program can con-
tinue with other functions. The time taken for the A/D
conversion is 76t
period.
Programming Considerations
When programming, special attention must be given to
the A/D channel selection bits in the ADSR register. If
these bits are all cleared to zero no external pins will be
selected for use as A/D input pins allowing the pins to be
used as normal I/O pins. When this happens the power
supplied to the internal A/D circuitry will be reduced re-
sulting in a reduction of supply current. This ability to re-
ter from 0 to 1 and then to 0 again. Note that this
bit should have been originally set to 0 .
Step 6
To check when the analog to digital conversion pro-
cess is complete, the EOCB bit in the ADCR register
can be polled. The conversion process is complete
when this bit goes low. When this occurs the A/D data
registers ADR can be read to obtain the conversion
value. As an alternative method if the interrupts are
enabled and the stack is not full, the program can wait
for an A/D interrupt to occur.
When checking for the end of the conversion
process, if the method of polling the EOCB bit in
the ADCR register is used, the interrupt enable
step above can be omitted.
AD
where t
HT82J30R/HT82J30A
AD
is equal to the A/D clock
March 13, 2008

Related parts for ht82j30r