Hi,
Does anyone know if there is a difference between USCI0 and USCI1 on MSP430F2419 UART mode?
My problem is that I have a code for treating received characters via a TUSB3410 converter and it works when I connect the converter to USCI0 but not on USCI1.
The working code is (from MSP430 examples):
P3SEL = 0x30; // P3.4,5 = USCI_A0 TXD/RXD
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 8; // 1MHz 115200
UCA0BR1 = 0; // 1MHz 115200
UCA0MCTL = UCBRS2 + UCBRS0; // Modulation UCBRSx = 5
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt
__bis_SR_register(GIE); // interrupts enabled
It has the following interrupt routine:
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void)
{
receiveflag = 1;
receiveBuffer = UCA0RXBUF;
}
I tried to adapt it to use USCI1 but it does not work. The only difference I found in the datasheet was the name of the registers that control the interrupt enabling:
P3SEL = 0xC0; // P3.6,7 = USCI_A1 TXD/RXD
UCA1CTL1 |= UCSSEL_2; // SMCLK
UCA1BR0 = 8; // 1MHz 115200
UCA1BR1 = 0; // 1MHz 115200
UCA1MCTL = UCBRS2 + UCBRS0; // Modulation UCBRSx = 5
UCA1CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
UC1IE |= UCA1RXIE;
__bis_SR_register(GIE); // interrupts enabled
#pragma vector=USCIAB1RX_VECTOR
__interrupt void USCI1RX_ISR(void)
{
receiveflag = 1;
receiveBuffer = UCA1RXBUF;
}