Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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 RX using interrupts

Other Parts Discussed in Thread: MSP430FR5949

I'm programming an MSP430FR5949 and I've been trying every which way to get a UART interrupt handler to receive data while in a low power mode.  I can transmit with no problem:  stick a byte in the buffer and sleep until the buffer empty interrupt wakes up the routine.  But with receive I just can't get it to work. If I stay awake and just poll for the receive buffer to be full I have no problem, but if it go to any low power mode and wait for the interrupt to wake up from an RX interrupt I get garbage.  Instead of the 15 bytes being sent I get perhaps 6 and the data is garbage.  If confirmed this by having a very short interrupt routine that simply stores the received byte in a buffer and increments a buffer counter.  So the interrupt routine itself can store all the bytes I'm receiving.  If the main program goes into a low power mode (it doesn't matter which one), the interrupt routine doesn't work. If I switch the low power mode command to while(1) and just put the program into an endless loop the interrupt routine works flawlessly.  My UART is running at 115Kbaud.  If tried DCO and MCLK speeds of 1MHz, 4MHz and 8MHz.  The Uart is running of the SMCLK at 1MHz.

I've seen a comment in another forum that said: "If you are using the DCO as the clock source for the UART then it is likely drifting like ours was. If the system wakes up in your main loop and goes back to sleep before three clock cycles of the DCO reference clock then the FLL will incorrectly set the DCO."  I'm wondering if this is my problem.  I don't really understand what this comment is saying, and have even less of an idea of how to get around this problem.  I've seen mention by other folks that have a problem with receiving in sleep mode, and I haven't yet found any sample programs that do it.  Any assistance would be very much appreciated.

  • BRCLK @ 1MHz for 115k baud has a quite large RX error in general, but if it works without LPM, then this isn't your problem.

    Have you tried if it works with lower baudrates? In example 9600 just for testing.

    Dennis

  • I haven't tried it slower. I spent a few days getting to the point where I confirmed that my problem was because of sleep mode. I'm hoping to get an answer that leads to an understanding of what is going on, rather than just find a work around. 115K is the optimum speed for what I'm doing, so I'd like to get it to work as efficiently as I can at that speed.
  • I did not want to persuade you to use 9600 baud instead of 115k. But for finding the reason for an unwanted/unclear behaviour you sometimes have to go a few steps back to gradually move forward again.

    Maybe coming out of the sleep mode does take too long at this high speed? If you receive only one single byte - is this correct?

    Dennis

**Attention** This is a public forum