Timer Registers (mtime)

(Ask a Question)

mtime is a 64-bit read-write register that counts the number of cycles of the rtc_toggle signal. A timer interrupt is pending whenever mtime is greater than or equal to the value in the mtimecmp register. The timer interrupt reflects in the mtip bit of the mip register described in Machine Interrupt Pending Register (mip). At Reset, mtime is cleared to zero, the mtimecmp registers are not reset.

The mtime register increments every 1 µs (1 MHz), which is the input frequency of the RTC clock. For more information about rtc_toggle application, see the example project at driver-examples/mss/mss-rtc on the GitHub page.