cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger input capture every 8 rising edges

con3
Senior
Posted on January 16, 2018 at 16:42

Hey everyone,

I'm using the stm32f722ze and CubeMx and have gotten my input capture working. Essentially, when every rising edge is detected, the timer triggers a DMA event and stores the GPIO pins value to memory. This happens on every rising edge, although I'd like this to only occur every 8 rising edges. Is there anyway that I can get the input capture to be triggered every 8 rising edges instead of every rising edge?

Thanks in advance for any help!

#nucleo-stm #cubemx #timer-interrupts #input-capture-mode #stm32f7-timer
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on January 16, 2018 at 16:44

Yes, use the Input Prescaler, which can be set to 1, 2, 4 or 8

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

3 REPLIES 3
Posted on January 16, 2018 at 16:44

Yes, use the Input Prescaler, which can be set to 1, 2, 4 or 8

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 16, 2018 at 16:46

Hi Clive, thank you. I did add the prescaler to the code and set it to 8, although it still triggered on every event. I'll debug for a bit as I m pretty sure I must have an error somewhere.

Thank you for the quick reply

Posted on January 18, 2018 at 07:40

Good day Clive,

I got the prescaler working, although it has a slight issue. I just wanted to ask if there was a easy solution without manipulating it with additional code that ignores and bloats the software.

The timer is triggered immediately and then every 8 clock cycles thereafter. I'd ideally like it to not have the initial trigger.

A better explanation:

First rising edge - triggers and then every 8 rising edges thereafter it gets triggered again,

What i want:

First rising edge - doesn't trigger the timer. Every 8 clock cycle rising edges from the start triggers it without the first rising edge triggering it.

Is this possible.

Thank you in advance for any help.