
Rev. 1.00
50
��ne 1�� �01�
Rev. 1.00
51
��ne 1�� �01�
HT46R003B
Cost-Effective A/D 8-bit OTP MCU
HT46R003B
Cost-Effective A/D 8-bit OTP MCU
• Step 7
To check when the analog to digital conversion process 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 ADRL and ADRH 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.
Note: 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.
The accompanying diagram shows graphically the various stages involved in an analog to digital
conversion process and its associated timing.
A/D Conversion Timing
The setting up and operation of the A/D converter function 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
continue with other functions. The time taken for the A/D conversion is 16t
AD
where t
AD
is equal to
the A/D clock period.
Programming Considerations
When programming, the special attention must be given to the PCR[4:0] bits in the 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 internal A/D circuitry will be power
down. Setting the ADONB bit high has the ability to power down the internal A/D circuitry, which
may be an important consideration in power sensitive applications.
A/D Transfer Function
As the device contains a 12-bit A/D converter, its full-scale converted digitised value is equal to
FFFH. Since the full-scale analog input value is equal to the V
DD
voltage, this gives a single bit
analog input value of V
DD
divided by 4096. The diagram shows the ideal transfer function between
the analog input value and the digitised output value for the A/D converter.