13.07.2015 Views

OLED Display, Graphics 128x64 - 3.3V, SPI Features - Sunrom ...

OLED Display, Graphics 128x64 - 3.3V, SPI Features - Sunrom ...

OLED Display, Graphics 128x64 - 3.3V, SPI Features - Sunrom ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

For more products visit our website http://www.sunrom.comDocument: Datasheet Date: 4-Feb-13 Model #: 1258 Product’s Page: www.sunrom.com/p-1221.html<strong>OLED</strong> <strong>Display</strong>, <strong>Graphics</strong> <strong>128x64</strong> - <strong>3.3V</strong>, <strong>SPI</strong>These displays are small, only about 1"diameter, but very readable due to thehigh contrast of an <strong>OLED</strong> display. Thisdisplay is made of <strong>128x64</strong> individual<strong>OLED</strong> pixels, each one is turned on or offby the controller chip. Because thedisplay makes its own light, no backlightis required. This reduces the powerrequired to run the <strong>OLED</strong> and is why thedisplay has such high contrast; we reallylike this miniature display for itscrispness!The <strong>OLED</strong> display requires a <strong>3.3V</strong> powersupply and <strong>3.3V</strong> logic levels forcommunication. The power requirementsdepend a little on how much of the display is lit but on average the display uses about 20mA fromthe <strong>3.3V</strong> supply. Built into the <strong>OLED</strong> driver is a simple switch-cap charge pump that turns 3.3v-5vinto a high voltage drive for the <strong>OLED</strong>s.It has total <strong>128x64</strong> pixels having high visibility even in daylight. We provide full demo source code toquick start your application.The driver chip, SSD1306 can communicate in <strong>SPI</strong>, which is the most flexible interface for anymicrocontroller and uses a small number of I/O pins.<strong>Features</strong>• High Visibility during Daytime• Current consumption only 20mA suitable for battery operation• <strong>3.3V</strong> operation with <strong>SPI</strong> high speed• Only uses MCU 5 pins• Digital Contrast adjustment• Full demo source code provided to quick start


PinoutsPin# Pin Name Details1 GND Power Ground2 3V3 +<strong>3.3V</strong> Power Input Provide regulated <strong>3.3V</strong> supply3 CS Chip Select Input Standard <strong>SPI</strong> Chip Select pin.To be made low beforesending any serial <strong>SPI</strong> byte.Once byte is sent, CS to bemade high again.4 RST LCD Reset Input Active low reset. When keptlow it is in reset mode. Neededto reset 5ms at startup withexternal MCU. Keep it high fornormal operation.5 D/C# Register SelectInputIf RS=1(High) pin the serialbyte is consider data byteIf RS=0(Low) pin the serial byteis consider command byte6 SCK Serial Clock Input Standard <strong>SPI</strong> Interface Clockpin7 MOSI Master Out, Slave In In Standard <strong>SPI</strong> interface it isMOSI(Master Output and SlaveInput) Pin, Here MCU is masterand LCD is slave.Back side of LCD2<strong>Sunrom</strong> Technologies Your Source for Embedded Systems Visit us at www.sunrom.com


