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: Hibernate module write/read timing

Part Number: TM4C123GH6PM

In section 7.3.1 of the TM4C datasheet (Register Access Timing), the timing requirement is described like so:

"...hibernation registers must be written only with a timing gap between accesses... software must guarantee that this delay is inserted between back-to-back writes to Hibernation registers or between a write followed by a read."

Given that reads are normally performed at the full peripheral clock rate (not requiring any delays to be inserted), I'm wondering if it's possible to read different hibernation registers after a write to one register, without waiting for WRC or any similar delay mechanism. It's quite clear that reading back the same register without waiting will fail, but could a different register be read? Here's what I'm trying to do (this is in an ISR):

/* Read the masked interrupt status. */
ulStatus = HibernateIntStatus(true);

HibernateIntClear(ulStatus)

/* Get the current match (the time that triggered this interrupt). */
ulMatchS = HibernateRTCMatchGet(0);

As it stands, the HibernateIntClear call busy-waits on the WRC bit before returning, and I've measured a significant time penalty in the ISR due to this call.

Can I read from that match register (or any hibernate register which is NOT HIB_IC, the one being written to) without waiting for WRC? I'd like to defer checking for WRC until it's absolutely necessary, if possible, and I do realize that means venturing away from driverlib.

Thanks!

  • Hi Matt,
    At first glance I may have the same rationale as you to read without waiting since the read is performed on a different register. But No, I would not recommend bypassing polling the WRC for a read. If the read of a different register is safe to perform without waiting for WRC then the datasheet would have said so. That is the first reason. The second reason is that Hibernate operates at a different clock domain (i.e. 32kHz) from the CPU (running at 80MHz). There is synchronization to be done when a signal is crossing clock domains. While you are writing to a register, the internal bus is busy trying to first synchronize the data coming from the CPU to a much slower clock domain. It can't perform a read at the same time. If you try to read while the write is still going on, the read value can be wrong or just garbage or internally get waited due to the interlock mechanism.

    The datasheet again says that the read needs to wait for WRC to start 'safely'.
    "software may make use of the WRC bit in the Hibernation Control (HIBCTL) register to ensure that
    the required timing gap has elapsed. This bit is cleared on a write operation and set once the write
    completes, indicating to software that another write or read may be started safely. Software should
    poll HIBCTL for WRC=1 prior to accessing any hibernation register."
  • Charles,

    Thank you for confirming that - much appreciated.