[riot-devel] Question about hwtimer_now implementation..

Johann Fischer johann_fischer at posteo.de
Tue Oct 14 23:53:41 CEST 2014

Hello Michael, Joakim and list,

On Tue, 14 Oct 2014 22:06:53 +0200
Joakim Gebart <joakim.gebart at eistec.se> wrote:

> Hello Michael and list,
> This is a problem that I ran into as well when porting RIOT to another
> Freescale CPU (K60, Cortex-M4). I have 4x 32 bit timers (called the
> PIT module), all running at 48 MHz, which means it will overflow after
> only 90-ish seconds, or another timer running at 32.768 kHz (called
> the LPTMR module), but it is only 16 bit, so it will overflow after 2
> seconds. Another trivial problem is the fact that many timers on the
> K60 are down counting. It is however possible to chain the PIT timers
> to each other to achieve a frequency lower than 48 MHz by using two or
> more timers/counters together.

I work currently also on a Kinetis Cortex-M4. All PITs are down counting. My
temporary solution is to chain the PITs.

> I don't know how much alike the KL46Z and the K60 are, I guess that
> there are many major differences (Cortex-M4 vs. Cortex-M0+), but maybe

As I understand, the peripheral is common to all Kinetis. Who is still working
with the Kinetis? Can we work on cpu/kinetis_common together?

> you could find something of use for your porting efforts in my WIP
> branch. I have been meaning to change the hwtimer implementation to
> use the LPTMR module instead of the PIT module in order to keep
> running even during STOP modes to conserve power, but I haven't gotten
> around to it yet. I only work on this project when I have some spare
> time in the evenings or weekends.


More information about the devel mailing list