NEC PD17062 Manuale Utente

Pagina di 296
235
µ
PD17062
19.3   REFERENCE VOLTAGE SETTING REGISTER (ADCR)
The ADCR is a 4-bit register to specify a reference voltage for the A/D converter.  It is mapped at peripheral
address 02H.  Data is written to and read from the ADCR register through the data buffer using the “PUT”
and “GET” instructions respectively.  The data transfer between the ADCR and DBF is performed in 8-bit units
although the ADCR is a 4-bit register.  In other words, 8-bit data is transferred through the DBF1 (0EH) and
DBF0 (0FH).  To be specific, when the “GET DBF, ADCR” instruction is executed to read from the ADCR register,
the content of the ADCR is sent to the DBF0 and 0000B is sent to the DBF1.  Similarly, when the “PUT ADCR,
DBF” instruction is executed, the data in the DBF0 is sent to the ADCR; the DBF1 may contain any data.
The ADCR is undefined at power-on.  At a clock stop and CE reset, it retains the previous data.
19.4   COMPARISON REGISTER (ADCCMP)
The ADCCMP is a register that holds the output of a comparator which compares an input voltage at the
ADC pin with the reference voltage (V
REF
).  It is mapped at bit b0 (LSB) of the register file at address 21H.  The
ADCCMP is a 1-bit read-only register; it cannot be written to.  The PEEK instruction is executed to read data
from the ADCCMP into a window register.  At this point, the ADC pin select data is also read into the upper
3 bits of the window register.
The window register will receive the ADCCMP content as follows:
ADCCMP = 0 when input voltage < reference voltage
ADCCMP = 1 when input voltage 
 reference voltage