Go Down

Topic: Teensy 3.0 (Read 39064 times) previous topic - next topic

fat16lib

#15
Oct 05, 2012, 10:56 pm Last Edit: Oct 05, 2012, 11:09 pm by fat16lib Reason: 1
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.

Jantje

Is there a place where I can download teensyduino for 3.0?
I havn't found a new version on the PCR site.
I would like to see the differences I need to make the elf file and how to upload. This to asses the impact on my eclipse plugin for when my teensy 3.0 and due arrive.
I asked paul but he is way to bussy with other things.
Best regards
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

cyclegadget


Is there a place where I can download teensyduino for 3.0?
I havn't found a new version on the PCR site.
I would like to see the differences I need to make the elf file and how to upload. This to asses the impact on my eclipse plugin for when my teensy 3.0 and due arrive.
I asked paul but he is way to bussy with other things.
Best regards
Jantje


http://www.pjrc.com/teensy/beta/arduino-1.0.1-teensy3-beta2-macos.zip
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

Jantje

@cyclegadget
Great thanks
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

cyclegadget


Your welcome Jantie! Here are all the links that I have, I had to look through my email....I ordered a 3.0 and should have it next week.

http://www.pjrc.com/teensy/beta/arduino-1.0.1-teensy3-beta1-windows.zip
http://www.pjrc.com/teensy/beta/arduino-1.0.1-teensy3-beta1-linux64.tar.gz
http://www.pjrc.com/teensy/beta/arduino-1.0.1-teensy3-beta1-macos.zip

Qoute:
If you're using Windows and you've never used a Teensy before, you'll need the "serial installer" to add the driver (really just an INF to tell Windows to use its built-in driver).  If you're using Linux, you'll need to install the udev rule to allow non-root access.  They're available at the normal Teensyduino page:

http://www.pjrc.com/teensy/td_download.html
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

cyclegadget


@fat16lib

I meant to say this last night but, thank you for working on porting your SDfat library to the 3.0! I really enjoy using your SDFat library and I am glad it can be used with the 3.0!
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

pico


I am starting to redesign SD access for better performance.


Ultimately you could go to using DMA to get the maximum performance. Might want to look at some of the Leaflabs Maple code to get some ideas on how that is done on the Cortex3.

LFNs an option with the additional memory?
WiFi shields/Yun too expensive? Embeddedcoolness.com is now selling the RFXduino nRF24L01+ <-> TCP/IP Linux gateway: Simpler, more affordable, and even more powerful wireless Internet connectivity for *all* your Arduino projects! (nRF24L01+ shield and dev board kits available too.)

fat16lib

#22
Oct 06, 2012, 08:49 pm Last Edit: Oct 07, 2012, 03:14 pm by fat16lib Reason: 1
I have this Maple version of SdFat http://code.google.com/p/maple-sdfat/ and it doesn't use DMA.

I have examples of Kinetis SPI DMA and plan to try it but it won't help much.

SD, DMA, and SPI don't work too well together.  The problem is the SD SPI protocol.  SD cards indicate busy in SPI mode by holding MISO high so you can't just setup a DMA transfer and go away.  The protocol uses control tokens in the data stream which is a pain.

The good news is that Kinetis has a four deep FIFO on SPI so I should be able to send/receive at 24 MHz easily.  That's only 3 MB/sec.

The real winner is having an SDIO controller like high end STM32 and the Due if these pin are brought out.

I plan on LFN.  I implemented most of LFN but didn't put it in the AVR version of SdFat because flash is so precious on 328 Arduinos.

retrolefty

So can anyone explain the steps better to be taken once I've downloaded the windows zip file. I can't seem to find any installation instructions other then
1. Be sure arduino 1.0.1 is installed first
2. If windows, run serial installer first
3. Download Teensy 3.0 zip file


So where and how do I install/unpack the Teensy 3.0 zip file to?

Lefty


Jantje

Lefty
I just downloaded "arduino-1.0.1-teensy3-beta2-windows"
It actually contains the whole environment (that is including the arduino stuff). So you just can unzip it at the locattion of your choice.
Given cyclegadget comment the driver is the same as for the teensy2.
Best regards
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

