STMicroelectronics /STM32G081 /ADC /ADC_CFGR1

Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text

Interpret as ADC_CFGR1

31 2827 2423 2019 1615 1211 87 43 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (B_0x0)DMAEN 0 (B_0x0)DMACFG 0 (B_0x0)SCANDIR 0 (B_0x0)RES0 (B_0x0)ALIGN 0 (B_0x0)EXTSEL 0 (B_0x0)EXTEN 0 (B_0x0)OVRMOD 0 (B_0x0)CONT 0 (B_0x0)WAIT 0 (B_0x0)AUTOFF 0 (B_0x0)DISCEN 0 (B_0x0)CHSELRMOD 0 (B_0x0)AWD1SGL 0 (B_0x0)AWD1EN 0 (B_0x0)AWD1CH

EXTEN=B_0x0, RES=B_0x0, AWD1CH=B_0x0, DISCEN=B_0x0, AWD1EN=B_0x0, DMAEN=B_0x0, ALIGN=B_0x0, EXTSEL=B_0x0, CONT=B_0x0, CHSELRMOD=B_0x0, AWD1SGL=B_0x0, OVRMOD=B_0x0, DMACFG=B_0x0, AUTOFF=B_0x0, WAIT=B_0x0, SCANDIR=B_0x0

Description

ADC configuration register 1

Fields

DMAEN

Direct memory access enable This bit is set and cleared by software to enable the generation of DMA requests. This allows the DMA controller to be used to manage automatically the converted data. For more details, refer to . Note: The software is allowed to write this bit only when ADSTART bit is cleared to 0 (this ensures that no conversion is ongoing).

0 (B_0x0): DMA disabled

1 (B_0x1): DMA enabled

DMACFG

Direct memory access configuration This bit is set and cleared by software to select between two DMA modes of operation and is effective only when DMAEN = 1. For more details, refer to page 391 Note: The software is allowed to write this bit only when ADSTART bit is cleared to 0 (this ensures that no conversion is ongoing).

0 (B_0x0): DMA one shot mode selected

1 (B_0x1): DMA circular mode selected

SCANDIR

Scan sequence direction This bit is set and cleared by software to select the direction in which the channels is scanned in the sequence. It is effective only if CHSELMOD bit is cleared to 0. Note: The software is allowed to write this bit only when ADSTART bit is cleared to 0 (this ensures that no conversion is ongoing). If CCRDY is not yet asserted after channel configuration (writing ADC_CHSELR register or changing CHSELRMOD or SCANDIR), the value written to this bit is ignored.

0 (B_0x0): Upward scan (from CHSEL0 to CHSEL18)

1 (B_0x1): Backward scan (from CHSEL18 to CHSEL0)

RES

Data resolution These bits are written by software to select the resolution of the conversion. Note: The software is allowed to write these bits only when ADEN = 0.

0 (B_0x0): 12 bits

1 (B_0x1): 10 bits

2 (B_0x2): 8 bits

3 (B_0x3): 6 bits

ALIGN

Data alignment This bit is set and cleared by software to select right or left alignment. Refer to Data alignment and resolution (oversampling disabled: OVSE = 0) on page 389 Note: The software is allowed to write this bit only when ADSTART bit is cleared to 0 (this ensures that no conversion is ongoing).

0 (B_0x0): Right alignment

1 (B_0x1): Left alignment

EXTSEL

External trigger selection These bits select the external event used to trigger the start of conversion (refer to External triggers for details): Note: The software is allowed to write this bit only when ADSTART bit is cleared to 0 (this ensures that no conversion is ongoing).

0 (B_0x0): TRG0

1 (B_0x1): TRG1

2 (B_0x2): TRG2

3 (B_0x3): TRG3

4 (B_0x4): TRG4

5 (B_0x5): TRG5

6 (B_0x6): TRG6

7 (B_0x7): TRG7

EXTEN

External trigger enable and polarity selection These bits are set and cleared by software to select the external trigger polarity and enable the trigger. Note: The software is allowed to write this bit only when ADSTART bit is cleared to 0 (this ensures that no conversion is ongoing).

0 (B_0x0): Hardware trigger detection disabled (conversions can be started by software)

