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.

UART MSP430G2153 to MSP430F149

Hello,

I'm having problem getting these to communicate. I'm using the TI example code for both these parts at 9600 baud rate, the G2153 is sending and the F149 is receiving. I've checked that the right pins are connected as well as ground. I also tried using the G2153 with a F5438 and that worked fine, so I'm not sure why the F149 is not. I attached the code for both. Thanks.

 

8867.fet140_uart01_09600.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//******************************************************************************
// MSP-FET430P140 Demo - USART0, UART 9600 Echo ISR, HF XTAL ACLK
//
// Description: Echo a received character, RX ISR used. Normal mode is LPM0,
// USART0 RX interrupt triggers TX Echo. Though not required, MCLK = LFXT1
// ACLK = MCLK = UCLK0 = LFXT1 = 3.58MHz
// Baud rate divider with 3.58Mhz XTAL @9600 = 3.58MHz/9600 = 372 (0174h)
// //* An external 3.58Mhz XTAL on XIN XOUT is required for ACLK *//
//
// MSP430F149
// -----------------
// /|\| XIN|-
// | | | 3.58MHz
// --|RST XOUT|-
// | |
// | P3.4|------------>
// | | 9600 - 8N1
// | P3.5|<------------
//
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

8322.test.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//******************************************************************************
// MSP430G2xx3 Demo - USCI_A0, SPI 3-Wire Slave Data Echo
//
// Description: SPI slave talks to SPI master using 3-wire mode. Data received
// from master is echoed back. USCI RX ISR is used to handle communication,
// CPU normally in LPM4. Prior to initial data exchange, master pulses
// slaves RST for complete reset.
// ACLK = n/a, MCLK = SMCLK = DCO ~1.2MHz
//
// Use with SPI Master Incremented Data code example. If the slave is in
// debug mode, the reset signal from the master will conflict with slave's
// JTAG; to work around, use IAR's "Release JTAG on Go" on slave device. If
// breakpoints are set in slave RX ISR, master must stopped also to avoid
// overrunning slave RXBUF.
//
// MSP430G2xx3
// -----------------
// /|\| XIN|-
// | | |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • How do you generate the baudrate for the 149? The 5438 ahs an itnernal, calibrated 32768Hz clock source. The 149 doesn't. So maybe its ACLK is just not clocking and it receives at 0Bd.

  • Our F149 came with the Olimex EasyWeb3 board which has a 8mhz oscillator crystal. http://www.olimex.com/dev/msp-easyweb3.html

    I see in the example code notes that the code requires //* An external 3.58Mhz XTAL on XIN XOUT is required for ACLK *//

    What is XIN/XOUT and how can I check what crystal we have connected on it? Thank you.

  • James Yu said:
    What is XIN/XOUT

    They are pin names.

    The Datasheet will show you what physical pins have the XIN and XOUT functions on the particular package that you are using.

    how can I check what crystal we have connected on it?

    Look at the Circuit Diagram or "Schematic" - it is available from the Olimex page that you linked.

     

  • James Yu said:
    //* An external 3.58Mhz XTAL on XIN XOUT is required for ACLK *//

    Why that? I mean, why this frequency? Okay, I see...

      UBR00 = 0x74;                             // 3.58Mhz/9600 - 372
      UBR10 = 0x01;                             //
      UMCTL0 = 0x00;                            // no modulation

    These lines are the key: UBR10 and UBR00 are a 16 bit divider. It is 372 in this case, and 3580000/371 is 9600.
    If you change these three lines according to the table in the users guide, you can use any crystal.
    Note that you'll need 3.6V VCC to run the 149 with 8MHz.

    The comment in the demo code should be extended by " for any other crystal frequency, the divider needs to be adjusted accordingly"

    James Yu said:
    What is XIN/XOUT and how can I check what crystal we have connected on it? Thank you.

    XIN/XOUT ar ethe pins where you connect an external crystal to and use it as XT1 inside teh MSP. Some MSPs also have X2IN and X2OUT.
    XIN/XOUT can be usually used for either a low-power 32768Hz watch crystal or a >1MHz HF crystal with external capacitors.
    HF crystals usually have their frequencies written onto them (like "8.000" = 8MHz). They usually have a flat, rectangular case. Watch crystals are usually small, thin cylinders with no label.

  • I adjusted the divider for our 8mhz crystal and it works now, thanks!

  • Can you attach your completed code? I also have a problem with easyweb's uart now

**Attention** This is a public forum