retrolefty


Lefty
I just downloaded "arduino-1.0.1-teensy3-beta2-windows"
It actually contains the whole environment (that is including the arduino stuff). So you just can unzip it at the locattion of your choice.
Given cyclegadget comment the driver is the same as for the teensy2.
Best regards
Jantje



Thanks for that. I installed the zip file and the IDE seems to work fine and the the Teeney board is listed in the board selection menu. I then ran the serial installer and it seemed to load OK.

Then a show stopper. What kind of USB connector is that on the Teeny 3.0 board? I've owned a Seeeduino mega board ( http://www.seeedstudio.com/depot/seeeduino-v30-atmega-328p-p-669.html?cPath=132_133) for eons that uses a:
Quote
The Seeeduino Mega uses a 4 Position mini-Type B Jack while the rest of the Arduino family uses standard 4 Position Type B Jack.


But this Teeny 3 seem to be some other kind of miniture USB connector. Anyone know what I need and a link to it. The PJRC lists a seperate mini-Type B cable avalible but that appears to be what I already own but which doesn't fit the Teeny3. I'm confused.....

Thanks;
Lefty

fat16lib

Quote

The USB port on Teensy 3.0 is capable of USB host mode.  A Micro-AB connector allows future use of USB host mode.

Initially, Teensy 3.0 will ship with only USB device support.  USB host support, integrated in the Arduino(R)** environment with easy-to-use objects, is planned as a software-only upgrade in 2013.  Programming a project using USB host mode will require a second Teensy 3.0 and a board-to-board link using the I2C pins (2 wires and ground), to provide a path for the Arduino IDE to upload code.

Teensy 3.0 uses a Micro AB connector, not a Mini connector.

retrolefty


Quote

The USB port on Teensy 3.0 is capable of USB host mode.  A Micro-AB connector allows future use of USB host mode.

Initially, Teensy 3.0 will ship with only USB device support.  USB host support, integrated in the Arduino(R)** environment with easy-to-use objects, is planned as a software-only upgrade in 2013.  Programming a project using USB host mode will require a second Teensy 3.0 and a board-to-board link using the I2C pins (2 wires and ground), to provide a path for the Arduino IDE to upload code.

Teensy 3.0 uses a Micro AB connector, not a Mini connector.


Thanks for that. I didn't see it mentioned anywhere on their site and on their existing Teeny boards they state:

Quote
The Teensy is a complete USB-based microcontroller development system, in a very small footprint, capable of implementing many types of projects. All programming is done via the USB port. No special programmer is needed, only a standard "Mini-B" USB cable and a PC or Macintosh with a USB port.


So you can see my confusion? Or not.  ;)

Lefty

westfw

I think that people interested in experimenting with Teensy 3.0 should read the kickstarter page and "updates."
Paul has been posting a lot of high-content messages there, and they are readable even if you're not a "contributer."

The main description says:
Quote
The USB port on Teensy 3.0 is capable of USB host mode.  A Micro-AB connector allows future use of USB host mode.


http://www.kickstarter.com/projects/paulstoffregen/teensy-30-32-bit-arm-cortex-m4-usable-in-arduino-a?ref=live

(They also seem to be setting records for "shortness of timeframe" between kickstarter campaign and getting the product into people's hands.  Woot!  (alas, kickstarter apparently frowns on this sort of use of KS as an advertising/sales channel for products you were going to produce anyway.))

retrolefty


I think that people interested in experimenting with Teensy 3.0 should read the kickstarter page and "updates."
Paul has been posting a lot of high-content messages there, and they are readable even if you're not a "contributer."

The main description says:
Quote
The USB port on Teensy 3.0 is capable of USB host mode.  A Micro-AB connector allows future use of USB host mode.


http://www.kickstarter.com/projects/paulstoffregen/teensy-30-32-bit-arm-cortex-m4-usable-in-arduino-a?ref=live

(They also seem to be setting records for "shortness of timeframe" between kickstarter campaign and getting the product into people's hands.  Woot!  (alas, kickstarter apparently frowns on this sort of use of KS as an advertising/sales channel for products you were going to produce anyway.))



Well lets just not tell them.  :D

Go Up