I'll try to write a driver for a programmable RGB-Ledstripe. To
programm the timing for the Ledstripe I need a timerresolution of 100
ns. As far as I can see, xtimer features only a 1 µs resolution. Is
there a way to adjust xtimers resolution or is there another way to use
timers in a generic way?
I'm not the timer expert, but to reliably get a 100 ns resolution sounds rather tough an a system that runs with 170MHz [1].
I think there's not too much air between xtimer and the bare silicon.
You can have a look into the timer configuration [2] and the timer interrupts [3] of your board.
According to the Datasheet there is a tolerance of 150 ns in the
Timings. I'll guess a resolution of 300 ns would be fine too.
I could use inline assembler for precise time wasting but I'd prefer
the usage of a timer implementation.
I'd like to see this driver in a pull request some day
I remember there where some students with the same precise time requirements for an LED stripe. They figured out that the minimum measurable time for a pin toggling delayed with xtimer was about some us on a phytec board. They went over to introduce a defined number of "nops" for that. You can use the scope in our office to test that!
Probably the way to go would be to diectly use an unused periph timer.
xtimer is just a layer on top of periph/timer. On most boards it just
uses the first periph timer.
The init function of periph/timer (declared in
drivers/include/periph/timer.h) allows setting of timer resolutions
higher than 1us, and it is closer to the hardware.