Skip to main content
Explorer
December 13, 2023
Question

STM32U5 LL example ADC1 and ADC4

  • December 13, 2023
  • 0 replies
  • 1624 views

The example project does not provide information on ADC4 register configurations, ADC4 seems to be different then prior peripherals (e.g. compared to L4).  

...\NUCLEO-U575ZI-Q\Examples_LL\ADC\ADC_SingleConversion_TriggerSW_IT_Init

STM32CubeMX configuration tool is close, but does not generated completely working examples (not for me at least).

Merging the two together, I created the attached example (crude but functional).

change these two #define's in main.h to switch ADC peripheral ADC1(2) or ADC4

  #define MY_ADC_TYPEDEF ADC1 //ADC1 or ADC4

  #define MY_ADC_IRQHandler ADC1_IRQHandler //ADC1_IRQHandler or ADC4_IRQHandler

 

enjoy, hope this helps someone get started with the ADC4 peripheral on the STM32U5

 

note: the post only allowed three files

stm32u5xx_it.h

requires this addition, based on the #define in main.h

/* USER CODE BEGIN EFP */

void MY_ADC_IRQHandler(void);

    This topic has been closed for replies.