cancel
Showing results for 
Search instead for 
Did you mean: 

GPIOB_pin12 connecting to interrupt line

linas2
Associate II
Posted on July 23, 2012 at 22:26

hello, i am trying to make interrupt based touchscreen program, but have no luck connecting

GPIOB_pin12 to interrupt line i was able to do so in GPIOA_pin1, but still cant figureout how to do that on GPIOB port

void touch_init(void)
{ 
GPIO_InitTypeDef GPIO_InitStructure;
EXTI_InitTypeDef EXTI_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOB, EXTI_PinSource12);
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB);
//T_PEN
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;
GPIO_Init(GPIOB, &GPIO_InitStructure);
EXTI_InitStructure.EXTI_Line = EXTI_Line12;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling; 
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
NVIC_InitStructure.NVIC_IRQChannel = EXTI4_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}
and interrupt itself in stm32f4_it.c file:
void EXTI4_IRQHandler(void)
{
if(EXTI_GetITStatus(EXTI_Line12) != RESET)
{
LCD_Clear(RED);
Delay(0xFFFFFF);
EXTI_ClearITPendingBit(EXTI_Line12);
}
}

i should get interrupt on falling edge, when i touch touchscreen Pen_IRQ (PORTB leg 12) goes low, i double-checked that
12 REPLIES 12
elazhar
Associate II
Posted on July 10, 2013 at 11:49

I 've implemented 2 interrupt without any problem , but i fail to establish communication between  2 EVALST7540 . I send 0xAAAAAAAA(preamble)+F444(data)  but i can't receive anything on the second EVALST7540 and the pin CD_PD that detect a preamble or carrier is always high ( it means that i really receive nothing)

I'll be grateful if you tell me what could be the issue , what i have to check .

Thankx

elazhar
Associate II
Posted on July 18, 2013 at 16:44

Dear Clive1;

I'm using two eval boards ( EVALST7540-2) and one stm32 micrcontroller to establish communication ( KNX 110) between the two boards.

 I am testing a half duplex communication. One EVALST7540-2 transmits and the other is supposed to receive. The problem is that I don't receive anything and EVALST7540-2 who is supposed to receive was no longer responding( no longer providing any spi clock signal) . I cheked the Master Clock, and I there is also no signal. The only thing that I did, is changing the register configuration. I'm not sure that this could be the reason of the issue. I followed the Application Note about how to configure register.

Thus, I would like to have an exemple of register configuration for the EVALST7540 ( transmitter) and EVALST7540 ( receiver) that you are sure that it works very well and an exemple of a frame to transmit and what I'm supposed to receive.

 PS : I'm not using the demo kit, I'm really coding the configuration through the STM32 SPI.

Posted on July 18, 2013 at 18:55

I don't have any EVALST7540 boards, and the code you're asking for doesn't align with anything I'm working on. Maybe ST can provide you with a list of local consultants/contractors you can work with.

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