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.

MSP430F5659: RTC not running when disconnected from FET

Part Number: MSP430F5659

Hello,

I have two custom made boards with MSP430F5659. RTC B works just fine during the debug session, and doesn't work when I disconnect FET and run the program freely. Both my boards have the same problem. Looking at the scope it seems that XT1 crystal is working (frequency is close to 32768 Hz, very stable, picture is attached). I'd really appreciate any suggestions on what might be wrong. I am using CCS v6.2 and TI-16.9.6 compiler

Thanks!

Kirill

  • Boards are not powered through FET, they are powered either from a battery or USB. When connected to USB, I set up RTC, then can read back RTC using the following function (code for sending over USB is omitted):

    void usb_get_rtc(void)
    {
    
    	while(!(RTCCTL1 & 0x10))	// Wait until RTCRDY is HIGH
    		;
    
    // send over usb and wait till done
    
    }

    My program gets stuck after I try doing this. The only place where it can be stuck is while() loop. And I've seen some threads where people were saying that RTCRDY was in RESET all the time. I guess the same thing happens to me, but I don't understand what's the reason for this, especially knowing that it works when I am in debug mode with FET connected.

  • I found the issue. Although the program resets LOCKBACK during the initialization to let XT1 crystal to start, when running without debugger LOCKBACK sets again. Placing a function to reset LOCKBACK after writing to RTC B control registers has solved the problem.
  • Hi Kirill,
    The EEM will change timings during debug, so function of the RTC cannot always be trusted.

    How are you setting your RTC up?
    Did you start with example code?
  • Hi Kirill,
    Good to see that you found the issue.

**Attention** This is a public forum