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.

TM4C123GH6PM: Use of RTC clock when no 32768hz crystal is attached to mcu

Part Number: TM4C123GH6PM

Hello,

Is it possible to use the RTC, while the unit is powered up if no 32768hz crystal is attached to the microcontroller?

I have tried:

    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);                        // hibernate module setup
    while(!MAP_SysCtlPeripheralReady(SYSCTL_PERIPH_HIBERNATE)) {}
    
    MAP_HibernateClockConfig(HIBERNATE_OSC_LFIOSC);
    MAP_HibernateRTCEnable()

But system hangs. If I use

MAP_HibernateClockConfig(HIBERNATE_OSC_LOWDRIVE);

instead of the OSC_LFIOSC then system does not hang, but RTC does not count neither.

Best regards,

C.

  • Hi Can,

      Yes, you need to have the external 32.768kHz crystal in order to use RTC. 

    7.3.2 Hibernation Clock Source
    In systems where the Hibernation module is used, the module must be clocked by an external source
    that is independent from the main system clock, even if the RTC feature is not used. An external
    oscillator or crystal is used for this purpose. To use a crystal, a 32.768-kHz crystal is connected to
    the XOSC0 and XOSC1 pins. Alternatively, a 32.768-kHz oscillator can be connected to the XOSC0
    pin, leaving XOSC1 unconnected. Care must be taken that the voltage amplitude of the 32.768-kHz
    oscillator is less than VBAT, otherwise, the Hibernation module may draw power from the oscillator
    and not VBAT during hibernation. See Figure 7-2 on page 496 and Figure 7-3 on page 497.

    7.3.5 Real-Time Clock
    The RTC module is designed to keep wall time. The RTC can operate in seconds counter mode. A
    32.768 kHz clock source along with a 15-bit predivider reduces the clock to 1 Hz. The 1 Hz clock
    is used to increment the 32-bit counter and keep track of seconds. A match register can be configured
    to interrupt or wake the system from hibernate. In addition, a software trim register is implemented
    to allow the user to compensate for oscillator inaccuracies using software.