cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F105RC PB6 always stay 0, EXTI never trigg

BSANT.17
Associate II

	// PB6 Main sync pin
	GPIO_InitTypeDef GPIO_InitStructure;
	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
	GPIO_Init(GPIOB, &GPIO_InitStructure);
 
	// Connect EXTI6 Line to PB6 pin
	GPIO_EXTILineConfig(GPIO_PortSourceGPIOB, GPIO_PinSource6);
 
	//Configure EXTI 6
	EXTI_InitTypeDef EXTI_InitStructure;
	EXTI_InitStructure.EXTI_Line = EXTI_Line6;
	EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
	EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising_Falling;
	EXTI_InitStructure.EXTI_LineCmd = ENABLE;
	EXTI_Init(&EXTI_InitStructure);
 
	/* Enable the EXTI9_5 Interrupt */
	NVIC_InitTypeDef NVIC_InitStructure;
	NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQn;
	NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
	NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
	NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
	NVIC_Init(&NVIC_InitStructure);
 
	NVIC_EnableIRQ(EXTI9_5_IRQn);
 
	/* Clear interrupt flag */
	EXTI_ClearITPendingBit(EXTI_Line6);

Hi, I've got a problem with my EXTI6. I try to get interrupt on falling and rising edges.

I've watched SFR register but I don't understand why it doesn't work.

PB IDR bit 6 always stay to 0 but I'm sure it's not true.

IRQ are enabled, software interrupt trig works perfectly.

I use Eclipse with Std peripheral lib V3.5.0.

Is anyone think about something ?

EDIT : Signal NOT moving when my program running.

Thanks.

10 REPLIES 10

Once again: this proves nothing. The PB6 pin may be not connected to the point you are measuring at (eg. bad solder joint). Set the signal to 1, and observe IDR, it must be 1.

JW