Analog to Digital Converter
Add-On Required: This feature requires the Embedded Coder Support Package for STMicroelectronics STM32 Processors add-on.
Libraries:
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F2xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F3xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F4xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32F7xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32G4xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32H7xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32L4xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32L5xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32U5xx Based Boards
Embedded Coder Support Package for STMicroelectronics STM32 Processors /
STM32WBxx Based Boards
Description
Use the Analog to Digital Converter block to convert the analog value at an ADC input pin to a digital value. The block output is a 1-by-N row vector depending on the number of conversions N. The block measures the voltage of an analog pin relative to the analog input reference voltage on STM32 Processor Based Boards.
The conversion time for ADC channels is configured in the STM32CubeMX project.
For STM32H7xx based board and STM32G4xx based board, the input channels for the ADC block can be configured in STM32CubeMX project to either Differential mode or Single-ended. User can specifying the offset value for the selected channel in the STM32CubeMX project.
For more information, see Processing the ADC Data for STM32H7xx and STM32G4xx Based Boards.
Note
In a model use STM32H7xx based board library blocks with STM32H7xx based target hardware board only. When you run a model with STM32 library blocks mapped to STM32H7xx Based target you will encounter with an error message.
Note
You can run a Simulink® model containing PWM Output block in Connected IO mode on STM32 Processor Based Boards.
Examples
Ports
Input
Output
Parameters
More About
Extended Capabilities
Version History
Introduced in R2021b