English
Language : 

4513_03 Datasheet, PDF (55/210 Pages) Renesas Technology Corp – 4-BIT SINGLE-CHIP MICROCOMPUTER
HARDWARE
FUNCTION BLOCK OPERATIONS
Table 15 A-D control registers
A-D control register Q1
at reset : 00002
at RAM back-up : state retained
R/W
Q13 Not used
0
This bit has no function, but read/write is enabled.
1
Q12Q11Q10
Selected pins
Q12
0 0 0 AIN0
0 0 1 AIN1
0 1 0 AIN2
Q11 Analog input pin selection bits (Note 2) 0 1 1 AIN3
1 0 0 AIN4 (Not available for the 4513 Group)
1 0 1 AIN5 (Not available for the 4513 Group)
Q10
1 1 0 AIN6 (Not available for the 4513 Group)
1 1 1 AIN7 (Not available for the 4513 Group)
A-D control register Q2
at reset : 00002
at RAM back-up : state retained
R/W
0
Q23 A-D operation mode selection bit
1
Q22
P43/AIN7 and P42/AIN6 pin function selec-
0
tion bit (Not used for the 4513 Group)
1
Q21
P41/AIN5 pin function selection bit
0
(Not used for the 4513 Group)
1
Q20
P40/AIN4 pin function selection bit
0
(Not used for the 4513 Group)
1
Notes 1: “R” represents read enabled, and “W” represents write enabled.
2: Select AIN4–AIN7 with register Q1 after setting register Q2.
A-D conversion mode
Comparator mode
P43, P42
(read/write enabled for the 4513 Group)
AIN7, AIN6/P43, P42 (read/write enabled for the 4513 Group)
P41
(read/write enabled for the 4513 Group)
AIN5/P41
(read/write enabled for the 4513 Group)
P40
(read/write enabled for the 4513 Group)
AIN4/P40
(read/write enabled for the 4513 Group)
(1) Operating at A-D conversion mode
The A-D conversion mode is set by setting the bit 3 of register Q2 to “0.”
(2) Successive comparison register AD
Register AD stores the A-D conversion result of an analog input in
10-bit digital data format. The contents of the high-order 8 bits of
this register can be stored in register B and register A with the
TABAD instruction. The contents of the low-order 2 bits of this reg-
ister can be stored into the high-order 2 bits of register A with the
TALA instruction. However, do not execute this instruction during A-
D conversion.
When the contents of register AD is n, the logic value of the com-
parison voltage Vref generated from the built-in DA converter can
be obtained with the reference voltage VDD by the following for-
mula:
Logic value of comparison voltage Vref
Vref = VDD ! n
1024
n: The value of register AD (n = 0 to 1023)
(4) A-D conversion start instruction (ADST)
A-D conversion starts when the ADST instruction is executed. The
conversion result is automatically stored in the register AD.
(5) A-D control register Q1
Register Q1 is used to select one of analog input pins. The 4513
Group does not have AIN4–AIN7. Accordingly, do not select these
pins with register Q1.
(6) A-D control register Q2
Register Q2 is used to select the pin function of P40/AIN4, P41/
AIN5, P42/AIN6, and P43/AIN7. The A-D conversion mode is se-
lected when the bit 3 of register Q2 is “0,” and the comparator
mode is selected when the bit 3 of register Q2 is “1.” After set this
register, select the analog input with register Q1.
Even when register Q2 is used to set the pins for analog input,
P40/AIN4–P43/AIN7 continue to function as P40–P43 I/O. Accord-
ingly, when any of them are used as I/O port P4 and others are
used as analog input pins, make sure to set the outputs of pins that
are set for analog input to “1.” Also, for the port input, the port input
function of the pin functions as analog input is undefined.
(3) A-D conversion completion flag (ADF)
A-D conversion completion flag (ADF) is set to “1” when A-D con-
version completes. The state of ADF flag can be examined with the
skip instruction (SNZAD). Use the interrupt control register V2 to
select the interrupt or the skip instruction.
The ADF flag is cleared to “0” when the interrupt occurs or when
the next instruction is skipped with the skip instruction.
1-42
4513/4514 Group User’s Manual