Tool/software: TI C/C++ Compiler
Hey Everyone;
I`m trying to use the interrupt in PORT4.5 but when I press the button the code stuck in ISR_TRAP
.sect ".text:_isr:__TI_ISR_TRAP"
.align 2
.global __TI_ISR_TRAP
__TI_ISR_TRAP:
BIS.W #(0x0010),SR
JMP __TI_ISR_TRAP
NOP ; CPU40 Compatibility NOP
I`m using timer interrupt to blink the led ( heart beat in PORT1.0 ) and interrupt in PORT 4.5
oid Timer1_A3_1k5Hz(void)
{
//Timer_A_initUpMode(TIMER_A1_BASE, TIMER_A_CLOCKSOURCE_ACLK, TIMER_A_CLOCKSOURCE_DIVIDER_1,
// 25, TIMER_A_TAIE_INTERRUPT_DISABLE, TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE, TIMER_A_SKIP_CLEAR); // 1.5KHz`
Timer_A_initUpModeParam param = {0};
param.clockSource = TIMER_A_CLOCKSOURCE_ACLK;
param.clockSourceDivider = TIMER_A_CLOCKSOURCE_DIVIDER_1;
param.timerPeriod = 3899; // for 500ms
// param.timerPeriod = 23; // for 1.5kHz
param.timerInterruptEnable_TAIE = TIMER_A_TAIE_INTERRUPT_DISABLE;
param.captureCompareInterruptEnable_CCR0_CCIE = TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE;
param.timerClear = TIMER_A_SKIP_CLEAR;
Timer_A_initUpMode(TIMER_A1_BASE, ¶m); // 1.5KHz
Timer_A_startCounter(TIMER_A1_BASE, TIMER_A_UP_MODE);
}
void GPIO4P5_INTERRUPT(void)
{
P4OUT = BIT5;
/* Port 4 Resistor Enable Register */
P4REN = BIT5;
/* Port 4 Interrupt Edge Select Register */
P4IES = BIT5;
/* Port 4 Interrupt Flag Register */
P4IFG = 0;
/* Port 4 Interrupt Enable Register */
P4IE = BIT5;
}
#pragma vector=TIMER1_A0_VECTOR
__interrupt void TIMER1_A0_ISR_HOOK(void)
{
LED_NFC_Link_Toggle();
}
__interrupt void PORT4_ISR_HOOK(void)
{
switch(__even_in_range(P4IV, P4IV_P4IFG7))
{
case P4IV_NONE: break; // Vector 0: No interrupts pending;
// case P4IV_P4IFG0: break; // Vector 2: P4IFG.0;
// case P4IV_P4IFG1: break; // Vector 4: P4IFG.1;
// case P4IV_P4IFG2: break; // Vector 6: P4IFG.2;
// case P4IV_P4IFG3: break; // Vector 8: P4IFG.3;
// case P4IV_P4IFG4: break; // Vector 10: P4IFG.4;
case P4IV_P4IFG5:
flag_int = 1;
P4IFG &= ~BIT5; // Clear P4.5 IFG
break; // Vector 12: P4IFG.5;
// case P4IV_P4IFG6: break; // Vector 14: P4IFG.6;
// case P4IV_P4IFG7: break; // Vector 16: P4IFG.7;
default: break;
}
I`m resetting the interrupt of PORT4.5 but the code stuck.
May someone help me understand the problem? Thank you and best regards