
R01UH0336EJ0102 Rev.1.02
Page 1302 of 1538
Jul 17, 2014
V850E2/PG4-L
Section 23 A/D Converter
(4)
Diagnosis of Channel Sample and Hold Circuit
For the channel sample and hold function, refer to Section 23.3.12, Channel
Sample and Hold Function.
The ADCAn can diagnose the channel sample and hold circuit. The outline is
Diagnosis of the sample and hold circuits of the channels in use is executed by
following the procedures under “Step 1” and “Step 2” below (conversion when
the channel’s sample and hold function is enabled or disabled) and using the
DIAGOUT0 to DIAGOUT2 signals.
The following examples are for when channels 1, 2, 3 and 7 are in use.
Step 1
[Initial settings]
• Set the ADCAnCTL1.ADCAnGPS bit to 1 (power to ADCAn is on).
• Specify the start trigger as the software trigger and the mode of A/D
conversion as one-shot conversion (CG0).
• Set the ADCAnIOC0 register to 0000 000E
H
so that the A/D conversion end
interrupt (INTADCAnT0) is generated. Set the ADCAnIOC1 register to
0000 0080
H
so that the A/D conversion end interrupt (INTADCAnT1) is
generated. Every time A/D conversion is completed, an interrupt must be
generated.
• Set the ADCAnCG0 register to 0000 000E
H
(selecting channels 1, 2, and 3).
• Set the ADCAnCG1 register to 0000 0080
H
(selecting channel 7).
• Set the ADCAnDGCTL0.ADCAnPSEL[2:0] bits to 001
B
(selecting 2/3 AV
DD
,
1/3 AV
DD
and 1/2 AV
DD
as reference voltages DIAGOUT0, DIAGOUT1, and
DIAGOUT2, respectively).
• Set the ADCAnDGCTL1 register to 0000 000E
H
(selecting channels 1, 2,
and 3 as the channels to which the internal reference voltage is applied).
• Set the ADCAnSHCTL register to 0000 0000
H
(disabling channel S/H
function).
• Set the ADCAnCTL0. ADCAnCE bit to 1 (enabling the A/D converter).
[Flow of operation]
• The software trigger starts A/D conversion of CG1 (channel 7).
• Input the conversion trigger for CG0 (the software trigger) during conversion
on CG1, then set the ADCAnDGCTL0.ADCAnPSEL[2:0] bits to 010
B
(selecting 1/2 AV
DD
, 2/3 AV
DD
and 1/3 AV
DD
as reference voltages
DIAGOUT0, DIAGOUT1, and DIAGOUT2, respectively).
Make the settings above before A/D conversion on CG1 is completed.
• When A/D conversion on channel 1 is completed, the A/D conversion end
interrupt for CG0 (i.e. INTADCAnT0) is generated. If the circuit is operating
normally, the result of conversion will be 2/3 AV
DD
.
• When A/D conversion on channel 2 is completed, the A/D conversion end
interrupt for CG0 (i.e. INTADCAnT0) is generated. If the circuit is operating
normally, the result of conversion will be 1/3 AV
DD
.
• When A/D conversion on channel 3 is completed, the A/D conversion end
interrupt for CG0 (i.e. INTADCAnT0) is generated. If the circuit is operating
normally, the result of conversion will be 1/2 AV
DD
.
Содержание V850 Series
Страница 1556: ...V850E2 PG4 L R01UH0336EJ0102 Back Cover ...