English
Language : 

M37221M6_03 Datasheet, PDF (32/62 Pages) Renesas Technology Corp – SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER for VOLTAGE SYNTHESIZER with ON-SCREEN DISPLAY CONTROLLER
MITSUBISHI MICROCOMPUTERS
M37221M6-XXXSP
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER for VOLTAGE SYNTHESIZER
with ON-SCREEN DISPLAY CONTROLLER
A-D COMPARATOR
A-D comparator consists of 6-bit D-A converter and comparator. A-D
comparator block diagram is shown in Figure 30.
The reference voltage “Vref” for D-A conversion is set by bits 0 to 5 of
the A-D control register 2 (address 00EF16).
The comparison result of the analog input voltage and the reference
voltage “Vref” is stored in bit 4 of the A-D control register (address
00EE16).
For A-D comparison, set “0” to corresponding bits of the direction
register to use ports as analog input pins. Write the data for select of
analog input pins to bits 0 to 2 of the A-D control register 1 and write
the digital value corresponding to Vref to be compared to the bits 0 to
5 A-D control register 2. The voltage comparison starts by writing to
the A-D control register 2, and it is completed after 16 machine cycles
(NOP instruction ! 8).
7
0
A-D control register 2
(AD2: address 00EF16)
D-A converter set bits
Refer to Table 7.
Fig. 29. Structure of A-D control register 2
7
0
Table 7. Relation between contents of A-D control register 2 and
A-D control register 1
(AD1: address 00EE16)
reference voltage “Vref”
Analog input pin selection bits
b2 b1 b0
0 0 0 : A-D1
0 0 1 : A-D2
0 1 0 : A-D3
0 1 1 : A-D4
1 0 0 : A-D5
1 0 1 : A-D6
1 1 0:
1 1 1 : Do not set.
Storage bit of comparison result
0 : Input voltage < reference voltage
1 : Input voltage > reference voltage
Bit 5
0
0
0
A-D control register 2
Bit 4 Bit 3 Bit 2 Bit 1
0
0
0
0
0
0
0
0
0
0
0
1
Bit 0
0
1
0
Reference
voltage “Vref”
1/128 VCC
3/128 VCC
5/128 VCC
1
1
1
1
0
1
123/128 VCC
1
1
1
1
1
0
125/128 VCC
1
1
1
1
1
1
127/128 VCC
Fig. 28. Structure of A-D control register 1
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. 30. A-D comparator block diagram
31