[riot-devel] Implementation of the hardware timers / case of MSP430

ROUSSEL Kévin Kevin.Roussel at inria.fr
Wed Aug 21 14:29:55 CEST 2013

Le 21/08/2013 11:55, Oleg Hahm a écrit :
> Hi Kévin,
>> I was wondering how much hwtimers were used by the RIOT OS core for
>> its internal needs.
> since RIOT's scheduler is tickless, the kernel itself does not require any
> hwtimers.
>> As I am working on implementations of MAC/RDC protocols, I will
>> probably need to use some hardware timers (for
>> timing/synchronisation purposes). I was wondering whether there
>> would be enough hwtimer instances available...
> Several drivers (e.g., for the SHT11 or the SD card) are using hwtimers, but
> there should be usually enough timers left.

That's nice; however, I feel that only 3 or 4 available hwtimer 
instances (as is the case for most platforms if I understand correctly) 
may cause a problem if some "timer-hungry" modules (like some MAC 
protocols I plan to implement) are used together with applications that 
also need precise timing; doubling that number of available hwtimers may 
prove useful...

It seems that one of the ARM implementation of the hwtimer module (in 
'RIOT/cpu/lpc_common/hwtimer_cpu.c') has been designed to use the 
comparators of three different timers (allowing for up to 12 hwtimers 
instance)... Isn't it an interesting lead to follow?

>> In that sense, I see that in the case of the MSP430F16x MCU (that is
>> used in TelosB motes), the hwtimer module is implemented using the
>> TimerA module, which offers 3 compare registers ("TimerA3").
>> However, these MCUs also offer a "TimerB7" module (with a more comfy
>> amount of 7 compare registers). Is there a reason not to use this
>> TimerB?
> I'm not aware of any reason not to use the TimerB module, it's just not
> implemented yet, but that shouldn't be too difficult.

I think I will submit a pull request to that end.

> Cheers,
> Oleg

Thank you,

      Kévin Roussel
      Doctorant, projet LAR
      Équipe MADYNES, INRIA Nancy Grand-Est / LORIA
      Tél. : +33 3 54 95 86 27
      Kevin.Roussel at inria.fr

More information about the devel mailing list