Sample Application with Source CodeWe have created a demo application using Atmel AVR ATMega32 in C language. It is wellcommented and can be ported to other microcontrollers easily. Next page has link to downloadsource code. Note that the MCU and LCD both are operated in <strong>3.3V</strong> mode only in following image.Operating LCD on 5V will damage it permenantely, so take care while powering on.3V3U2LCD <strong>128x64</strong>MCU <strong>3.3V</strong> OperationLCD <strong>3.3V</strong> Operation<strong>128x64</strong> DOTS,<strong>SPI</strong><strong>OLED</strong> GRAPHICS LCDSUNROM.COM 1258GND 1+<strong>3.3V</strong> 23CS4RST5D/C#6SCK7MOSI3V33V3C2100nR110KC433pC633pU1ATMega3212PB0/(XCK/T0)3PB1/(T1)4PB2/(INT2/AIN0)5PB3/(OC0/AIN1)6PB4/(SS)7PB5/(MOSI)8PB6/(MISO)PB7/(SCK)912Y18 Mhz131415161718192021RESETXTAL2XTAL1PD0/(RXD)PD1/(TXD)PD2/(INT0)PD3/(INT1)PD4/(OC1B)PD5/(OC1A)PD6/(ICP)PD7/(OC2)VCC 10GNDGND1131PA0/(ADC0)PA1/(ADC1)PA2/(ADC2)PA3/(ADC3)PA4/(ADC4)PA5/(ADC5)PA6/(ADC6)PA7/(ADC7)AREFAVCCPC7/(TOSC2)PC6/(TOSC1)PC5/(TDI)PC4/(TDO)PC3/(TMS)PC2/(TCK)PC1/(SDA)PC0/(SCL)4039383736353433323029282726252423223V3Some demo screens from the code run.3<strong>Sunrom</strong> Technologies Your Source for Embedded Systems Visit us at www.sunrom.com


Operating LCD with 5V boardIf your microcontroller is at 5V level and the LCD can only operate on <strong>3.3V</strong> mode then you have totake care about two things. First is the power to be regulated at <strong>3.3V</strong> from 5V. For that you can seebelow we have used LM1117-3.3 regulator. Second thing to consider is the 5V I/O voltage comingfrom microcontroller has to be dropped to <strong>3.3V</strong> as required by LCD. For that we have added resistordivider using 2K2 in series and 3K3 to ground.5VU3LCD <strong>128x64</strong>MCU 5V OperationLCD <strong>3.3V</strong> Operation<strong>128x64</strong> DOTS,<strong>SPI</strong><strong>OLED</strong> GRAPHICS LCDSUNROM.COM 1258GND+<strong>3.3V</strong>CSRSTD/C#SCKMOSI1234567C10100n3V324VOUTTABU6LM1117-3.3GND1VIN3C8100n5VR8R9R10R11R125V2K22K22K22K22K2C3100nR210KC533pC733pU4ATMega3212PB0/(XCK/T0)3PB1/(T1)4PB2/(INT2/AIN0)5PB3/(OC0/AIN1)6PB4/(SS)7PB5/(MOSI)8PB6/(MISO)PB7/(SCK)912Y28 Mhz131415161718192021RESETXTAL2XTAL1PD0/(RXD)PD1/(TXD)PD2/(INT0)PD3/(INT1)PD4/(OC1B)PD5/(OC1A)PD6/(ICP)PD7/(OC2)10VCCGNDGND1131PA0/(ADC0)PA1/(ADC1)PA2/(ADC2)PA3/(ADC3)PA4/(ADC4)PA5/(ADC5)PA6/(ADC6)PA7/(ADC7)AREFAVCCPC7/(TOSC2)PC6/(TOSC1)PC5/(TDI)PC4/(TDO)PC3/(TMS)PC2/(TCK)PC1/(SDA)PC0/(SCL)4039383736353433323029282726252423225VR33K3R43K3R53K3R63K3R73K3Demo of LCD connected to AVR Development Board with Demo Code added.The whole screen is picture stored in AVR and the <strong>128x64</strong> is the text printed using font lookup.4<strong>Sunrom</strong> Technologies Your Source for Embedded Systems Visit us at www.sunrom.com


Demo Source code is created in Atmel AVR Studio v6. Since its in C language it’s easy to adapt toother C compilers for other devices. Source code can be downloaded fromhttp://www.sunrom.com/files/1258.zipIf you are interested to view LCD internal details, it uses SSD1306 controller. Its datasheet can bedownloaded from http://www.sunrom.com/files/SSD1306.pdf5<strong>Sunrom</strong> Technologies Your Source for Embedded Systems Visit us at www.sunrom.com


Dimensions6<strong>Sunrom</strong> Technologies Your Source for Embedded Systems Visit us at www.sunrom.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!