Comparator Operation - Mitsubishi Electric M32R Series User Manual

Mitsubishi 32-bit risc single-chip microcomputers
Table of Contents

Advertisement

11

11.3.3 Comparator Operation

When comparator mode (single mode only) is selected, the A-D converter functions as a
comparator that compares analog input voltages with a preset comparison voltage.
When a comparison value is written to the successive approximation register, the A-D converter
starts 'comparating' the analog input voltage selected by the Single Mode Register 1 analog input
selection bit with the value written to the successive approximation register. Once comparate
begins, the following operation is automatically executed.
The Single Mode Register 0 or Scan Mode Register 0's A-D conversion/comparate
completion flag is cleared to 0.
The comparison voltage, Vref(note), is fed from the D-A converter into the comparator.
The comparison voltage, Vref, and the analog input voltage, VIN, are compared, with the
comparison result stored in the comparate result flag (A-D Comparate Data Register's D15).
The comparate operation stops after storing the comparison result.
The comparison result is stored in the A-D Comparate Data Register (AD0CMP, AD1CMP)'s
corresponding bit.
Note: The comparison voltage, Vref (the voltage fed from the D-A converter into the comparator), is
determined according to changes of the content of the A-D Successive Approximation Register. Shown
below are the equations used to calculate the comparison voltage, Vref.
• When the content of the A-D Successive Approximation Register = 0
Vref [V] = 0
• When the content of the A-D Successive Approximation Register = 1 to 1,023
Vref [V] = (reference voltage VREF / 1,024) x (content of the A-D Successive Approximation Register - 0.5)
If Vref < VIN, then the comparate result flag = 0
If Vref > VIN, then the comparate result flag = 1
11-44
11.3 Functional Description of A-D Converters
A-D CONVERTERS
Ver.0.10

Advertisement

Table of Contents
loading

Table of Contents