Go Down

Topic: NilRTOS - A Fast Tiny Preemptive RTOS (Read 17 times) previous topic - next topic

pito

#35
Jan 27, 2013, 04:50 pm Last Edit: Jan 27, 2013, 08:53 pm by pito Reason: 1
Few pictures for you tutorial  :)
fifo_b - ..basic situation..
fifo5  - ..adc maybe faster than sdcard..
fifo6 -  ..till overrun error..

fifo_a - ..counting semaphores handshaking..

fat16lib

pito,

Wow these are great.  I was about to post an update but I will put your pictures in the Examples explanation.

I also found that I must restructure Nil into several libraries.  The ISR for nilAnalogRead() is always linked.  I guess I will need separate libraries for some parts of Nil.  I can't think of a workaround.

fat16lib

I have posted an updated version of Nil RTOS as NilRTOS20130127.zip http://code.google.com/p/rtoslibs/downloads/list.

It has new features including an ADC library that sleeps while conversions are in progress.  This saves CPU time and allows other threads to execute.

A new version of SdFat is included with a function that formats uint16_t fields three times faster than the standard Arduino Print.

A data logging example is included that can log five analog pins on an Uno to a csv file every tick (1024 usec) which is 976 Hz.  All 16 analog pins on a Mega can be logged to a csv file every 3 ticks which is 325 Hz.  A quality SD card is required to achieve these results.

Documentation has been improved and two bugs have been fixed.

pito

Works nice!  :)
(ie. Uno, 5 adc channels, 2048usec period, cheap card, 7 minutes logging time, 5.5MB data.csv):
Code: [Select]
type any character to begin
type any character to end
Done
FIFO record count: 75
Minimum free record count: 54
Maximum SD write latency: 41064 usec
Unused Stack: 51 125

pito

#39
Jan 28, 2013, 01:54 pm Last Edit: Jan 28, 2013, 02:46 pm by pito Reason: 1
Fyi - here is the 1024usec period, 4 ADC channels, Latency and FreeFifo stored to the sdcard. You may see Latency and FreeFifo chart over the time (32k measurements shown).
Time is in msec, Latency in usec,  FreeFifo in free records..
Code: [Select]
type any character to begin
type any character to end
Done
FIFO record count: 90
Minimum free record count: 0
Maximum SD write latency: 35072 usec
Unused Stack: 51 144

** overrun errors **
Maximum overrun count: 32


Go Up