Connect EXTI3 Line to PC3 pin
时间: 2024-04-30 17:20:20 浏览: 119
To connect EXTI3 line to PC3 pin, you need to configure the GPIO pins of the microcontroller. Here are the steps to do it:
1. Enable the GPIOC clock.
2. Configure PC3 as an input pin.
3. Configure EXTI3 to use PC3 as the interrupt source.
4. Enable the EXTI3 interrupt.
Here is some sample code to do it:
```
// Enable GPIOC clock
RCC->AHBENR |= RCC_AHBENR_GPIOCEN;
// Configure PC3 as input pin
GPIOC->MODER &= ~(GPIO_MODER_MODER3);
// Configure EXTI3 to use PC3 as interrupt source
SYSCFG->EXTICR[0] &= ~(SYSCFG_EXTICR1_EXTI3);
SYSCFG->EXTICR[0] |= SYSCFG_EXTICR1_EXTI3_PC;
// Enable EXTI3 interrupt
EXTI->IMR |= EXTI_IMR_IM3;
```
After this code is executed, the EXTI3 line will be connected to the PC3 pin and the interrupt will be enabled. When the input on PC3 changes, the microcontroller will generate an interrupt on EXTI3.
阅读全文