cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the source of a shared line interrupt

Kuikui
Associate III
Posted on October 16, 2010 at 08:34

Getting the source of a shared line interrupt

3 REPLIES 3
epassoni950
Associate II
Posted on May 17, 2011 at 14:11

Hello,

I think you can't have interrupt from PA8 AND PC8 at the same time (see figure 21 in chapter 9.2.5 in RM0008).

To generate EXTI_Line8 interrupt, you have to configure EXTI8 in AFIO_EXTICR3 register to tell if EXTI_Line8 is connected either to PA8 OR to PC8.

If you want 2 interrupts, you must connect second line or PC9 for example but not on PC8.

If you use PA8 and PC9, you have EXTI_Line8 interrupt and EXTI_Line9 interrupt which are mapped to EXTI9_5 interrupt (position 23). In this handler, you can read EXTI_PR register to know which line generate the interrupt.

Another good solution is to use PA3 and PC4 for example to trigger EXTI3 interrupt and EXTI4 interrupt with different interrupt vector.

For using microcontroller, it is important to know a little the software before designing the hardware to have the best solution.

Regards

Eric

js23
Associate III
Posted on May 17, 2011 at 14:11

If it is absolutely necessary that PA8 and PC8 generate interrupts, a little trick might help: PC8 goes to TIM3_CH3 (Remap required), so you could use the Capture/Compare Interrupt to detect a signal change on PC8. It is interesting to know that it is even not necessary to have the timer running.

Unfortunatley there are disadvantages: One timer channel is wasted and a wakup from stop mode is not possible with this interrupt.

Kuikui
Associate III
Posted on May 17, 2011 at 14:11

okay !

Thank you for this explanation.