New OLED shield for Teensy 3.x and LC

Status
Not open for further replies.

DaQue

Well-known member
Looks like Sparkfun has a OLED shield that plugs directly on a Teensy and is the same form factor and compatible with the PJRC audio board. https://youtu.be/RZWftAderwo

If this is considered spam I'm sorry but I thought is was interesting. I have a Teensy in a feather sheild and then a feather OLED and this is simpler way to go.
 
Interesting, thanks for posting. It uses a SSD1306 SPI display, and it looks like it has 3 basic permutations for connecting it (standard, audio shield, prop shield). I glanced at the library, and it doesn't seem to use SPI transactions or requires the hardware CS/DC pins.

Adafruit has a similar display with their feather setup that uses the display with i2c instead of SPI, using the same SSD1306 controller:
 
Last edited:
Wouldn't call that one spam, seeing is it's very much teensy related, unlike the dump and run indigogo campaign recently.

Nice that they gave the jumper options since that's a potential complication on these things.

Ambition since I found those baby OLED displays has been to make a pen form factor oscilliscopeish device with the display arrange so you can see it and the probe tip at the same time.
 
I'll look at their code and at least add transaction support. They didn't route DC to a CS capable pin, so optimizing that part is probably not worthwhile.
 
The board top has jumpers for adjustment. If I'm seeing the picture right the D/C can be moved from default pin 5 to alternate 21.

And this from the schematic confirms that and CS can be 10 or 20:
TView.png

Post #4,000 here
 
As you mentioned, the DC can be pin 21 which is a hardware CS pin, so it might be fun to make a faster version for this... If only they had this before my last order shipped (yesterday).... Maybe when I am ready for the next order
 
...
Ambition since I found those baby OLED displays has been to make a pen form factor oscilliscopeish device with the display arrange so you can see it and the probe tip at the same time.

That is an interesting display. If it got a good fast driver that could be cool I was thinking of ordering at least one. Having a pen type Teensy o'ish_scope thing would be good ... between Teensy things being small and fading coordination/eyes and no real studied history with electrons - that could be a win on many fronts giving me a tool I don't have that would be less a hazard to easily use without a third hand.

Kurt - I have a coupon that should cover shipping with min order and I could have our postal friends drop it by your house - let me know.
 
Thanks Defragster... (already ordered one ;) )

