Teensy 3.0

I just started porting SdFat to Teensy 3.0 and am really pleased with Teensy 3.0. Paul's modified IDE works well.

SdFat has about 8,500 lines of code and it took me about an hour to get it to compile. I commented out about 100 lines of AVR SPI code.

I found SPI examples on the Freescale website and am starting implementation of SD/SPI access routines. This should not take long.

The biggest problem is also the biggest opportunity. With AVR everything was based on the fact that SdFat would mostly be used on 328 processors with 2KB of memory. This really limited how caching was implemented and what SD command sequences could be used. Now I need to redesign SD access to take advantage of more memory and processor speed.

I am starting to redesign SD access for better performance. While waiting for the Teensy 3.0 I experimented with a Mega. I was able to increase write speed by almost a factor of three by using more memory and multi-block SD commands.

One shock was the old SdFat first ran much slower with more memory. This is because I had multiple blocks in the cache and user memory and was not writing them in sequential order. This slowed the write speed from 200KB/sec on an Uno to 90 KB/sec on a Mega. SD cards love streaming multi-block writes and die with random writes. Writing the blocks in the correct order increased the speed for this example from 90KB/sec to over 500KB/sec.

The Teensy will have 24 MHz SPI, a faster processor, and more memory so I hope to get 5-10 times faster file write speeds than SdFat on a Uno.

ARM for Arduino is great!

I have started looking at porting ChibiOS/RT to Teensy 3.0 and it also looks easy. I will make the RTOS a library so you can use it with Paul's core routines and other ported libraries in a multi-tasking environment.