Netduino home hardware projects downloads community

Jump to content

The Netduino forums have been replaced by new forums at This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

SSD1306 display issue with Gen1 board

  • Please log in to reply
4 replies to this topic

#1 Dejecting


    New Member

  • Members
  • Pip
  • 5 posts

Posted 28 March 2013 - 09:35 PM

Let me start off by saying that I'm really new to netduino so most of what's going to be said will go right over my head, but I'm a quick learner and I know my way around the .Net environment enough to get myself into trouble.


I got an Adafruit SSD1306 OLED 128x64 screen and I'm having trouble getting it to work right.  I posted on the adafruit forums and adafruit_support suggested I post here to get further help.  That post in it's entirety can be found here :  http://forums.adafru...hp?f=47&t=38445


To summarize, I have a Gen1 Rev. B Netduino running firmware using VS2012 and the beta 4.3 drivers/software.  I used the sample project and the ported ssd1306 driver that Fabien did, loaded them up in a project, and deployed.  Info on Fabien's wiring and drivers and what not can be found here : http://fabienroyer.w...ith-a-netduino/


The only difference is the SSD1306 I have is version 2.1 and it looks like Fabien used an older version.


I thought i had the problem fixed, I was just lucky.  First off Fabien ran his SPI clock speed setting at 40000 to get it to work, but when I do that the screen is all garbled and shifted (when it works at all, more on that in a sec).  If I run the SPI clock at 20000 or less then the output is clear, but randomly it will shift up/down vertically and stay there until I power down the netduino and power it back up, in which case it will either not power on the OLED, or it will shift it the same way, or it will shift it more/less.  What I mean by shifting is the top 10-50% of the output will be displayed physically on the bottom of the screen.  Then there is the problem of it deciding not to power on at all, because when it does this I have to boot the netduino up into TinyBooter and wipe the deployment cache then redeploy, although somethings I have to do to a few times and most recently I had to move the SSD1306 and all connections to a different part of my breadboard  to get it to work.


I used a multimeter and verified I am getting proper power to my power leads and that I don't have any bridged solder joints on the SSD1306 pins I had to solder on.  I even sucked all the solder off and re-did them.  I also tried 5v and 3.3v with same results.  I have tried changing out all the wires from netduino to breadboard multiple times, tried different holes in the breadboard, tried a different breadboard altogether, tried everything I can think of hardware wise to no avail.  Software wise I have tried many different SPI clock speeds ranging from 100-60000 (60k locked up the netduino, had to tinyboot it to recover) with no luck, and anything over ~24k gives me a garbled output (though still legible).


The weirdest part about it is the fact that if I unplug the power from the netduino and plug it back in I will often get a different output on the OLED screen (though not always)


I ordered a Netduino 2 board today, while I don't think this is the issue I figured why not since I'm going to end up ordering another one at some point anyhow, so I just pulled the trigger now.


The post I linked to on Adafruit has pictures of the wiring and solder joints if anyone wants to take a look at those.


The way it's wired up :

SSD1306 Data --> D11
SSD1306 Clk -- > D13
SSD1306 DC --> D8
SSD1306 Rst --> D9
SSD1306 CS --> D10
And then the power leads to 3v3 or 5v, and gnd to gnd

#2 Dejecting


    New Member

  • Members
  • Pip
  • 5 posts

Posted 29 March 2013 - 09:11 PM

So I got my Netduino 2 today, upgraded to 4.3 firmware, hooked up my SSD1306 and deployed the same exact code and the screen is singing like a canary now (very nice FPS also)


Not sure why it doesn't like the Netduino 1 board, don't plan on trying to figure it out either, the Netduino 2 will do everything I need and then some so I'll just stick with that.

#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 March 2013 - 04:12 PM

Hi Dejecting, Wow, that's a cool avatar. Also aggressive and about to eat something really large it seems. Scary and cool at the same time. Glad to hear that your NP2 is driving the display well. NP2 is a lot faster, which may be the benefit you're experiencing here. If you ever want to go back and hack away at this on your NP1, we'll be happy to provide some general guidance. You may just need to slow things down a bit. Welcome to the Netduino community, Chris

#4 Dejecting


    New Member

  • Members
  • Pip
  • 5 posts

Posted 01 April 2013 - 05:36 AM

Thanks Chris.  This was an avatar in a soccer management game (I know nothing of soccer) I used to play with friends years ago, just liked it and it kind of stuck :-P


I actually kept working with the OLED on my netduino 2 and I'm only displaying text on it but it still periodically will shift the display up (usually 1 or two of the top lines will physically be on the bottom of the device).  Once it starts happening I have to power down the netduino 2 and power it back up multiple times before it displays correctly again.  Not too sure what's going on with it, but it's not nearly as bad with the netduino 2 compared to the netduino 1.


I may end up trying to run the display in I2C and see if that helps, though I'm not exactly sure how to do this yet. 


Any advice you may have would be great!

#5 Dejecting


    New Member

  • Members
  • Pip
  • 5 posts

Posted 01 April 2013 - 11:59 PM

Here is a picture of what I get on the display with the below code :



public static AdaFruitSSD1306 oled = new AdaFruitSSD1306(		    chipSelect: Pins.GPIO_PIN_D10,		    reset: Pins.GPIO_PIN_D9,		    dc: Pins.GPIO_PIN_D8,		    speedKHz: 1000);public static void Main()	    {		    oled.Initialize();		    		 		    while (true)		    {			    			    DisplayText();			    Thread.Sleep(2000);		    }	    }public static void DisplayText()	    {		    oled.ClearScreen();		    int line = 1;		    oled.DrawString(0, line++, "1");		    oled.DrawString(0, line++, "2");		    oled.DrawString(0, line++, "3");		    oled.DrawString(0, line++, "4");		    oled.DrawString(0, line++, "5");		    oled.DrawString(0, line++, "6");		    oled.DrawString(0, line++, "7");		    oled.Refresh();	    } 


P.S. I cut out parts of my code here not having to do with the screen display... the code is supposed to update the screen every couple seconds with a new value which is why it's in the loop.  You can ignore this as I just did this to demo the issue.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.