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.

RTOS: MSP432 Real Time Clock

Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hi,

For my project I need a real time clock. Unfortunately I can't find any example how to implement it.
I'm using MSP432.


Thank you for your help

  • Hi User,
    You can look at the SYS/BIOS Seconds module for MSP432. It uses the RTC to provide APIs used by the SYS/BIOS time() function. You can find the code in <TI-RTOS_INSTALL_DIR>/products/bios_xx_xx_xx_xx/packages/ti/sysbios/family/arm/msp432/Seconds.c.
    Best regards,
    Janet
  • Thank you Janet,

    I've tried:

       Seconds_set(1412800000);
    
        while (1) {
    
            uint32_t sec = Seconds_get();
    
            System_printf("Sec = %i\n", sec);
    
            System_flush();
    
            Task_sleep((UInt)arg0);
    
            GPIO_toggle(Board_LED0);
    
        }


    And it seams to work.

    Then I commented out the set command:

    //Seconds_set(1412800000);


    After the that the time does not increase every second.

    I haven't unplugged the device from AC. 

    Does it mean that I have to set the time every time I rebuild the program or my RTC is not working like it should.

    Thank you!
    Miha

  • Hi Miha,

    For MSP432, Seconds_set() starts the real-time clock by clearing the RTCHOLD bit in the RTCCTL1 register.  On reset, the RTCHOLD bit is 1.  Here is the information from the data sheet:

    Best regards,

    Janet

  • Hi Janet,

    Can you please help me, how do I set a value to a register in TI RTOS?

    Thank you for your help.

  • Found :D

    RTCCTL1 |= RTCHOLD

    TNX!