Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

lpc1768 external interrupt problem with cmsis

Status
Not open for further replies.

mahyarab

Newbie level 4
Joined
Jan 6, 2011
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,310
hi
i have a problem on using external interrupt in lpc1768 with cmsis library.
this is my code:

Code:

Code:
void EINT_IRQHandler()
{
      EXTI_ClearEXTIFlag(EXTI_EINT0);
      FIO_SetValue(0,(1<<22));
      
}

int main ()
{
    PINSEL_CFG_Type PinCfg;
    EXTI_InitTypeDef EXTICfg;

    PinCfg.Funcnum = 1;
    PinCfg.OpenDrain = 0;
    PinCfg.Pinmode = 0;
    PinCfg.Pinnum = 10;
    PinCfg.Portnum = 2;
    PINSEL_ConfigPin(&PinCfg);


    EXTI_Init();

    EXTICfg.EXTI_Line = EXTI_EINT0;
    /* edge sensitive */
    EXTICfg.EXTI_Mode = EXTI_MODE_EDGE_SENSITIVE;
    EXTICfg.EXTI_polarity = EXTI_POLARITY_LOW_ACTIVE_OR_FALLING_EDGE;
    EXTI_ClearEXTIFlag(EXTI_EINT0);
    EXTI_Config(&EXTICfg);
    /*
    NVIC_SetPriorityGrouping(4);
    NVIC_SetPriority(EINT0_IRQn, 0);
    */
    NVIC_EnableIRQ(EINT0_IRQn);

    int i=0;
    for(i=0;i<10000000;i++);
    FIO_SetDir(0,(1<<21),1);
    FIO_SetDir(0,(1<<22),1);
    FIO_SetValue(0,(1<<21));

    while(1)
    {
    }

    return 0;
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top