Part Number: MSP430FR6989
Other Parts Discussed in Thread: MSP-EXP430FR6989
Tool/software: Code Composer Studio
I am a beginner and trying to run the below program in MSP430FR6989 to access the back channel UART. But I face the following problems,
1. CCS displays 2 warnings stating , #2580-D pragma vector= accepts numeric arguments or "unused_interrupts" but not USCIAB0RX_VECTOR.
2. With IE2 |= UCA0RXIE; CCS throws error and it is error free by using UCA0IE |= UCRXIE;
Upon choosing the exact terminal with reference to device manager I could not see any data in the respective terminal.
#include <msp430fr6989.h>
#include <stdio.h>
char string1[]="Hello /n /r";
char i=0;
char j =0;
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
PM5CTL0 = 0x00;
P3SEL0 |= BIT4 | BIT5;
P3SEL1 &= ~(BIT4 | BIT5);
UCA0CTL1 |= UCSSEL_1; // CLK = ACLK
UCA0BR0 = 0x03; // 32kHz/9600 = 3.41
UCA0BR1 = 0x00; //
UCA0MCTLW = UCBRS1 + UCBRS0; // Modulation UCBRSx = 3
UCA0CTL1 &= ~UCSWRST;
UCA0IE |= UCRXIE;//IE2 |= UCA0RXIE;
__bis_SR_register(LPM3_bits + GIE); // Enter LPM3, interrupts enabled
}
#pragma vector=USCIAB0TX_VECTOR
__interrupt void USCI0TX_ISR(void)
{
UCA0TXBUF = string1[i++];
if (i == sizeof string1)
{
UCA0IE &= ~UCTXIE;//IE2 &= ~UCA0TXIE;
}
}
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void)
{
string1[j++] = UCA0RXBUF;
if (j > sizeof string1 - 1)
{
i = 0;
j = 0;
UCA0IE &= ~UCTXIE;//IE2 |= UCA0TXIE;
UCA0TXBUF = string1[i++];
}
}