NilRTOS - A Fast Tiny Preemptive RTOS

I tried a Mega and five is the limit. The problem is that each ADC read takes 110 microseconds so there isn't enough time left in the SD thread to format the data.

You don't lose much accuracy by speeding up the ADC clock so that could help.

Finally you could trigger the ADC with a timer compare and read it in an ISR. You could write binary...

But all of this is way beyond an example for NilRTOS. Right now I want to improve all the RTOS ports.

I plan to post improved versions of ChibiOS/RT, FreeRTOS, and NilRTOS on Google Code Archive - Long-term storage for Google Code Project Hosting..

I was thinking about porting NilRTOS to ARM boards but I decided ChibiOS/RT is a better fit.

Here is a sample of 16 ADC channels logged every 4096 microseconds on a Mega:

Period,ADC0,ADC1,ADC2,ADC3,ADC4,ADC5,ADC6,ADC7,ADC8,ADC9,ADC10,ADC11,ADC12,ADC13,ADC14,ADC15
NA,507,448,413,388,375,360,347,337,362,346,352,342,333,345,334,335
4096,399,406,402,391,382,370,357,344,347,340,343,337,329,334,329,329
4096,350,364,372,372,370,364,355,341,334,330,331,329,322,324,321,323
4096,331,340,349,353,356,356,351,339,329,327,327,326,321,322,320,322
4096,325,329,335,340,344,346,345,335,326,325,325,324,320,321,319,320
4096,318,318,320,323,327,330,331,323,316,315,315,314,311,312,309,310
4096,289,290,294,297,302,305,308,304,299,296,294,293,290,291,291,293
4096,305,301,299,298,298,300,301,297,295,296,298,298,296,297,295,293
4096,296,297,296,295,295,296,297,293,291,292,293,294,293,294,293,290