AnsweredAssumed Answered

STM32L471VGT6-LQFP-100 + L4 HAL Questions

Question asked by James Carucci on Feb 7, 2018
Latest reply on Feb 7, 2018 by James Carucci

Hi Everyone,

 

I am brand new to the community and so far I'm pretty impressed! 

 

I am relatively inexperienced and I'm just getting up to speed migrating from the underwhelming TI microcontroller platform so my questions may be a bit rudimentary. I've found the example code for the L4 HAL quite useful and I'm already making some progress. In the example code I notice:

 

1. Often there are lines reading PPPhandle.instance = PPPx (for example AdcHandle.Instance = ADCx) and I notice that eclipse throws a warning on this. I assumed that ADCx, ADCy, TIMx, etc need to be changed to ADC1, ADC2, TIM3, etc. Is that assumption correct?

2. Likewise, I notice in the example code sConfig.Channel      = ADCx_CHANNELa; and I assume that this must change to the form of ADC1_CHANNEL_0 for example. Is that assumption correct?

3. In one of the HAL examples , the goal is to set a timer trigger ADC channel. In the code there is

a) an ADC_Config function which sets AdcHandle_master.Init.ExternalTrigConv      = ADC_EXTERNALTRIG_T3_TRGO;. I assume based on this and the comment that this ADC in question is to be triggered on the T3 timer state change.

b) a TIM_Config function which declares an instance TimHandle.Instance = TIMx . I see no mention of T3 elsewhere in the function. Am I correct to assume that TIMx must be changed to TIM3 in order to configure it as the trigger for the ADC?

4) Probably most importantly...based on the example code, L4 HAL Manual, and STM32L471VGT6-LQFP-100 datasheet, it is unclear to me how to know when a peripheral is configured (say ADC1 or TIM1) how exactly that gets mapped to a specific pin on the microcontroller? Can someone explain this to me?

 

Once again I realize some of this may be obvious to you all but I am inexperienced and brand new to the platform. I appreciate any help you're able to give!

 

Thanks!

Jim

Outcomes