Skip to main content
BTrem.1
Senior
January 14, 2021
Solved

How to read Timer Capture triggered by software

  • January 14, 2021
  • 3 replies
  • 904 views

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.

This topic has been closed for replies.
Best answer by waclawek.jan

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

JW

3 replies

TDK
January 14, 2021

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""."
waclawek.jan
waclawek.janBest answer
Super User
January 14, 2021

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

JW

BTrem.1
BTrem.1Author
Senior
January 15, 2021

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