ADCv3 Setup with STM32L4R5ZI

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

ADCv3 Setup with STM32L4R5ZI

Post 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)
  }
};
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ADCv3 Setup with STM32L4R5ZI

Post by Giovanni »

Hi,

GPIO settings?

Giovanni
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: ADCv3 Setup with STM32L4R5ZI

Post 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 :-)
Post Reply