Possibility of enabling and disabling the channels of ADCs during runtime
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-01-03 3:30 PM
Hi community members, I have tried to find the answer in the available documentation but could find the exact answer to my query. I have been using STM32-Nucleo-G474RE and I wanted to assign specific channels of ADCs to sensors X and other available channels of the same ADCs to sensors Y. Is it possible to disable and enable the channels from the code during runtime? I was thinking to use an external multiplexer for selecting the channels based on the conditions. Do I really need an external multiplexer or I could enable and disable channels even without it in the software?
Looking forward to the suggestion.
Thanks
Solved! Go to Solution.
- Labels:
-
ADC
-
STM32G4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-01-03 3:55 PM
You can absolutely change the ADC configuration at runtime. When switching, you'll need to stop the current conversion, reconfigure the ADC, then start the new conversions.
If you set up the channels in CubeMX, you can use the code it generates to reconfigure the ADC, although you will need to incorporate this into user code as CubeMX doesn't support dynamic reconfiguration of the ADC.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-01-03 3:55 PM
You can absolutely change the ADC configuration at runtime. When switching, you'll need to stop the current conversion, reconfigure the ADC, then start the new conversions.
If you set up the channels in CubeMX, you can use the code it generates to reconfigure the ADC, although you will need to incorporate this into user code as CubeMX doesn't support dynamic reconfiguration of the ADC.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-01-12 7:39 AM
Thank you so much for the reply.
