38.2 ADC Operation

The High Speed Successive Approximation Register (SAR) ADC is designed to support power conversion and motor control applications and consists of one shared ADC module. The shared ADC module has multiple analog inputs connected to its S&H circuit through a multiplexer. Multiple analog inputs share this ADC; therefore, it is termed the shared ADC module. The shared ADC module is used to measure analog signals of lower frequencies and signals that are static in nature (in other words, do not change significantly with time). However, this ADC module is capable of up to 2 Msps sample rate.

The analog inputs connected to the shared ADC module are Class 2 and Class 3 inputs. The number of inputs designated for each class depends on the specific device. For the PIC32CX-BZ2, the following arrangement is provided.

  • Class 2 = AN0 to AN5
  • Class 3 = AN6 to AN7

The property of each class of analog input is described in the following table.

Table 38-1. Analog Input Class
ADC ModuleAnalog Input Class Trigger Trigger Action
Shared ADC moduleClass 2Individual trigger source or scan triggerStarts sampling sequence or begins scan sequence
Shared ADC module with input scanClass 3Scan triggerStarts scan sequence

Class 2 and Class 3 analog input properties:

  • Class 2 inputs are used on the shared ADC module, either individually triggered or as part of a scan list. When used individually, they are triggered by their unique trigger selected by the ADCTRGx register.
  • The analog inputs on the shared ADC have a natural order of priority (for example, AN6 has a higher priority than AN7).
  • Class 3 inputs are used exclusively for scanning and share a common trigger source (scan trigger).
  • Class 3 analog inputs share both the ADC module and the trigger source; therefore, the only method possible to convert them is to scan them sequentially for each incoming scan trigger event, where scanning occurs in the natural order of priority.
  • The arrival of a trigger in the shared ADC module only starts the sampling. When the trigger arrives, the ADC module goes into sampling mode for the sampling time decided by the SAMC[9:0] bits (ADCCON2[25:16]). At the end of sampling, the ADC starts conversion. Upon completion of conversion, the ADC module is used to convert the next in line Class 2 or Class 3 inputs according to the natural order of priority. When a shared analog input (Class 2 or Class 3) has completed all conversion and no trigger is pending, the ADC module is disconnected from all analog inputs
    Figure 38-2. Sample and Conversion Sequence for Shared ADC Modules