Hi Johann, hi Gebart,

first I have to say that I have not worked with any Kinetis MCU so far, so don't nail me down on details...

As far as I see it, we have a short- and a longterm solution: For now I think the using the LPTMR seems reasonable, although it only offers a single channels if I see it right. As for the offered resolution this should be fine as long as there are no drivers and/or other application code, that needs this resolution...

For the long-term we are planning/working on a new timer infrastructure substituting the hwtmer and the vtimer. One design objective is a more flexible backend that can cope with downcounting and similar, so that the PIT timers should be usable. Addressing the power-down and sleep issues of the timers and finding a generic way to deal with this is also on the requirements list... I actually expect some serious work on this starting by mid-January, so it's only a matter of time...

About merging the Kinetis implementations: I would be careful with this, as experience has shown that even MCU's from the same or very similar families have their differences in their peripherals. This is for example true for the STM CPUs, and that's why we have them separated... But as I don't know the 'Freescale World' this concern might be for nothing?!

Cheers,
Hauke


On 12.12.2014 13:14, Joakim Gebart wrote:
Hello Johann,

I am developing for the K60 which has the same timer set up as the KW2x.
The solution that I decided to go for is to let the LPTMR run at 32768
Hz and let the hwtimer use that one. It will not allow for 1 µs
precision, but at least it will be able to wake the MCU from STOP modes.
I have not yet made a PR from my work, but you can see the current WIP
state at https://github.com/gebart/RIOT, mulle branch.

Would there be any interest in merging the K60 and the KW2x peripherals
into a single Kinetis port?

See also some earlier threads regarding the Kinetis timers:

http://lists.riot-os.org/pipermail/devel/2014-November/001426.html
http://lists.riot-os.org/pipermail/devel/2014-October/001219.html
http://lists.riot-os.org/pipermail/devel/2014-September/001086.html

Best regards,

Joakim Gebart
Eistec AB
www.eistec.se

On 12/12/2014 11:14 AM, Johann Fischer wrote:
Hello RIOTers,

I tried to implement a hwtimer for MKW2xDxxx and failed.

The MCU has 4 downcounter PIT(Periodic Interrupt Timmer) 32-bit timers,
PITs can be cascaded so that timer[0] acts as prescaler for timer[1].
PIT can be loaded with a start value. The timer will count down and
generate an interrupt at 0. Then the start value will be reloaded and
it will repeating. PITs can not run in low power modes.
Apart from the fact that it is a down counter, the timer do not work in
low power mode, and that bothers me.

The MCU has also one Low-Power
Timer. This one is a upcounter 16-bit timer with compare register and
can be configured as as Free-Running Counter (reset on overflow not on
compare match). Also LPTMR can run in (very) low power modes.
I tried to implement the hwtimer with LPTMR.
The implementation divided (or multiply) the tick-values by 1000 and run
the timer with 1kHz. But this does not work reliable.

There is also a RTC module, but it fits even less for the hwtimer.

Ideas?

Regards,
Johann Fischer
_______________________________________________
devel mailing list
devel@riot-os.org
http://lists.riot-os.org/mailman/listinfo/devel
_______________________________________________
devel mailing list
devel@riot-os.org
http://lists.riot-os.org/mailman/listinfo/devel

_______________________________________________
devel mailing list
devel@riot-os.org
http://lists.riot-os.org/mailman/listinfo/devel

Reply via email to