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.

CCS/MSP430F5172: experiencing strange behaviour with UART

Part Number: MSP430F5172

Tool/software: Code Composer Studio

I'm somehow haveing strange problems with a MSP430F5172 and its uart.

I have connected another IC via uart (115200bps) to the microcontroller and wrote a code for communication (sending commands and checking reply).

Everything worked fine, I received the expected replies for every command. Until I disconnected the debugger and wanted to test with a battery as power supply. Without the FET being connected, I never got the correct reply (LED showing errors).

At first I thought, it must be the module, so I had a closer look on the MCU UART_RX line and checked the bit stream - looked fine. I also connected the RX pin of an FTDI UART cable to this line and got the correct values in hterm.

Then I suspected any misstuning in the SMCLK (by DCO and XTAL) and checked the frequency when FET connected and disconnected - everything looks good.

I already tested several core voltages and xtal drives.

Does anyone have any ideas or seen the same problem? I don't want to change the MCU as I only have one of these PCBs and don't want to destroy the pads...

Thanks for your help

  • What are the voltages?
  • I use 3V for the whole power supply.

  • I just found out, that the UCFE bit (framing error) gets set as soon as the debugger is not connected anymore to the PCB.
    I now enabled the UCRXEIE (receive erroneous character interrupt enable), but as expected that does not help much. It seems that I now receive some characaters, but still not all data.

    anyone any suggestions?
  • UCFE means a low stop bit.

    Either there is something wrong with the voltage levels, or with the timing. What clock source are you using? What is its accuracy?
  • As clock source for the DCO I use the crystal connected to XT1 and that is a CC5V-T1A with 20ppm and 12pF load cap. As load capacitance I apply the internal caps with 12pF, maybe too much.

    But I never experienced these problems, that uart works with while debugging with FET and stops working when FET gets disconnected.

  • The DCO does not have a clock source, it is a clock source.
    Are you actually using XT1 as clock source for the FLL?
    Are you using a low-power mode where the FLL is disabled, or where SMCLK is disabled? (This would explain why the debugger makes it work.)

  • Yes, XT1 is the source for the FLL and the DCO is selected for the SMCLK, which is used for the UART.
    But the problems was in the ucs setup.

    I copied the source from a working low-power project and implemented uart. In the ucs settings I had the SMCLKOFF bit set.
    To wait for receiving characters, I had a sleep-method that was using LPM0.
    Since I removed the SMCLKOFF bit, it works.

    As I understood the datasheet, if SMCLKOFF=1 and SMCLKREQEN=1 SMCLK remains active from LPM0 to LPM4.
    Did I misunderstood something here?

  • As shown in table 5-1 in the User's Guide, SMCLK indeed stays active if SMCLKREQ is set.

    But section 36.3.14 of the User's Guide says that the USCI module does not set SMCLKREQ while it is idle.

    This implies that DCO and FLL do not run continuously, and that the FLL does not have enough time to adjust the DCO to the correct frequency.

    I think you should not set SMCLKOFF.
  • 36.3.14 Using the USCI Module in UART Mode With Low-Power Modes

    The USCI module provides automatic clock activation for use with low-power modes. When the USCI clock source is inactive because the device is in a low-power mode, the USCI module automatically activates it when needed, regardless of the control-bit settings for the clock source. The clock remains active until the USCI module returns to its idle condition. After the USCI module returns to the idle condition, control of the clock source reverts to the settings of its control bits.

    I will just keep SMCLKOFF cleared, that works fine for me now :)

**Attention** This is a public forum