42.7.5 ADCn Module Core Control Registers (ADC)

Table 42-11. Register Bit Attribute Legend
SymbolDescriptionSymbolDescriptionSymbolDescription
RReadable bitHCCleared by Hardware(Grey cell)Unimplemented
WWritable bitHSSet by HardwareXBit is unknown at Reset
KWrite to clearSSoftware settable bit
Name: CONFIGn.CORCTRL
Offset: 0x20 + n*0x20 [n=0..3]
Reset: 0x00000C00
Property: Write-Protected, Enable-Protected

Bit 3130292827262524 
  ADCDIV[6:0] 
Access R/WR/WR/WR/WR/WR/WR/W 
Reset 0000000 
Bit 2322212019181716 
  SCNRTDSSTRGLVL STRGSRC[3:0] 
Access R/WR/WR/WR/WR/WR/W 
Reset 000000 
Bit 15141312111098 
 EIRQOVREIS[2:0]SELRES[1:0]SAMC[9:8] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00001100 
Bit 76543210 
 SAMC[7:0] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 

Bits 30:24 – ADCDIV[6:0] Division Ratio for ADC Clock

ADCDIV provides the ADC analog functional clock referred to as the ADC clock or TAD, (i.e., the period of the ADC clock). It divides CTL_CLK output clock from (GCLK_ADC Period * (CTRLD.CTLCKDIV+1)) with period = TQ to produce the resulting ADC_CLK for ADC sampling and converting. It will have the period TAD given by the formula:

TAD = (GCLK_ADCx Period * (CTRLD.CTLCKDIV+1)) * (2 * ADCDIV)

