cancel
Showing results for 
Search instead for 
Did you mean: 

Timer and interrupt triggered by one I/O line?

b.a.
Associate III

Hi all,

is it possible to use the same GPIO-pin as Timer external trigger and falling edge external interrupt.

I'd like to create an application in which a rising edge on a GPIO starts a timer that sets an output for, say 2ms. After this time, another GPIO should be set for the duration of high level (that is: until a falling edge occurs) on the initial GPIO line.

Is this feasible?

I see no way to do this with the CubeIDE, but don't know what will happen if I set the registers "by hand"

Cheers,

Bob

1 ACCEPTED SOLUTION

Accepted Solutions

> is it possible to use the same GPIO-pin as Timer external trigger and falling edge external interrupt.

Yes. EXTI is independent from other functionality, as long as the relevant pin is not set as Analog.

> I see no way to do this with the CubeIDE,

Cube generally does not cater for anything out of "usual.

> but don't know what will happen if I set the registers "by hand"

Set up GPIO for the required AF functionality (timer), and then set up EXTI and SYSCFG registers "by hand". This won't harm anything.

JW

PS. Btw., always state your STM32 model.

View solution in original post

2 REPLIES 2

> is it possible to use the same GPIO-pin as Timer external trigger and falling edge external interrupt.

Yes. EXTI is independent from other functionality, as long as the relevant pin is not set as Analog.

> I see no way to do this with the CubeIDE,

Cube generally does not cater for anything out of "usual.

> but don't know what will happen if I set the registers "by hand"

Set up GPIO for the required AF functionality (timer), and then set up EXTI and SYSCFG registers "by hand". This won't harm anything.

JW

PS. Btw., always state your STM32 model.

b.a.
Associate III

Hi Jan,

thank you! The µC in question is STM32L412

I really am stunned by the versatility of these chips!

Bob