aBUGSworstnightmare 1 Posted January 12, 2013 Share Posted January 12, 2013 Hi there, I have written a driver API for SSD1308 based I2C OLEDs (can be used with SSD1306 too with no/only minor changes in the initialization routine) which I will use for my C3ii INS Stellaris Booster Pack (http://e2e.ti.com/group/microcontrollerprojects/m/msp430microcontrollerprojects/664688.aspx). The driver is comparable to the 'Simple Display' example from the EVALBOT. The API relies on my Stellaris I2C driver which you can find here: http://forum.stellarisiti.com/topic/417-i2c-with-stellaris-lm4f120h5qr-working-driver-api-example-code/ or here http://e2e.ti.com/support/microcontrollers/stellaris_arm_cortex-m3_microcontroller/f/473/t/235926.aspx . The API allows displaying: 1.) Images (black&white) The image needs to be a black&white .BMP-Image file which must be converted into a data array for use with the API. A little programm called 'LCDAssistent' is included in the attached .zip file which can be used for this task. LCDAssistant is ease to use and also allows inclusion of the image size into the output array. Refer to the file 'logos.h' for examples (original .bmp-file is included too). 2.) Centered Text If the supplied text is to large to fit the screen it will be clipped left and right. 3.) Strings The string will be printed 'until space lasts'! That means: you can't supply a string that is to long. 4.) It makes use of an undocumented SSD1306/1308 command called 'Double-Size-Font' (0xD6). After receiving this command, the SSD1308 OLED controller displays each scan line of the first 4 text lines twice. This is resulting in a font which is 2 pages large. Using the 0xD6 command will not affect/alter the content of the SSD1308 GDDRAM! When in 'Double-Size-Font'-Mode, the 'Set Display Start Line' command is used to display the pages PAGE4 to PAGE7. Step1: Initial display content Step 2: Double-Size-Font-Mode switched ON Step 3: Display start line set to 0x32 (start of PAGE4) Step 4: Double-Size-Font Mode switched OFF and Display Start Line set back to 0x40 (beginning of the PAGE1) The display shown/used is a 0.96in 128x64pixels white OLED from WIDE.Hk. Here's the link to the product page: http://www.wide.hk/products.php?product=I2C-0.96%22-OLED-display-module-%28-compatible-Arduino-%29 EDIT (01/18/2012): Added a new version of my I2C OLED API! The r03-release includes some new functions: // Clears a partial row on the OLED display. void Display128x64x1ClearArea(unsigned long ulI2CBase, unsigned long ulXStart, unsigned long ulXEnd, unsigned long ulY) // Displays a length-restricted string on the OLED display at the current cursor position. void Display128x64x1StringCurrentPos(unsigned long ulI2CBase, const char *pcStr, unsigned long ulLen) // Set the Cursor to the specified position on the OLED display (GDDRAM address). void Display128x64x1SetCursor(unsigned long ulI2CBase, unsigned long ulX, unsigned long ulY) // A simple I2C based printf function supporting \%c, \%d, \%p, \%s, \%u, \%x, and \%X for use with OLED displays. void I2COLEDprintf(const char *pcString, ...) Please report any issues/improvements! Enjoy your OLEDs! Kind regards aBUGSworstnightmare I2C OLED 128x64 - API_r03.zip dollop and abecedarian 2 Quote Link to post Share on other sites
bluehash 1,580 Posted January 12, 2013 Share Posted January 12, 2013 Hi there, my OLED driver API for SSD1308/1306 is ready. Find it enclosed to this post. I will add a description tomorrow! For you 'early adapters': more info is here http://e2e.ti.com/support/microcontrollers/stellaris_arm_cortex-m3_microcontroller/f/473/t/238721.aspx Enjoy your OLEDs! Kind regards aBUGSworstnightmare Thanks! Is this I2C? I think it is, since you shared your I2C example before. Quote Link to post Share on other sites
aBUGSworstnightmare 1 Posted January 13, 2013 Author Share Posted January 13, 2013 Thanks! Is this I2C? I think it is, since you shared your I2C example before. Hi bluehash, yes, it is a I2C OLED from wide.hk. I've used the white version but I will try to get hands-on the Area-Colored version too. aBUGSworstnightmare Quote Link to post Share on other sites
bluehash 1,580 Posted January 13, 2013 Share Posted January 13, 2013 Hi bluehash, yes, it is a I2C OLED from wide.hk. I've used the white version but I will try to get hands-on the Area-Colored version too. aBUGSworstnightmare If it's not too much, I can help organize a Group Buy for 10 units. Maybe they will go cheaper. Quote Link to post Share on other sites
aBUGSworstnightmare 1 Posted January 13, 2013 Author Share Posted January 13, 2013 Well, I doubt that they will get cheaper! Shipping is not that expensive (and was really fast last time), so I think I will order some to play with in the near future. @ all of you! WATCH THIS SPACE FOR AN UPDATE ON MY OLED API!!!! Here are some lines of code for you to think about: ... uccount = 170; Display128x64x1SetCursor(I2CTELEMETRIEBUS, 20, 0); I2COLEDprintf("uccount = %4d", uccount); Display128x64x1SetCursor(I2CTELEMETRIEBUS, 0, 1); I2COLEDprintf("uccount = 0x%x", uccount); ... And this is the result which you'll see on the OLED: Yes, you're right! 'I2COLEDprintf()' is very similar to the C library 'fprintf()' function. Here's an excerpt from the comments: ... //! A simple I2C based printf function supporting \%c, \%d, \%p, \%s, \%u,//! \%x, and \%X for use with OLED displays.... //! - \%c to print a character//! - \%d or \%i to print a decimal value//! - \%s to print a string//! - \%u to print an unsigned decimal value//! - \%x to print a hexadecimal value using lower case letters//! - \%X to print a hexadecimal value using upper case letters //! - \%p to print a pointer as a hexadecimal value//! - \%\% to print out a \% character//!//! For \%s, \%d, \%i, \%u, \%p, \%x, and \%X, an optional number may reside//! between the \% and the format character, which specifies the minimum number//! of characters to use for that value; if preceded by a 0 then the extra//! characters will be filled with zeros instead of spaces. For example,//! ``\%8d'' will use eight characters to print the decimal value with spaces//! added to reach eight; ``\%08d'' will use eight characters as well but will//! add zeroes instead of spaces. RgdsaBUGSworstnightmare abecedarian and bluehash 2 Quote Link to post Share on other sites
aBUGSworstnightmare 1 Posted January 18, 2013 Author Share Posted January 18, 2013 Hi, I've uploaded the new r03-revision. Pls refer to post #1 for details! aBUGSworstnightmare Quote Link to post Share on other sites
bluehash 1,580 Posted January 18, 2013 Share Posted January 18, 2013 This is improving.. looks like a good serial parser for OLEDs. Quote Link to post Share on other sites
Antscran 35 Posted May 3, 2014 Share Posted May 3, 2014 If you want to get these LCD's really cheap try here $2.80 http://www.buydisplay.com/default/0-96-inch-serial-spi-i2c-128x64-oled-graphic-display-module-blue-on-black The shipping is a bit more expensive as I ordered 2 a while back just not got around to building a board yet. Quote Link to post Share on other sites
Rei Vilo 692 Posted June 22, 2014 Share Posted June 22, 2014 Nice displays and great web-store. The only drawback is that displaying graphics requires an external fast SRAM. Quote Link to post Share on other sites
Anik96 1 Posted February 19, 2018 Share Posted February 19, 2018 hello .... will it work for tm4c123g? Quote Link to post Share on other sites
Rei Vilo 692 Posted February 19, 2018 Share Posted February 19, 2018 tm4c123g = new name for Stellaris. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.