But might be awhile as my current order shipped yesterday and is scheduled to get here next Friday... So guessing this one get here until maybe the following Monday :( Sure wish they still had priority mail as an option...
 
I'll look at their code and at least add transaction support. They didn't route DC to a CS capable pin, so optimizing that part is probably not worthwhile.

Note, the Adafruit_SSD1306 driver is in the Teensy installed drivers, and it does support SPI transactions, but there is no explicit support for the Teensy hardware pins. The Adafruit_SSD1306 driver supports both SPI and I2C devices.

This Sparkfun display is probably the same display/driver underneath the covers as this Adafruit SPI 128x32 display:

It is probably similar in spirit to the MicroView that Sparkfun manufactured for the kickstarter project Geek Ammo (which was bought out by Sparkfun in 2015):

Some time after MicroView was shipping, they came out with a stand along Micro OLED display, an Edison tie-in board, and a photon shield:

Sparkfun doesn't seem to have have shipped other 128x32 boards recently.

FWIW, when I checked earlier this afternoon, they were listed as more than 250+ displays. Now, at 11:50pm US Eastern Time, they are down to 176 units. So, evidently a few people are interested in them.

It is new enough that Digikey hasn't yet gotten any.

It's funny, while I seem to buy regularly from Adafruit, particularly on Wednesdays when you can get a 10% off after the Ask an Engineer segment, the last order I did from Sparkfun directly was in 2014. I look at SF every Friday when they put out the new products, but I rarely see anything that I want to buy. I also looked around at MicroCenter, and they seem to have stopped carrying stuff from SparkFun. And I don't see as many red boards at You-do-it (local Massachusetts electronics shop) as I used to.
 
Last edited:
That is an interesting display. If it got a good fast driver that could be cool I was thinking of ordering at least one. Having a pen type Teensy o'ish_scope thing would be good ... between Teensy things being small and fading coordination/eyes and no real studied history with electrons - that could be a win on many fronts giving me a tool I don't have that would be less a hazard to easily use without a third hand.

Kurt - I have a coupon that should cover shipping with min order and I could have our postal friends drop it by your house - let me know.

As I said earlier, the Adafruit Teensy Feather adapter allows you to mount the Adafruit i2c 128x32 display directly on top of the Teensy 3.2 or LC. The Teensy would mount either underneath the feather adapter on on top of it, and you would add stacking headers that are included to mount the LCD. It increases the Teensy's size to 2" x 0.9", to allow the feather boards to be mounted, and add a Lipo charger in the back.
 
... It increases the Teensy's size to 2" x 0.9", to allow the feather boards to be mounted, and add a Lipo charger in the back.

I like that single SFun board for going smaller - and being able to relocate stuff on the 'Pen-T-oScope'.

@MM - I got some of those AdaFruit short female headers and they are not cheap but they have good design for the extra cost. Almost half height the pin can go all the way through (if solder doesn't fill the void) and I also bent some 90° so they hug the board. You just have to bend them to the side the offset pin leg comes down on so as not to cover the hole and shorten the pin.

My first thought was not attaching the display over the Teensy but using the ribbon to put the inverted Teensy out of the way of fingers higher on the pen with the ribbon/display only 0.5" wide (velcro) secured right above where it would be grasped and easily seen - unlike a DVM on the other side of the desk. But then any additional wires for Feeding GND, FreqMeasure or other indicators could be long and in the way.

So then I thought of a horseshoe shape where you grab the bottom and the upper loop holds the normally built Teensy/Display with perhaps female headers downward so any secondary pin could be wired up for auxiliary functions to simulate LED's, read Analog or take serial output.

But I figured I should let GremlinWrangler commit to doing it before I got into feature creep :) Like the handily mounted 5 way switch for fingertip function control.
 
As I mentioned, I decided to order one. I believe I can configure it to work with my RPI hat, which I just got the boards yesterday. Will use a T3.2, has a DC/DC converter from Pololu, an Ultimate Sensor Fusion solution... Thought having a small display on top might come in handy for diagnostics...

May see how hard it is to come up with SPI version that supports faster access. Maybe DMA? ...

@MM - Yes the Adafruit has some nice setups and I have ordered stuff from them for several years, but currently can no longer order stuff from them as they will not ship to PO boxes or in my case PMB boxes... And I don't have regular shipping to my physical address... Hopefully they will change their policy and maybe restrict it for new people...
 
@MM - Yes the Adafruit has some nice setups and I have ordered stuff from them for several years, but currently can no longer order stuff from them as they will not ship to PO boxes or in my case PMB boxes... And I don't have regular shipping to my physical address... Hopefully they will change their policy and maybe restrict it for new people...
I know the drill. I was sad when they dropped the option to send stuff post office mail (at $2-3 package instead of $7). I've never had any problems with it, but evidently not everybody was as lucky.

I live on a private road, and my official mail is still the PO box in town. For the first 10 years, that was my only mail address. Now, the post office allows us to put mailboxes at the end of the public road, but I prefer to keep the official address at the PO. Back when I was a work at home programmer, I had a PMB box at the UP store for normal deliveries.

I do at times order Adafruit stuff from Digikey or from the ebay seller atomsindustries which has cheaper shipping than Adafruit.

Now, I have packages delivered to my work address. Given one of my neighbors has stuff delivered, and FedEx/UPS/DHL seem to mis-deliver their boxes routinely, I plan to keep delivery at work.

Living on a private (dirt) road reminds me of one of Jeff Foxworthy's quotes:
You might be a redneck if the directions to your house say 'turn off the paved road'
 
Last edited:
Yep - I really know the drill! Yes I could put up mailbox at road, which is something like half mile from house...

Yes I could have UPS or Fedex deliver to house. But we have a gate at start of property and once had a new computer left at the gate. Luckily no one else picked it up and luckily it did not rain much as I live in an area that rains reasonably often....

I was surprised with my last orders from Sparkfun that they also no longer do UPS. I prefer priority mail over UPS or Fedex. My current orders from Sparkfun are estimated to take 8 days by Fedex whereas before with Priority mail it was typically 2-3 days and cheaper...

So currently I pick up some Adafruit stuff from Amazon or Digikey. I ordered parts from Digikey same day (Wed) as Sparkfun and again it arrived yesterday... Sparkfun estimate next Friday...

But now should get back on topic!..
 
Last edited:
I ordered two of the Sparkfun displays when I saw the stock level had dropped from 250+ to 50 or so, and it was picked up by FedEx last night. I noticed today that the stock level is down to 2. I assume they will restock.

I do wish instead of solder jumpers, they had put 5x3 sets of pins, so you could use regular pin jumpers to select the pin options.
 
Last edited:
Looks like I got the last 2 - thanks for the heads up @MM. But my order won't ship until the micro:bit is in stock - thought it might be fun to see one of those- and that bumped my order up to $50 to get $10 coupon that paid shipping. $9.04 for "Delivery estimate: 3-11 Business Days with FedEx SmartPost". Amazing that Amazon Prime will drop boxes on my front porch on Sunday for FREE if I happen to order 2 days before Sunday - and Adafruit/SparkFun have slow and limited high cost shipping.
 
Mine(1) arrived today, which was 3 days earlier than expected :D

So far I have it mounted on a new t3.2, using some alternate pins CS/DC are on 20/21 which are both hardware CS pins.
I also have it soldered up that I can plug it into my hat for RPI3...

So far stand alone I have their Screen demo working... So next up see about reworking their library to maybe to SSD1306_t3n
(may use SPIN library so later could mount one like this using alternate SPI buses on T3.5/6

Edit: But wondering if updated library should follow sparkfun library or Adafruit like library...

The current Sparkfun library does have beginTransaction/endTransaction
 
Last edited:
Again followup:

I now have also tried running one of the Adafruit ssd1306 demo programs (ssd1306_128x32_spi) on this display and it appears like it works.
Code:
// Uncomment this block to use hardware SPI
#define OLED_DC     21
#define OLED_CS     20
#define OLED_RESET  15
Adafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS);
I had to edit the Adafruit header file to say I am 128x32...

So again wondering which one is better to start from?
 
The font on the SFun demo looked nice. Not sure what factor could be the decider? - how common are the functions? How big do they compile to? Is one already faster?
AdaFruit has so many represented and tested on Teensy - will is make it easier to port one or the other to Teensy FAST SPI?
 
I had to edit the Adafruit header file to say I am 128x32...

So again wondering which one is better to start from?
I haven't looked in either library, but I really, really hate having to edit the Adafruit header file to say which display I'm using. And I might have both 128x64 and 128x32 displays for different projects. The choice of the display (and whether it uses i2c or spi) should be based on the constructor set up, and not in editing the include file.

That being said, I suspect there are more people using the Adafruit library instead of the Sparkfun library.
 
I have taken a quick look through both and it looks like they both use a secondary buffer, that they then update the screen.

It does not look like it would be hard to try either. May start with Sparkfun library for now. For example if we simply break down how the code works we see:
Code:
void TeensyView::display(void) {
	uint8_t i, j;

	for (i=0; i<(LCDHEIGHT/8); i++) {
		setPageAddress(i);
		setColumnAddress(0);
		for (j=0;j<LCDWIDTH;j++) {
			data(screenmemory[i*LCDWIDTH+j]);
		}
	}
}
Where these functions simply do:
Code:
void TeensyView::setPageAddress(uint8_t add) {
	add=0xb0|add;
	command(add);
	return;
}

void TeensyView::setColumnAddress(uint8_t add) {
	//command((0x10|(add>>4))+0x02);
	//command((0x0f&add));
	command(0x21);
	command(add & 0x7F);
	command(0x7F);
	
	return;
}
Where the data and command functions are again simple as well as the one it calls...:
Code:
void TeensyView::command(uint8_t c) {

	digitalWrite(dcPin, LOW);;	// DC pin LOW for a command
	spiTransfer(c);			// Transfer the command byte
}

void TeensyView::data(uint8_t c) {

	digitalWrite(dcPin, HIGH);	// DC HIGH for a data byte
	spiTransfer(c); 		// Transfer the data byte
}

void TeensyView::spiTransfer(byte data)
{
	SPI.beginTransaction(SPISettings(clockRateSetting, MSBFIRST, SPI_MODE0));
    digitalWrite(csPin, LOW);
	SPI.transfer(data);	
    digitalWrite(csPin, HIGH);
    SPI.endTransaction();
}

Should not be too hard to try update this main one to maybe only do one transaction per line. And in the transaction use the functions defined in ili9341... library to push command_cont command_last data_cont and data_last to see how much faster... Probably really only need to update this main function and maybe a clear function....
 
Good thing if TeensyView got improved - SparkFun might take it back for all Teensy users rather than forking up the Adafruit code where improvements wouldn't be generally usable.

How long do 4K of SPI writes take in 32 transactions at 20+Mbps? ~1.4ms?
 
I wonder if you will hit the limit where you can't refresh the screen faster than a given amount. I've been running the uncanny eyes program (which creates two eyes on 128x128 screens). This code does its own buffering, etc. and only uses the library to set up the two displays.

I've discovered that the TFT displays I've used (Adafruit and random ebay display) that use the ST7735 chip, I can run it at any speed on a Teensy 3.2, Teensy 3.5, or Teensy 3.6. However, the two OLED displays I've tried, I have to lower the clock rate to avoid snow on the screen. IIRC, the New Haven 128x128 OLED display, I can run at 48 Mhz, but the Adafruit display, I can only run at 24 Mhz. It was a shame to run a 3.6 at 24 Mhz. :)
 
Thanks guys,

As I mentioned, Will try doing a little and see.

Right now a one screen update is taking maybe 7.327ms by logic analyzer... Will see how it goes.
 
Status
Not open for further replies.
Back
Top