HT46R064D/065D/066D
Enhanced A/D Type 8-Bit OTP MCU with LED Driver
A/D Clock Period (tAD
)
fSYS
ADCS1, ADCS0=00
(fSYS/2)
ADCS1, ADCS0=01
(fSYS/8)
ADCS1, ADCS0=10
(fSYS/32)
ADCS1, ADCS0=11
1MHz
2MHz
4MHz
8MHz
12MHz
Undefined
Undefined
Undefined
Undefined
Undefined
2ms
1ms
8ms
4ms
32ms
16ms
8ms
500ns
250ns*
167ns*
2ms
1ms
4ms
667ns
2.67ms
A/D Clock Period Examples
A/D Input Pins
All of the A/D analog input pins are pin-shared with the I/O pins on Port A and Port B. Bits
PCR7~PCR0 in the register, determine whether the input pins are setup as normal Port A and Port B
input/output pins or whether they are setup as analog inputs. In this way, pins can be changed under
program control to change their function from normal I/O operation to analog inputs and vice versa.
Pull-high resistors, which are setup through register programming, apply to the input pins only when
they are used as normal I/O pins, if setup as A/D inputs the pull-high resistors will be automatically
disconnected. Note that it is not necessary to first setup the A/D pin as an input in the port control
register to enable the A/D input as when the PCR7~PCR0 bits enable an A/D input, the status of the
port control register will be overridden.
Summary of A/D Conversion Steps
The following summarises the individual steps that should be executed in order to implement an A/D
conversion process.
Step 1
Select the required A/D conversion clock by correctly programming bits ADCS1 and ADCS0 in the
register.
Step 2
Select which pins are to be used as A/D inputs and configure them as A/D input pins by correctly
programming the PCR7~PCR0 bits in the ADCR register.
Step 3
Select which channel is to be connected to the internal A/D converter by correctly programming the
ACS2~ACS0 bits which are also contained in the 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, the INTC1 interrupt
control register must be set to ²1², the A/D converter interrupt bit, ADE, must also be set to ²1².
Step 5
The analog to digital conversion process can now be initialised by setting the START bit in the ADCR
register from ²0² to ²1² and then to ²0² again. Note that this bit should have been originally set to ²0².
Rev. 1.00
61
January 12, 2011