I am at my wits end!!
I think I have everything set correctly, yet when I send characters from a SI Labs CP2104-EK (USB to Serial converter) to my 5438 no interrupt is generated. I am using RealTerm for sending from the PC, so I can vary the baud rate and how the data gets sent.
This is what I send from the USB converter.
This is what I get back from the 5438, yet there is no interrupt.
Here is what I have in code.
Initialize
void UART3_Init (void) @ "CODE"
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
UCA3CTL1 |= UCSWRST; // **Put state machine in reset**
UCA3CTL1 |= UCSSEL_1; // ACLK
UCA3BR0 = 0x09; ; // = 1.125MHz 115200 (see User's Guide)
UCA3BR1 = 0x00; // 1MHz 115200
UCA3MCTL |= UCBRS_6 + UCBRF_0; // Modulation
UCA3CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
UCA3IE |= UCRXIE; // Enable USCI_A3 RX interrupt
__bis_SR_register(GIE); // interrupts enabled
__delay_cycles(10000);
}
ISR.c
#pragma location = "CODE"
#pragma vector=USCI_A3_VECTOR
__interrupt void USCI_A3_ISR(void)
{
switch(__even_in_range(UCA3IV,4))
{
char temp;
case 0:
break; // Vector 0 - no interrupt
case 2: // Vector 2 - RXIFG
//char temp;
temp = UCA3RXBUF;
some code is executed in the ISR but the ISR never gets called.
case 4: // Vector 4 - TXIFG
__delay_cycles(5000);//(5000); // Add small gap between TX'ed bytes
UCA3TXBUF = TXmsg[pmsg++];
if(nmsg==pmsg) UCA3IE &= ~UCTXIE; // disable USCI_A0 TX buffer
break;
default:
break;
}
Using IAR in debug mode I put a halt at the switch(__even_in_range(UCA3IV,4)) but no interrupt is generated.
The code is identical to the A0 UART and that works fine!
Thanks in advance for your help.