cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupts Crossworks

morphiq
Associate II
Posted on March 05, 2008 at 21:27

Interrupts Crossworks

2 REPLIES 2
morphiq
Associate II
Posted on May 17, 2011 at 09:50

Hi

I have problem to make any interrupt to work.

I tried many sample codes, but none of them work.

CODE for external interrupt P3.2

SCU_APBPeriphReset(__VIC, DISABLE);

SCU_APBPeriphReset(__WIU, DISABLE);

SCU_APBPeriphReset(__GPIO3, DISABLE);

SCU_APBPeriphReset(__RTC, DISABLE);

SCU_AHBPeriphClockConfig(__VIC, ENABLE);

SCU_APBPeriphClockConfig(__WIU, ENABLE);

SCU_APBPeriphClockConfig(__GPIO3, ENABLE);

SCU_APBPeriphClockConfig(__RTC, ENABLE);

WIU_DeInit();

WIU_InitTypeDef WIU_InitStructure;

WIU_Cmd(ENABLE );

WIU_ClearITPendingBit(WIU_Line26);

WIU_StructInit(&WIU_InitStructure);

WIU_InitStructure.WIU_Line = WIU_Line26 ;

WIU_InitStructure.WIU_TriggerEdge = WIU_FallingEdge ;

WIU_Init(&WIU_InitStructure);

// Select WIU line 26 as VIC1.10 interrupt source

SCU_WakeUpLineConfig(26);

VIC_DeInit();

// Initialize VICs Default vector address registers

VIC_InitDefaultVectors();

// Configure the External interrupt group 0 priority

VIC_Config(EXTIT0_ITLine, VIC_IRQ, 0);

// Enable the External interrupt group 0

VIC_ITCmd(EXTIT0_ITLine, ENABLE);

//#################### BUTTONS ####################

// Configure PORT3 lines in Input Push-Pull mode

GPIO_DeInit(GPIO3);

GPIO_StructInit(&GPIO_InitStructure);

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7;

GPIO_InitStructure.GPIO_Direction = GPIO_PinInput;

GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ;

GPIO_Init(GPIO3, &GPIO_InitStructure);

//buttons normally HIGH

########################################################

Another example for RTC:

RTC_DeInit();

RTC_PeriodicIntConfig(RTC_Per_2Hz);

RTC_TamperCmd(DISABLE);

RTC_AlarmCmd(DISABLE);

RTC_ITConfig(RTC_IT_Per, ENABLE);

RTC_ITConfig(RTC_IT_Alarm, DISABLE);

RTC_ITConfig(RTC_IT_Tamper, DISABLE);

RTC_ClearFlag(RTC_FLAG_Per|RTC_FLAG_Per|RTC_FLAG_Tamper);

VIC_DeInit();

VIC_Config(RTC_ITLine, VIC_IRQ, 1);

VIC_ITCmd(RTC_ITLine, ENABLE);

/////////////

The same with Timers....

No IRQHandler() is called... for any source!

This is a part of bigger project...

Maybe I forgot about some configuration or there is special action needed in CrossWorks...

Has anybody some examples working with CrossWorks 1.7

Sorry for english

morphiq
Associate II
Posted on May 17, 2011 at 09:50

I found solution...

__ARMLIB_enableIRQ(); // Enable gloabal Interrupts

Thats what I missed... It wasn't explained anywhere!

Now it works :D