cancel
Showing results for 
Search instead for 
Did you mean: 

changing pin's mode from interrupt input to normal mode in the interrupt routine

fatemehjml
Associate II
Posted on July 12, 2014 at 11:21

Dear all

I configured PC.0 in STM32f103 as input in interrupt mode as rising edge. There's a pulse connected to PC.0. We need to STM32f103 reply to any rising edge by push the bus low.

When I want to detect rising edge, I should configure STM32f103 as interrupt input. But when I want to reply to this pulse I should configure the PC.0 as output. I want to know is it possible to change the pin mode during interrupt routine? how we can configure that?

I test some codes but the problem was when program enter interrupt routine, never  come back to main loop.

I'm waiting for your response.

Regards,

3 REPLIES 3
Posted on July 12, 2014 at 13:46

If it doesn't come back you'd want to make sure you cleared the interrupt.

It should be possible to reconfigure the pin, but may be consider setting it in OD mode, set high, and then set it LOW (and driving) in response to the EXTI on the rising edge.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
fatemehjml
Associate II
Posted on July 22, 2014 at 15:25

Thanks,

Is it possible to use systick delay library together with external interrupt?

I did it but didn't work!

Posted on July 22, 2014 at 16:54

Is it possible to use systick delay library together with external interrupt? I did it but didn't work!

Sure, but I suspect you sat dwelling in one interrupt handler waiting for a routine that's waiting for another interrupt. You should leave the first interrupt, and handle the delayed response in the timing interrupt.

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