cancel
Showing results for 
Search instead for 
Did you mean: 

How to read Timer Capture triggered by software

BTrem.1
Senior II

I have an application where I am using an external signal to trigger TIM8_CH1 to do a capture and generate a DMA interrupt where I then store the counter value. I want to perform a similar action on an internal firmware (FW) signal. I want to store the TIM8 count value to a memory location when a FW event occurs.

Is there a way to trigger TIM8 to perform a count capture based on a FW trigger?

I'm using a STM32G431.

1 ACCEPTED SOLUTION

Accepted Solutions

Maybe setting TIMx_EGR.CCxG is what you'r looking for?

JW

View solution in original post

3 REPLIES 3
TDK
Guru

The IC mode is limited to those described in the reference manual, generally when a pin changes value. What "firmware signal" are you trying to use? A variable changing value? If so, no.

If you feel a post has answered your question, please click "Accept as Solution".

Maybe setting TIMx_EGR.CCxG is what you'r looking for?

JW

I'll give this a try. Basically I have a firmware signal than is a sinusoid frequency of about 200Hz that is updated every PWM period (about 33usec). After filtering this sinusoid I want to detect when it has a zero crossing. This decision will be done in the high-frequency interrupt and when a crossing is detected I want to trigger the counter capture. I'll report back what I find,

Thanks,

Brian