xpress_embedo
Advanced Member level 4
- Joined
- Jul 5, 2011
- Messages
- 1,154
- Helped
- 161
- Reputation
- 396
- Reaction score
- 189
- Trophy points
- 1,353
- Location
- India
- Activity points
- 10,591
Hello!!! i am trying to use the PIC32MX795F512L External Interrupt, i am using XC32 compiler and MPLAB X IDE.
As most of you are aware of legacy libraries coming with compiler, so i dont want to use the old ones, i want to use the new ones.
but my code is now working with the new one, and working with the old one, here is my code for both cases.
OLD ONE
When using the New Library, it is as follow:-
NEW ONE
The New one is not working, means on pressing a button i am not going in interrupt.
While the old one works.
I had enabled the Multivectored and Global Interrupt in my code.
Please reply as soon as possible.
As most of you are aware of legacy libraries coming with compiler, so i dont want to use the old ones, i want to use the new ones.
but my code is now working with the new one, and working with the old one, here is my code for both cases.
OLD ONE
Code:
//ISR
void __ISR(_EXTERNAL_1_VECTOR,IPL6SOFT) External_Interrupt_1(void)
{
mINT1ClearIntFlag();
}
//Main
mINT1SetIntPriority(6);
mINT1SetEdgeMode(0);
mINT1IntEnable(1);
When using the New Library, it is as follow:-
NEW ONE
Code:
//ISR Code
void __ISR(_EXTERNAL_1_VECTOR,IPL6SOFT) External_Interrupt_1(void)
{
INTClearFlag(INT_SOURCE_EX_INT(INT_INT1));
}
//In main
/*
* Enable External Interrupt-1
*/
/*Interrupt on Falling Edge*/
ConfigINT1(FALLING_EDGE_INT);
//
/*Enable External Interrupt-1 Priority to Level-6*/
INTSetVectorPriority(INT_VECTOR_EX_INT(INT_INT1),INT_PRIORITY_LEVEL_6);
/*Enable External Interrupt-1 Sub-Priority to Level-3*/
INTSetVectorSubPriority(INT_VECTOR_EX_INT(INT_INT1),INT_SUB_PRIORITY_LEVEL_3);
/*Clear External Interrupt-1 Interrupt Flag*/
INTClearFlag(INT_SOURCE_EX_INT(INT_INT1));
/*Enable the External Interrupt-1*/
INTEnable(INT_SOURCE_EX_INT(INT_INT1),INT_ENABLED);
The New one is not working, means on pressing a button i am not going in interrupt.
While the old one works.
I had enabled the Multivectored and Global Interrupt in my code.
Please reply as soon as possible.