STM32G474 HRTIMER ADC Trigger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-20 6:57 AM
I'm trying to configure the ADC to read to values at a specific time in my system that uses the STM32G474.
I have two channels of peak current mode control using the HRTIMER. The outputs are reset from either a comparator event or max duty cycle compare value on each channel.
For each channel, I want to sample a voltage at a fixed delay time after the output is reset.
Any help is greatly appreciated.
Thank you
- Labels:
-
ADC
-
HRTIM
-
STM32G4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-22 1:14 PM - edited ‎2024-10-22 1:14 PM
Hello @DamageG ,
You can use the auto-delayed mode to introduce a fixed delay after the comparator event before triggering the ADC.
In auto-delayed mode, the CMP2 value will be added to the captured timer value when the comparator event occurs. This will generate a match event after the specified delay (e.g., 200ns).
Then, set the ADC to be triggered by the HRTIMER's compare match event (CMP2 match event). This ensures that the ADC conversion starts after the fixed delay from the comparator event.
For more detailed information on configuring the HRTIMER and Auto-Delayed Mode, refer to the STM32G4 reference manual (in HRTIM chapter) and the HRTIMER cookbook (AN4539),
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-22 1:25 PM
Thank you!
It's going to take me a couple of days to be able to test it out. I'll let you know how it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-03 1:45 PM
I updated the cubeIDE to the latest firmware and now I'm getting this hard fault. Any ideas? I didn't change anything in my task setup from what was working.
