Other Parts Discussed in Thread: MSP-EXP430FR5739
I'm having trouble with receiving bytes from a PC. PC is configured for 9600 baud. MSP430 is configured as below for 9600baud. Oscilloscope measurement confirms the datarate is 9600.
The issue I see is that some characters are recognized, but others are not.
The UCA0STATW.UCBUSY flag is set during the byte transfers, but UCRXIFG is only set on certain bytes, causing intermittent data reception.
I am using the Experimenters board so I am limited to 9600 baud, but I would expect a 1.5MHZ source clock to be more than sufficient for UART communications.
Do I need a better clock source than the built in DCO to get UART communication to work?
/*
* Source clock is DCO @ 24MHz. SMCLK = DCO/16
* SMCLK = 1.5Mhz BRCLK = 9600. N = 156 (.25)
* 156.25/16 = 9.76
* 0.76*16 = 12.25
* UCBTSx = 0x44 from lookup table (0.2503)
*/
UCA0CTLW0 = UCSSEL0 + UCSSEL1 + UCSWRST + UCPEN;
UCA0CTLW1 = UCGLIT_0;//2ns De-glitch time
UCA0BRW = 9;//configure the baud rate generator
UCA0MCTLW = (0x4400) + (12 << 4) + UCOS16;// configure the baud rate generator
UCA0CTLW0 &= ~UCSWRST;//Clear software reset.