1 (B_0x1): Hardware trigger detection on the rising edge

2 (B_0x2): Hardware trigger detection on the falling edge

3 (B_0x3): Hardware trigger detection on both the rising and falling edges

OVRMOD

Overrun management mode This bit is set and cleared by software and configure the way data overruns are managed. Note: The software is allowed to write this bit only when ADSTART bit is cleared to 0 (this ensures that no conversion is ongoing).

0 (B_0x0): ADC_DR register is preserved with the old data when an overrun is detected.

1 (B_0x1): ADC_DR register is overwritten with the last conversion result when an overrun is detected.

CONT

Single / continuous conversion mode This bit is set and cleared by software. If it is set, conversion takes place continuously until it is cleared. Note: It is not possible to have both discontinuous mode and continuous mode enabled: it is forbidden to set both bits DISCEN = 1 and CONT = 1. The software is allowed to write this bit only when ADSTART bit is cleared to 0 (this ensures that no conversion is ongoing).

0 (B_0x0): Single conversion mode

1 (B_0x1): Continuous conversion mode

WAIT

Wait conversion mode This bit is set and cleared by software to enable/disable wait conversion mode… Note: The software is allowed to write this bit only when ADSTART bit is cleared to 0 (this ensures that no conversion is ongoing).

0 (B_0x0): Wait conversion mode off

1 (B_0x1): Wait conversion mode on

AUTOFF

Auto-off mode This bit is set and cleared by software to enable/disable auto-off mode… Note: The software is allowed to write this bit only when ADSTART bit is cleared to 0 (this ensures that no conversion is ongoing).

0 (B_0x0): Auto-off mode disabled

1 (B_0x1): Auto-off mode enabled

DISCEN

Discontinuous mode This bit is set and cleared by software to enable/disable discontinuous mode. Note: It is not possible to have both discontinuous mode and continuous mode enabled: it is forbidden to set both bits DISCEN = 1 and CONT = 1. The software is allowed to write this bit only when ADSTART bit is cleared to 0 (this ensures that no conversion is ongoing).

0 (B_0x0): Discontinuous mode disabled

1 (B_0x1): Discontinuous mode enabled

CHSELRMOD

Mode selection of the ADC_CHSELR register This bit is set and cleared by software to control the ADC_CHSELR feature: Note: The software is allowed to write this bit only when ADSTART bit is cleared to 0 (this ensures that no conversion is ongoing). If CCRDY is not yet asserted after channel configuration (writing ADC_CHSELR register or changing CHSELRMOD or SCANDIR), the value written to this bit is ignored.

0 (B_0x0): Each bit of the ADC_CHSELR register enables an input

1 (B_0x1): ADC_CHSELR register is able to sequence up to 8 channels

AWD1SGL

Enable the watchdog on a single channel or on all channels This bit is set and cleared by software to enable the analog watchdog on the channel identified by the AWDCH[4:0] bits or on all the channels Note: The software is allowed to write this bit only when ADSTART bit is cleared to 0 (this ensures that no conversion is ongoing).

0 (B_0x0): Analog watchdog 1 enabled on all channels

1 (B_0x1): Analog watchdog 1 enabled on a single channel

AWD1EN

Analog watchdog enable This bit is set and cleared by software. Note: The software is allowed to write this bit only when ADSTART bit is cleared to 0 (this ensures that no conversion is ongoing).

0 (B_0x0): Analog watchdog 1 disabled

1 (B_0x1): Analog watchdog 1 enabled

AWD1CH

Analog watchdog channel selection These bits are set and cleared by software. They select the input channel to be guarded by the analog watchdog. … Others: Reserved Note: The channel selected by the AWDCH[4:0] bits must be also set into the CHSELR register. The software is allowed to write this bit only when ADSTART bit is cleared to 0 (this ensures that no conversion is ongoing).

0 (B_0x0): ADC analog input Channel 0 monitored by AWD

1 (B_0x1): ADC analog input Channel 1 monitored by AWD

17 (B_0x11): ADC analog input Channel 17 monitored by AWD

18 (B_0x12): ADC analog input Channel 18 monitored by AWD

Links

()