Note: The ADC throughput rate FTPR = [1 / ((SAMC+2) * TAD) + ((#bits of resolution selected+1)*TAD)] / # of active AINx inputs.

Example 1:

TAD = 1/ADC_CLK = 1/75 MHz = 13.33 ns, SAMC = 0x1, SELRES = 0x3 = 12 bits, AIN0 used only ADC throughput rate

FTPR = [1 / (3TAD + 13TAD)] / 1

= 1 / 16TAD

= 1 / (16 * 13.33e-9)

= 4.6875 Msps

Example 2: (Non Interleaved Mode)

TAD = 1/ADC_CLK = 1/75 MHz = 13.33 ns, SAMC = 0x1, SELRES = 0x3 = 12 bits, AIN0 and AIN3 in single ended mode used ADC throughput rate

FTPR = [1 / (3TAD + 13TAD)] / 2

= (1 / 16 TAD) / 2

= (1 / (16 * 13.33e-9)) / 2

= 4.6875e+6

= 2.34375 Msps

Note:
  1. This bit is Enabled Protected (Writes are ignored when CTRLA.ENABLE = 1). Returns a bus error.
  2. The minimum sample rate for ADC0 is Ftpr >= 100 ksps.
  3. For optimal performance and accuracy, the user must select the maximum TAD clock supported by the device as specified in the ADC electrical specs:

    TAD = (GCLK_ADCx Period * (CTRLD.CTLCKDIV+1)) * (2 * ADCDIV)

  4. If the user wishes to control the ADC throughput rate, they must do so by modulating either CORCTRLn.SAMC or the EVSYS trigger interval or both. Do not try to do so by reducing the TAD clock frequency as this will increase the ADC conversion time allowing the charge on the ADC holding capacitor from the sampled analog input signal to leak off, attenuating the ADC result accuracy.
ValueDescription
1111111254·TQ = TAD
......
0000011TQ = TAD
0000010TQ = TAD
0000001TQ = TAD
0000000 Reserved

Bit 22 – SCNRTDS SCAN Retrigger Disable for ADC

Note:
  1. This bit is Enabled Protected: (Writes are ignored when CTRLA.ENABLE = 1). Returns a bus error.
ValueDescription
0Allows the scan cycle to restart from the beginning, lowest CSSn channel even before all of the scan channels have been measured if a new scan trigger arrives before then. If this happens then the INTENCLRn.EOSRDY flag will be set when the current scan is interrupted, and the new scan starts from the beginning of the lowest CSSn channel selected.
1Prevents an early scan trigger (arriving before of the end of the current scan) from starting a new scan cycle. The scan will includes all channels associated with ADCn which have their CHNCFG4n.TRGSRCk set to point to the Scan Trigger, i.e., CHNCFG4n.TRGSRCy[3:0] = 4’b0011, and have their associated CHNCFG2n.CSSk bit set.

Bit 21 – STRGLVL Scan Trigger High Level Sensitivity for the ScanTrigger of the ADCn (STRIGn)

Note:
  1. This bit is Enabled Protected (Writes are ignored when CTRLA.ENABLE = 1). Returns a bus error.

STRGLVL functions as follows:

ValueDescription
0SCANTRG is Positive Edge Active(the power-up value for backwards compatibility).

A positive edge on the SCANTRG will initiate a single but complete scan of all included channels.

1SCANTRG is High Level Active. So long as SCANTRG stays high, the entire scan will re-trigger.

Bits 19:16 – STRGSRC[3:0] SCAN Trigger Source Select for the SCANTRG

These bits select the trigger source for the scan trigger SCANTRG serving ADCn. The trigger STRIGn serves all the channels k which are associated to ADCn, have their CHNCFG{4|5}n.TRGSRCk = 4’h0011, and have their Channel Scan Select bit set (CHNCFG2n.CSSk = 1’b1).

Note:
  1. This bit is Enabled Protected: Writes are ignored when CTRLA.ENABLE = 1 returns a bus error.
  2. In order to utilize CORCTRLn.STRGSRC=0x4, user must configure the following registers:
    1. CTRLC.CNT.
    2. CHNCFG2n.CSSx.
    3. CHNCFG4/5n.TRGSRCx = 0x3.
    4. CTRLB.SWCNVEN = 0.
ValueDescription
0000No trigger (NOP)
0001Global Software Trigger (CTRLB.GSWTRG) - Self-cleared on the next APB clock cycle.
0010Level Software Trigger (CTRLB.LSWTRG) - Not self-cleared.
0011Reserved
0100Synchronous Trigger (CTRLC.CNT)
0101 - 1111ADC Trigger Event User 0 – 10

Bit 15 – EIRQOVR Interrupt Type Selection

Note:
  1. This bit is Enabled Protected : (Writes are ignored when CTRLA.ENABLE = 1) . returns a bus error.
ValueDescription
0Use normal ADC interrupts
1Use early ADC interrupts as defined by CORCTRLn.EIS bits

Bits 14:12 – EIS[2:0] Early Interrupt Select Bits for ADCn

These bits select the number of core clocks and TAD clocks prior to the end of conversion at which the early interrupt is generated. All channels serviced by ADCn share the same EIS setting.

The interrupt is generated ((EIS +1) x TAD) ADC Module clocks prior to end of conversion.

Note:
  1. This bit is Enabled Protected : (Writes are ignored when CTRLA.ENABLE = 1) . returns a bus error.
  2. Early interrupt is a feature that can be useful in ADC very high-speed data acquisitions to mask the MCU interrupt latency delay.

    For example, CPU MCLK = 300 MHz, ADC CTL_CLK = 150 MHz, and ADC TAD Clk = 75 MHz.

    Hypothetically, if it took the CPU 20 MCLK cycles to service an interrupt, then theoretically the ADC early interrupt EIS could be set to 4, hence the ISR latency was masked. The CPU could then read the ADC result almost immediately from within the Interrupt Service Routine (ISR), when the result was ready without any concern for overwriting the current result or FIFO with the next ADC conversion result.

Note: Depending on the bit resolution selection field SELRES, the allowed maximum EIS values are as follows:
  • 12-bit Resolution, all 8 possible settings are allowed, 0 - 7
  • 10-bit Resolution, all 8 possible settings are allowed, 0 - 7
  • 8-bit Resolution, only the 6 lowest settings are allowed, 0 - 5
  • 6-bit Resolution, only the 4 lowest settings are allowed, 0 - 3

The hardware will utilize the maximum allowed EIS setting if the user sets the EIS value that is too big.

CAUTION: Do not set the EIS to large or the interrupt can occur before the ADC conversion is complete and the CPU could read the previous ADC conversion result instead of the one in progress.
ValueDescription
0x0Generate interrupt 1 TAD clock before end of ADC conversion
0x1Generate interrupt 2 TAD clocks before end of ADC conversion
0x2Generate interrupt 3 TAD clocks before end of ADC conversion
0x3Generate interrupt 4 TAD clocks before end of ADC conversion
0x4Generate interrupt 5 TAD clocks before end of ADC conversion
0x5Generate interrupt 6 TAD clocks before end of ADC conversion
0x6Generate interrupt 7 TAD clocks before end of ADC conversion
0x7Generate interrupt 8 TAD clocks before end of ADC conversion

Bits 11:10 – SELRES[1:0] ADC Resolution for the ADCn

Note:
  1. This bit is Enabled Protected: (Writes are ignored when CTRLA.ENABLE = 1). Returns a bus error.
ValueDescription
006 bits
018 bits
1010 bits
1112 bits (power-on default)

Bits 9:0 – SAMC[9:0] Sample Count

The sample time required depends on the external analog signal source impedance. (See ADC electrical characteristics of SAMC values required based on external source impedance. If the external analog source impedance is unknown or if your getting inconsistent ADC results consider increasing the SAMC sample time at the cost of a lower ADC throughput rate of course.

ADCn Throughput Rate

FTPR = [1 / ((SAMC value +2) * TAD) + ((#bits of resolution selected+1)*TAD)] / # of active AINx inputs on ADCn

Note:
  1. All channels serviced by ADCn share the same SAMC setting.
  2. The sampling sequence starts with a trigger event.
  3. The internal sampling cap is not discharged between samples. These bits are Enabled Protected: Writes are ignored when CTRLA.ENABLE = 1 returns a bus error.
  4. When IVREF is to be sampled ( Internal - ADC3 Module - Channel 6), (SAMC value + 2) * TAD must be ≧ 30 us.
ValueDescription
11111111111025 TADn
......
00000000013 TADn
0000000000Reserved