2021-01-25 02: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.
2021-01-25 03: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
2021-01-25 03: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
2021-01-25 03: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...