cancel
Showing results for 
Search instead for 
Did you mean: 

STM8S003F3P6 - External Interrupt on PA3 does not work

Paul Weh
Associate
Posted on October 16, 2017 at 14:03

Hello,

iam trying to get a external interrupt an pin A3, but that does not work.

On other pins it work, but on this pin it does not work.

I will show you my code:

Configuration:

 asm('SIM');
 PA_ODR = 0; // All pins are turned off.
 PA_DDR_DDR3 = 0; // PA3 is input.
 PA_CR1_C13 = 1; // PA3 is pull high
 EXTI_CR1_PAIS = 2; // Interrupt on falling edge.
 EXTI_CR2_TLIS = 0; // Falling edge only. 
 asm('RIM'); �?�?�?�?�?�?�?

and Interrupt routine:

//
// Process the interrupt generated by the pressing of the button on PA3.
//
#pragma vector = EXTI0_vector
__interrupt void EXTI_PORTA_IRQHandler(void)
{
 PC_ODR_ODR3 = !PC_ODR_ODR3;
}
�?�?�?�?�?�?�?�?

My debug point in the interrupt is never reached. And i absolutely dont know why.

Do you have a hint for me?

Thanks, Paul

#pa3 #interrupt #external-interrupt
1 REPLY 1
Paul Weh
Associate
Posted on October 16, 2017 at 19:07

I´m an idiot. I forgot to add:

 PA_CR2_C23 = 1;
�?

Now it works 🙂

Thanks