Multiple OLED's and Speed

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

Multiple OLED's and Speed

Post by Marcwolf » Thu Aug 06, 2015 12:03 pm

Hi Folks.
I have finally managed to get back to my project (work can intrude into pleasure.. A Lot!!)

And I now have the project running where I have 2 OLED's running on the Teensy. I am paring together all lines except the OLED_CS with I have hardwired to 6 & 7 .

I was wondering, since I am essentially sending the same information to both OLED's is there was a way to speed things up.

If I use one OLED class but change the FTOLED.h so that assertCS and releaseCS pulses BOTH lines would this work..

Code: Select all

 
 inline void assertCS() { digitalWrite(6, LOW); digitalWrite(7, LOW);}
  inline void releaseCS() { digitalWrite(6, HIGH); digitalWrite(7, HIGH); }
Any suggestions?

Many thanks

Dave

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

Re: Multiple OLED's and Speed

Post by angusgr » Fri Aug 07, 2015 8:09 am

Hi Dave,

What you posted would work. yes.

If you only ever want to display the same information on both OLEDs then you can also just wire the CS pins both to the same pin. The OLED display modules are write-only (apart from the SD cards) so they can both the exact same signals and they should be fine.[*]


[*] There's a caveat which is that with complex multi-ended wiring runs you might get noise, signal reflections, etc. between the two wiring paths. But if you're not having a problem now while using two CS lines, you shouldnt have a problem when using only one CS line either.


Angus

Marcwolf
Posts: 14
Joined: Thu Dec 08, 2011 2:20 am

Re: Multiple OLED's and Speed

Post by Marcwolf » Fri Aug 07, 2015 8:17 am

Thank you Angus.

I still want to keep the OLED's seperate, however 99% of the time they will be using the same.

I'll do some experiments and see how it goes.

Dave

Marcwolf
Posts: 14
Joined: Thu Dec 08, 2011 2:20 am

Re: Multiple OLED's and Speed

Post by Marcwolf » Sat Aug 08, 2015 9:21 am

Hi.
Ok - I made the changes and managed to get the SD card working as well. I could not run the Teensy at 96mhz but it runs at 72Mhz ok. 96 seems to be too fast and the image starts to rip.

Overall I am very happy with the results. Here is a link to my projects page with a small video showing the pupil expansion and dilation on the eye.

http://www.marcwolf.org/gallery/default.aspx?aid=107

Now - I have some minor issues to solve. Firstly if I can create a 'frame buffer' and manipulate that before sending it up to the OLED it would be perfect. As the BMP's I use are less than 40k I could store them in an array and work on them there before sending them out to the OLED. I have 256k so I could make use of that. Really all I am doing is drawing a black circle where the pupil is so the manipulations be easy.

Although it would be fun to play around with the colors too :)

Enjoy my madness.
Daved

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

Re: Multiple OLED's and Speed

Post by angusgr » Mon Aug 10, 2015 6:50 am

Hi Marc,

Wow, that is super impressive! Really nice build. Do you mind if we share your gallery on the Freetronics blog, or would you rather complete some more of it first?

Regarding a framebuffer, the FTOLED library doesn't support this at the moment. Mostly because on our usual platforms there simply isn't enough RAM (128x128x2bpp = 32KB). Even the Teensy 3.1 only has 64KB of RAM (as opposed to read only flash memory), so you'd have enough room for one framebuffer.

So I'm afraid you might have to hack the FTOLED library up in order to use its BMP decoding with a framebuffer-type approach. At the moment it writes directly to the screen, in order to save RAM...

There is also an unfortunate shortcoming of the controller hardware in the OLED128 that it doesn't support a "sync" signal back to the micro. The display updates one row at a time, and display code often makes use of a "sync" pulse to always update the rows that aren't currently being drawn. This avoids tearing effects where the controller draws the row which is currently updating. It's simply not possible with the OLED128, unfortunately!

Regarding running smoothly at 96MHz, the other thing you could try is to reduce the cable lengths. The shorter the length, the higher clock rate you should be able to use with SPI.

Marcwolf
Posts: 14
Joined: Thu Dec 08, 2011 2:20 am

Re: Multiple OLED's and Speed

Post by Marcwolf » Mon Aug 10, 2015 6:58 am

Hi Angus.
Please - feel free to use the images/ideas on your site. All of my stuff I put up on the public domain. If it inspires someone to do better then I benefit as well.

I've actually dropped the frame buffer idea. It is a very complex build and will take a lot of time to implement.
What I am doing is to use Photoshop and modify the BMP's to have different pupil settings. So I can display a G4,G5,G6 and have the pupils expand or dilate.

I have also modified the libraries to work with 2 OLED's using one call. I have 2 inhibit flags so to stop one or the other from being updated, and I am also working on a mirror function where a bitmap will be displayed 'flipped' on one of the displays. I'll try and put those somewhere incase others want to use it but it will be a very specialized library.

I am also getting some interest from costume makers re using OLED's and LCD in the eyes to give more realism or expression. If a character is more of a 'toony' one then sprites of floating hearts when they see a friend will work well.

Anyway - many thanks for all of your help and advice.
Dave

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

Re: Multiple OLED's and Speed

Post by angusgr » Mon Aug 10, 2015 10:50 pm

Great news! Please keep us filled in with how your project build goes.

Angus

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests