diff --git a/cpu/kinetis/periph/rtt.c b/cpu/kinetis/periph/rtt.c index 4bbf3240d0c98951d79203c77afc40ace21cc56b..ee22cf63f504dff702c87565e5b8e59119a478f6 100644 --- a/cpu/kinetis/periph/rtt.c +++ b/cpu/kinetis/periph/rtt.c @@ -110,6 +110,8 @@ void rtt_set_counter(uint32_t counter) { /* Disable time counter before writing to the timestamp register */ bit_clear32(&RTC->SR, RTC_SR_TCE_SHIFT); + RTC->TPR = 0; + /* write TSR after TPR, as clearing TPR bit 14 will increment TSR */ RTC->TSR = counter; /* Enable when done */ bit_set32(&RTC->SR, RTC_SR_TCE_SHIFT);