Hey, On 07/09/15 18:52, Simon Vincent wrote: > - RIOT only supports 32 bit timers? You should implement the periph/timer interface. Using defines in periph_conf.h, you can set a "max value", e.g., 0xffff for 16 bit timers. Don't bother with hwtimer, that will be phased out soon, and also there's a wrapper for hwtimer on top of periph/timer.
> - RIOT uses multiple timers but they all must run at the same speed and > be synchronised. So effectively there must be only one timer but > multiple channels/compares. Using the periph/timer interface, there can be multiple timers with multiple channels. The "channels" are supposed to map multiple capture/compare registers og one actual timer. It is perfectly fine to only have one "channel" per timer. Different "timers" can run at different speeds. In order to harmonize platforms, if possible make one timer, preferably timer 0, run at 1MHz. > *Problems* > 1) If I set a hwtimer for longer than the maximum period of the timer it > will interrupt too soon. > e.g. > Timer overflows every 1000s. > If I set a hwtimer to delay for 1001s it will interrupt in 1s time. Seems like a bug. But we are aware that hwtimer + vtimer are, lets say, not optimal, and are working on a new timer subsystem. Check PR #2926 to see where we're headed. > 2) vtimers fail if the maximum timer period is less than 4096s > (SECONDS_PER_TICK). Yeah, vtimer has problems with an overflow of the underlying timer... > 3) Currently vtimers do not check if they request a hwtimer and there is > not one available. Unfortunately also true... May I ask which platform you are porting to? Kaspar _______________________________________________ devel mailing list devel@riot-os.org https://lists.riot-os.org/mailman/listinfo/devel