Page 1 of 1

ADCv3 Setup with STM32L4R5ZI

Posted: Tue Dec 17, 2024 2:59 pm
by Tabulous
Struggling to get this to sample the pin......Am i missing anything ?

ADC_GRP_NUM_CHANNELS = 1
ADC_GRP_BUF_DEPTH = 1

raw ADC reading is 34 but the voltage on the pin is 1V so i would have thought the reading should be alot higher

adcStart is been called and ADC1 is enabled etc.....

conversion started using
adcStartConversion(adcp, &adcgrpcfg, samples, ADC_GRP_BUF_DEPTH);


Here is the config struct

Code: Select all

static const ADCConversionGroup adcgrpcfg = {
  .circular     = false,
  .num_channels = ADC_GRP_NUM_CHANNELS,
  .end_cb       = adc_end_callback,
  .error_cb     = adc_error_callback,
  .cfgr         = ADC_CFGR_RES_12BITS,
  .tr1          = ADC_TR_DISABLED,
  .tr2          = ADC_TR_DISABLED,
  .tr3          = ADC_TR_DISABLED,
  .awd2cr       = 0U,
  .awd3cr       = 0U,
  .smpr         = {
      ADC_SMPR1_SMP_AN3(ADC_SMPR_SMP_47P5)
  },
  .sqr          = {
      ADC_SQR1_SQ1_N(ADC_CHANNEL_IN3)
  }
};

Re: ADCv3 Setup with STM32L4R5ZI

Posted: Tue Dec 17, 2024 3:09 pm
by Giovanni
Hi,

GPIO settings?

Giovanni

Re: ADCv3 Setup with STM32L4R5ZI

Posted: Tue Dec 17, 2024 3:17 pm
by Tabulous
Giovanni wrote:Hi,

GPIO settings?

Giovanni


Yep duh.....for some reason i'd set others but not this pin......
Anyways thanks as always, just the little promt is all it takes :-)