Tool/software: Code Composer Studio
Hello,
I have the problem that in the received data string often (but not always) the first byte of an incoming string is ignored (isn't received at all) by the MSP430FR5994. When I use an external "serial port monitor" software, it shows that all the incoming bytes looks right. So the problem must be somewhere in the MSP430FR5994 interrupt function, witch ignore the first received byte. All other bytes are received well. As soon as the first byte is the address byte, and I don't know if, or if not, the first byte is received, it seems impossible to say "always ignore the first byte, and start transmission with the second byte", as I read in some forums.
For information, the MSP430FR5994 sending data string works well. I use P54 and P55 with 115200bps for this UART.
void initUART2(void) //UART_2
{ UCA2CTLW0 = UCSWRST;
UCA2CTLW0 |= UCSSEL__SMCLK;
UCA2BR0 = 2;
UCA2BR1 = 0x00;
UCA2MCTLW |= UCOS16 | UCBRF_2 | 0x0300;
UCA2CTLW0 &= ~UCSWRST;
UCA2IE |= UCRXIE;
received_bytes=0;
unsigned int i;
for (i=0;i<LENGHT_BUFFER;i++)
{recbuf[i]=0x00;}
}
#pragma vector=USCI_A2_VECTOR
__interrupt void usart2_rx(void)
{ recbuf[received_bytes]= UCA2RXBUF;
received_bytes+=1;
}
int main(void)
{ ...
initPorts();
initUART2();
...
while(1)
{... //do something with recbuf[]
if (nothing else to do)
{LPM1;}
}
}
What should I change to receive securely all the bytes by the MSP430FR5994?
Thank you very much for your help.