CubeMx and configuring ADC channel(s)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-25 2:53 AM
Hi Guys,
Im struggling in getting a good way to work with cubemx and multi channel ADC. I want to be able to only change the cubemx file whenever there is a hardware change. Currently i cannot do so because in my firmware i am using HAL_ADC_ConfigChannel() to change adc configurations (i have 5 channels and need 3 to sample at the same time at the max speed, other two i sample seperatly and later on). However the ADC_ChannelConfTypeDef.Channel needs to know the ADC channel.
Does Cubemx have a way to create variables for adc channels (currently i use variable ADC_CHANNEL_x ) ? Or is there a way to grab the channel from a user label?
Kind regards,
Taxara
Solved! Go to Solution.
- Labels:
-
ADC
-
STM32CubeMX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-25 3:16 AM
Hi @Taxara​ ,
You can select your MCU and then navigate to Analog.
Choose the ADC that you want to activate , then enable the channels that you want.
After this you have an ADC configuration on many channels
You can define you variables in User Constants.
Hope that this helps you
Houssem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-25 3:16 AM
Hi @Taxara​ ,
You can select your MCU and then navigate to Analog.
Choose the ADC that you want to activate , then enable the channels that you want.
After this you have an ADC configuration on many channels
You can define you variables in User Constants.
Hope that this helps you
Houssem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-25 3:28 AM
Thank you, this was exactly where i was looking for! Working with cubemx some time now and totally missed the "user constants" field...
