hwtimer questions

Dear RIOT developers,

What are the drawbacks of using a hardware timer with only a 32.768 kHz tick rate?

Would there be any problems with scheduling or hardware drivers when using a lower timer frequency?

What is the side effect of assigning the hwtimer module only one hardware timer channel?

As I understand from the code, the hwtimer module uses some kind of internal queue to be able to handle more timers than there are hardware channels, is this correct?

On our platform we are using the Freescale Kinetis K60 which has only one timer (LPTMR) which can wake the CPU from deep sleep. We need to use deep sleep in order to reduce power consumption in power constrained situations (battery powered etc.). All other timer modules in the CPU are halted when the CPU enters a deep sleep mode.

Best regards, Joakim Gebart Managing Director Eistec AB

Aurorum 1C 977 75 LuleƄ Tel: +46(0)730-65 13 83 joakim.gebart@eistec.se www.eistec.se

Hey,

What are the drawbacks of using a hardware timer with only a 32.768 kHz tick rate?

Would there be any problems with scheduling or hardware drivers when using a lower timer frequency?

That shouldn't pose a problem with most peripherals. 30us should be fine.

What is the side effect of assigning the hwtimer module only one hardware timer channel?

Also that's ok.

As I understand from the code, the hwtimer module uses some kind of internal queue to be able to handle more timers than there are hardware channels, is this correct?

Exactly. hwtimer is essentially a multiplexer for (usually limited) real timer hardware.

On our platform we are using the Freescale Kinetis K60 which has only one timer (LPTMR) which can wake the CPU from deep sleep. We need to use deep sleep in order to reduce power consumption in power constrained situations (battery powered etc.). All other timer modules in the CPU are halted when the CPU enters a deep sleep mode.

That sounds very interesting!

We're a little behind on supporting deep sleep modes, but if your hardware timer interrupt is able to wake up the MCU, you should check out the lpm_set code and the idle thread.

Ideally, the idle thread puts your MCU into the deepest possible mode using lpm_set as soon as nothing else is to do.

Kaspar