MS51
Nov. 28, 2019
Page
442
of 491
Rev 1.00
MS51
32K
SE
RIES
TE
CHNICAL RE
F
EREN
CE MA
N
UAL
selected ADC analog input pins pure analog inputs to allow external feeding of the analog voltage
signals. Also, the ADC clock rate needs to be considered carefully. The ADC maximum clock
frequency is listed in ADC Analog Electrical Characteristics. Clock above the maximum clock
frequency degrades ADC performance unpredictably.
An A/D conversion is initiated by setting the ADCS bit (ADCCON0.6). When the conversion is
complete, the hardware will clear ADCS automatically, set ADCF (ADCCON0.7) and generate an
interrupt if enabled. The new conversion result will also be stored in ADCRH (most significant 8 bits)
and ADCRL (least significant 4 bits). The 12-bit ADC result value is
REF
AIN
V
V
×
4095
.
By the way, digital circuitry inside and outside the device generates noise which might affect the
accuracy of ADC measurements. If conversion accuracy is critical, the noise level can be reduced by
applying the following techniques:
1. Keep analog signal paths as short as possible. Make sure to run analog signals tracks well
away from high-speed digital tracks.
2. Place the device in Idle mode during a conversion.
3. If any ADC_CHn pins are used as digital outputs, it is essential that these do not switch while
a conversion is in progress.