ADC_MEASUREMENT: Architecture Description

ADC MEASUREMENT

ADC_MEASUREMENT
Architecture Description

Architecture Description

Figure 1 : Architecture of ADC_MEASUREMENT APP

The diagram above represents the internal software architecture of the ADC_MEASUREMENT APP. The figure shows the consumed hardware resources, dependent APPs and various signals which are exported out. A ADC_MEASUREMENT APP instance exists in a DAVEā„¢ project with fixed attributes as shown and uses the VADC peripheral's background request source for converting a channel. This in addition requires the consumption of the GLOBAL_ADC and CLOCK APPS for functional configurations. The ADC_MEASUREMENT APP also provides output signals, these are described in Table-1.

ANALOG_IO APP is conditionally used by ADC_MEASUREMENT APP when an "Expose pin"" is selected in the UI. This is applicable for all the channels. By using the ANALOG_IO, the ADC_MEASUREMENT can share the pin with other APPs such as DAC, ACMP_CONFIG etc. It is possible to connect the same ANALOG_IO APP to multiple channels. This involves the use of the ALIAS feature of the ADC channels. In this the same pin gets converted by multiple channels from the same group. For Example: Assume that GROUP-1 CH-2 is connected to P14.2 and also to GROUP-0 CH-2. The Alias feature of the ADC enables the Channels 0 and 1 to convert any pin of the group. Hence the same ANALOG_IO APP can be shared between GROUP-1 CH-2, GROUP-1 CH-0, GROUP-1 CH-1. Also the same is applicable for the other group also GROUP-0 CH-2, GROUP-0 CH-0, GROUP-0 CH-1. The following figure shows that resources consumed by the ADC_MEASUREMENT APP when the same ANALOG_IO is shared.

Figure 2 : Example for ALIAS and ANALOG_IO

Result Registers: Each channel is mapped to one result register(excluding XMC1100). There are 3 different categories of result registers based on different functions it provides.

  • result_adv: Provide boundary flag outputs.
  • result_filter: Provide filtered output.
  • result: Provide accumulation(1x, 2x, 3x, 4x)/subtraction mode.

For the working of ADC_MEASUREMENT APP all the 3 results are perfectly the same. There will be no difference in the output result received after conversion.

Internally a NVIC node is consumed for background request source event (for XMC1100, global result event) when "Enable end of measurement interrupt" (for XMC1100, "Enable interrupt after each measurement") is enabled in the UI of the APP.


Signals:

The following table presents the signals provided by the APP for connection. It also gives the flexibility to configure and extend the connectivity to other APPs.
Table 1: APP IO signals

Signal Name Input/Output Availability Description
event_background_source Output Always Background request source event signal:
It is connected to an NVIC node within the APP to generate the interrupt for each background scan completion sequence.
The interrupt would be generated after all the entries in the sequence are converted once.
event_result_channel_x
Where channel_x represents the channels that are being used.
Output Conditional

Result event for channel_x:

  • It can be connected to INTERRUPT APP to generate the interrupt after the result is generated by a particular channel_x.
  • The result event is available after the check box in the UI "Result event" for the particular channel is enabled.
  • The channel_xname can be configured in the Measurements Tab UI field.

trigger_input Input Always Trigger selection signal
Used to configure the trigger signal for the conversion to start. Can be connected to various sources to act as a trigger for the conversion(e.g. CCU4, CCU8, ERU etc).
gating_input Input Always Gating selection signal
Used to configure the gating signal for the background request source. Can be connected to various sources to act as a gating for the ADC(e.g. CCU4, CCU8, ERU etc).
Background_connection_to_global_signal Input Always Global selection signal
Provides an interface to select a specific VADC module to which the background would belong to. (By default always connected to the GLOBAL_ADC APPs global_signal)


Timing Calculations:
ADC_MEASUREMENT APP uses the following equations to calculate the sample time and Total conversion time.
Refer the reference manual for the detailed information.

  1. Sample Time:
    Actual Sample Time = (2 + STC) * tADCI
    where,
    STC   : Sample time control (Value - 0 to 256)
    fADCI : Analog clock frequency
    tADCI = 1/fADCI 

  2. Total Conversion time: XMC4000 devices

    Note: PC value is configured as 2 i.e with post calibration always enabled.
    If post calibration is disabled ( in GLOBAL_ADC APP), the total conversion time will be reduced by 2/fADC (GLOBAL_ADC APP).

    1. Standard Conversion Mode:
      Total Conversion time =  (2 + STC + N + DM + PC) * tADCI + 2 * tADC
      Where,
      N       = 8, 10, 12 for n bit resolution.
      tADC    = ADC module clock = system clock
      tADCI   = Analog clock
      STC     = Sample time control (Value - 0 to 256)
      DM      = The selected duration of the MSB conversion (DM = 0 or 1)
      PC      = The post-calibration time PC, if selected (PC = 2, otherwise 0)
      
    2. Fast Compare Mode:
      Total Conversion time = (2 + STC + 2) * tADCI + 2 * tADC
      Where,
      tADC    = ADC module clock = system clock
      tADCI   = Analog clock
      STC     = Sample time control (Value - 0 to 256)
      
  3. Total Conversion time: XMC1000 devices

    1. Standard Conversion Mode:
      Total Conversion time = ( 2 + STC) * tADCI + (4 * tSH) + ( N + 8) * tSH + (5 * tADC)
      Where,
      N       = 8, 10, 12 for n bit resolution.
      tSH     = Sample and Hold clock (Converter clock time period)
      tADC    = ADC module clock = system clock
      tADCI   = Analog clock
      STC     = Sample time control (Value - 0 to 256)
      
    2. Fast Compare Mode:
      Total Conversion time = (FCRT + 1) * 2 * tADCI + ( 2 + STC)*tADCI
      Where,
      FCRT    = Fast Compare Mode Response Time (Value - 0 to 15)
      tSH     = Sample and Hold clock (Converter clock time period)
      tADCI    = Analog clock
      STC     = Sample time control (Value - 0 to 256)
      Note: FCRT value is configured as 0.