STM32H723 Setting TIMx counter to specified value on rising edge of an input pin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-06 12:48 AM
Hello all,
I am using STM32H723 MCU and need to set TIMx Counter (TIMx_CNT) to a specified value different than 0 on rising edge of external input pin - TI1 or TIMx_ETR. From the MCU reference manual (RM0468 Rev 3) I understand, the TIMx Counter (TIMx_CNT) is initialized to 0 if the trigger condition is detected:
Is there a way to specify the value (different than 0) which is automatically set to TIMx_CNT register when the trigger condition is detected by Timer module? I know SW solution will work, but I need to avoid any delays caused by interrupts processing.
Thank you for your help,
Peter
- Labels:
-
DMA
-
STM32H7 Series
-
TIM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-06 12:56 AM
This is an unusual requests and thus the logical question is: why would you want that? Isn't there a different and better way to accomplish your goal?
You can pull it off by using the input as DMA trigger in some way, where DMA would write the required value to TIMx_CNT.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-07 1:08 AM
Hello @Community member​,
Thank you for your reply. DMA looks like solution but I have some concerns about time needed to transfer the value to TIMx_CNT by DMA.
The MCU is controlled from master device and receives the rising edge as a request to start counting from the specified value and generate appropriate PWM signal. The rising edge defines a point when the PWM needs to be shifted.
Regards,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-10-07 6:24 AM
Why can't you set TIMx_CNT beforehand, and then start the counter using Trigger mode in the Slave-mode controller?
JW
