cancel
Showing results for 
Search instead for 
Did you mean: 

problem configuring STR912 port as external interrupt

dk_vhd
Associate II
Posted on January 15, 2009 at 23:32

problem configuring STR912 port as external interrupt

5 REPLIES 5
dk_vhd
Associate II
Posted on May 17, 2011 at 09:57

I got it. It seems that the library version i have does not have all the requisite functions such as VIC_InitDefaultVectors(), so I added few lines as :

VIC0->DVAR = 0xffffffff;

VIC1->DVAR = 0xffffffff;

I was able to get it running. However, can you please suggest me place for the updated libraries. I am using IAR for compiling.

Thanks again for your help.

[ This message was edited by: dk_vhd on 13-01-2009 19:58 ]

dk_vhd
Associate II
Posted on May 17, 2011 at 09:57

I am a newbie am working on a STR912 development board. I want to use external interrupt for IR interface (such as remote). I am using the following configuration in main function :

GPIO_DeInit(GPIO3);

GPIO_Struct.GPIO_Pin= GPIO_Pin_2;

GPIO_Struct.GPIO_Direction=GPIO_PinInput;

GPIO_Struct.GPIO_Type=GPIO_Type_PushPull;

// GPIO_Struct.GPIO_Alternate = GPIO_InputAlt1;

GPIO_Struct.GPIO_IPConnected = GPIO_IPConnected_Enable;

SCU_WakeUpLineConfig(2);

GPIO_Init(GPIO3,&GPIO_Struct);

I am trying to use EXTIT2() handler function provided in 91x_it.c. However I cannot make it work. How do I setup the code to access this handler ?

Can somebody help please...

Thanks in Advance

kais
Associate II
Posted on May 17, 2011 at 09:57

Hi dk_vhd,

Looking to your peace of code, you are not using the right external interrupt line.

In fact, the external interrupt triggered through Pin 3.2 belongs to EXTIT0_ITLine, hence you have to use EXTIT0_IRQHandler() instead.

Moreover you are not obliged to configure GPIO3.2 since the

Default Input Function of the pin is as external interrupted pin.

Please find attached a main program showing to you how to proceed.

Kind regards,

Eris.

kais
Associate II
Posted on May 17, 2011 at 09:57

Hi,

You can download the last STR9 firmware library, directly from ST web site:

http://www.st.com/stonline/products/support/micro/files/um0233.zip

Regards,

Eris.

dk_vhd
Associate II
Posted on May 17, 2011 at 09:57

After I have intialized the interrupt, my next step is to start a timer which I have done as follows:

...

TIM_InitStructure.TIM_Mode = TIM_OCM_CHANNEL_1;

TIM_InitStructure.TIM_OC1_Modes = TIM_TIMING;

TIM_InitStructure.TIM_Clock_Source = TIM_CLK_APB;

TIM_InitStructure.TIM_Clock_Edge = TIM_CLK_EDGE_FALLING;

TIM_InitStructure.TIM_Prescaler = 0x64;

TIM_InitStructure.TIM_Pulse_Length_1 = 0x3BB;

TIM_Init (TIM0, &TIM_InitStructure);

/*Enable TIM1 Output Compare1 Interrupt */

TIM_ITConfig(TIM0, TIM_IT_OC1, ENABLE);

However, I still have to stop the code from executing EXT0_IRQHandler() repeatedly. Can I use WIU_ClearITPendingBit(WIU_Line2) funtion to clear the recieved interrupt ?

Also, same would be needed for the timer as well. I am not sure if the above method is good way to generate a timer interrupt for waiting for real time (say 100 ms) ?

Infact I am using the following routine in the EXTIT0_IRQHandler() function:

VIC0->VAR = 0xffffffff;

VIC1->VAR = 0xffffffff;

However, the interrupt dont seem to be stopping and is entering into IRQ handler function repeatedly.

Can you suggest me how to stop this repeated occurence ?

Thanks in Advance

[ This message was edited by: dk_vhd on 16-01-2009 17:49 ]