Supercharging your FTOLED

128x128 pixel 1.5" full colour OLED display with MicroSD card slot. [Product page]
Post Reply
Marcwolf
Posts: 14
Joined: Thu Dec 08, 2011 2:20 am

Supercharging your FTOLED

Post by Marcwolf » Fri Aug 21, 2015 1:52 pm

Some people are using the FTOLED with Teensy 3.1. The Teensy is a faster computer than your standard Arduino plus it has some smarts built into the SPI side of things.

So - trying to get as much speed out of the beastie for my graphics operations I decided to look at the actual code that sends out the instructions to the SPI.

In FTOLED.h there are 2 commands that do this.

So embedding them inside a SPI transaction I sudden found I had blinding speed.
Tests with the unmodified code give me 3 Frames per second. With the modified code I get 10.

Be interesting to see how well a standard Arduino can be tweaked.

Code is here in FTOLED.h

Code: Select all

/* These protected methods are for implementing basic OLED commands.
     They all assume that the CS is asserted before they've been called
  */
  inline void writeCommand(byte command)
  {
    
   SPI.beginTransaction(SPISettings(14000000, MSBFIRST, SPI_MODE0));
   digitalWrite(pin_dc, LOW);
    SPI.transfer(command);
    digitalWrite(pin_dc, HIGH);
   SPI.endTransaction();		
  }

  inline void writeData(byte data)
  {
   	SPI.beginTransaction(SPISettings(14000000, MSBFIRST, SPI_MODE0));
   	SPI.transfer(data);
	SPI.endTransaction();
  }

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: Supercharging your FTOLED

Post by angusgr » Mon Aug 24, 2015 7:05 am

Great to hear, thanks for posting this. It should be possible to make this change for "normal" Arduino boards using IDE 1.6 as well.

Was the 14MHz max speed one that you experimented to find?


Angus

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests