Hey! So I'm continuing from this post, and I need some feedback on what could cause an interrupt to not work as it should. For some more information regarding my project, I'm working with the SPI module on the MSP430FR5739
.
So far, I know that in order to enable the interrupt, I have to set the interrupt enabler in its specified register. I know that I have to do this after I set the other settings for the module, and when I enable the module. Once I do this, I have to create an ISR, which can look something like this:
#pragma vector=USCI_A0_VECTOR
__interrupt void USCI_A0_ISR(void)
{
while(~(UCA0IFG & UCTXIFG));
UCA0TXBUF = transmitData;
receiveData = UCA0TXBUF;
transmitData++;
}
// trap isr assignation - put all unused ISR vector here
#pragma vector = ADC10_VECTOR, PORT2_VECTOR, PORT1_VECTOR,\
TIMER0_A0_VECTOR, TIMER0_A1_VECTOR, WDT_VECTOR, COMP_D_VECTOR, \
DMA_VECTOR, PORT3_VECTOR, PORT4_VECTOR, RTC_VECTOR, \
SYSNMI_VECTOR, TIMER0_B0_VECTOR, TIMER0_B1_VECTOR, \
TIMER1_A0_VECTOR, TIMER1_A1_VECTOR, TIMER1_B0_VECTOR, \
TIMER1_B1_VECTOR, TIMER2_B0_VECTOR, TIMER2_B1_VECTOR, \
UNMI_VECTOR, USCI_A1_VECTOR, USCI_B0_VECTOR
__interrupt void TrapIsr(void)
{
// this is a trap ISR - check for the interrupt cause here by
// checking the interrupt flags, if necessary also clear the interrupt
// flag
}
I've also added a trap ISR, in case other ISR are called by accident. I'm not sure if I have to clear the interrupt flag inside the ISR, or if the system does it itself. Either way, I don't understand why an interrupt would not be called when all the initializing steps have been called. Please let me know if I'm missing something to do with these interrupts. Thanks