English
Language : 

7220 Datasheet, PDF (88/303 Pages) Renesas Technology Corp – 8-BIT SINGLE-CHIP MICROCOMPUTER
FUNCTIONAL DESCRIPTION
2.9 A-D comparator
2.9 A-D comparator
The M37221M6-XXXSP/FP has A-D comparator consists of the 6-bit D-A converter by resistance string
method and a comparator. Figure 2.9.1 shows the A-D comparator block diagram.
Data bus
A-D control register 1
Bits 0 to 2
Comparator control
P15/A-D1/INT3
P16/A-D2
P17/A-D3
P06/INT2/A-D4
P30/A-D5
P31/A-D6
Analog
signal
switch
Compa-
rator
A-D control
register 1
Bit 4
Bit 5
Bit 4
A-D control
register 2
Bit 3
Bit 2
Bit 1
Bit 0
Switch tree
Resistor ladder
Fig. 2.9.1 A-D comparator block diagram
The following explains A-D comparison method.
Œ Set “0” to corresponding bits of the direction register to use ports as analog input pins.
 Select the analog input pin with bits 0 to 2 of A-D control register 1 (address 00EE16).
Ž Set the comparison voltage “Vref” for D-A conversion by bits 0 to 5 of A-D control register 2 (address
00EF16). Table 2.9.1 shows the Vref values corresponding to the set values above.
A-D comparison starts by writing to A-D control register 2.
 This voltage comparison needs for 16 machine cycles (NOP instruction ! 8).
 The comparison result is stored in bit 4 of the A-D control register 1 (address 00EE16).
When the input voltage value is lower than the comparison voltage value, bit 4 is cleared to “0”; when the
input voltage value is higher than the comparison voltage value, bit 4 is set to “1” (refer to “Figure 2.9.2”).
7220 Group User’s Manual
2-61