This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I have used the same code many times to set up the UART0 at 9600. when using a crystal tied to xin/xout. Now i'm using a MSP430F247 with an external 32Khz clock tied to XIN only. The UART receives data okay at 9600, but when I transmit I get all 0's or all ones? I looked at P5.6(ACLK) and it is at 32KHZ. Am i missing something?.
I use this code to set up the UART.
BCSCTL3=XT2S_3+LFXT1S_3; //clock set up
P3SEL = 0x30; // all pins of PORT3 dio except 4,5 are usbtxrx
P3DIR = 0xF7; //ALL OUT EXCEPT P3.3,4,5 usb
P3OUT = 0xCE;
UCA0CTL1=01;//reset as puc
UCA0CTL1 |= UCSSEL_1; // CLK = ACLK
UCA0BR0 = 0x03; // 32kHz/9600 = 3.41 use 3
UCA0BR1 = 0x00; //
UCA0MCTL = UCBRS1 + UCBRS0; // Modulation UCBRSx = 3
UCA0CTL1 &= ~UCSWRST;
When you see correct clock at the ACLK pin, then there's nothing wrong with the clock itself.
What do you see at the TXD pin? (Output a series of 0x55 bytes to get a nice square wave.)
I got it to work, but not really sure what was wrong. it might have been a pullup too weak on the optocoupler that isolates the tx,rx from the USB bridge chip I'm using.
Thanks for your help
**Attention** This is a public forum