User Tools

Site Tools


products:oled12864:index.html

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
products:oled12864:index.html [2011/01/06 22:41]
ladyada
products:oled12864:index.html [2016/01/28 18:05] (current)
Line 1: Line 1:
   ​   ​
-====  ==== +==== Introduction ​==== 
-[[http://​www.ladyada.net/​images/​oled12864/​oledlorem.jpg|{{ ​ http://​www.ladyada.net/​images/​oled12864/​oledlorem_t.jpg?​nolink&​500x385 ​ |}}]]+[[http://​www.ladyada.net/​images/​oled12864/​oledlorem.jpg|{{ ​ http://​www.ladyada.net/​images/​oled12864/​oledlorem_t.jpg?​nolink&​500x385  ​|}}]]  
 +[[http://​www.ladyada.net/​images/​oled12864/​spi12832text.jpg|{{ http://​www.ladyada.net/​images/​oled12864/​spi12832text_t.jpg?​nolink&​500 ​|}}]]
  
  
- +This is a quick tutorial for our 128x64 ​and 128x32 ​pixel monochrome OLED displays. These displays are small, only about 1" diameter, but very readable due to the high contrast of an OLED display. ​Each OLED display is made of 128x64 ​or 128x32 ​individual white OLEDs, each one is turned on or off by the controller chip. Because the display makes its own light, no backlight is required. This reduces the power required to run the OLED and is why the display has such high contrast; we really like this miniature display for its crispness!
-[[http://​www.ladyada.net/​images/​oled12864/​oledlines.jpg|{{ http://​www.ladyada.net/​images/​oled12864/​oledlines_t.jpg?​nolink&​500x385 |}}]] +
- +
-This is a quick tutorial for our 128x64 pixel monochrome OLED display. These displays are small, only about 1" diameter, but very readable due to the high contrast of an OLED display. ​This display is made of 128x64 individual white OLEDs, each one is turned on or off by the controller chip. Because the display makes its own light, no backlight is required. This reduces the power required to run the OLED and is why the display has such high contrast; we really like this miniature display for its crispness!+
  
 [[http://​www.ladyada.net/​images/​oled12864/​oledfront.jpg|{{ ​ http://​www.ladyada.net/​images/​oled12864/​oledfront_t.jpg?​nolink&​500x410 ​ |}}]] [[http://​www.ladyada.net/​images/​oled12864/​oledfront.jpg|{{ ​ http://​www.ladyada.net/​images/​oled12864/​oledfront_t.jpg?​nolink&​500x410 ​ |}}]]
  
-The driver chip, **SSD1306** can communicate in multiple ways including **I2C**, **SPI** and **8-bit parallel**. ​We prefer SPI since its the most flexible and uses a small number of I/O pins so our example code and wiring diagram will use that.+The driver chip, **SSD1306** can communicate in multiple ways including **I2C**, **SPI** and **8-bit parallel**. ​However, only the 128x64 display has all these interfaces available. For the 128x32 OLED, only SPI is available. Frankly, we prefer SPI since its the most flexible and uses a small number of I/O pins so our example code and wiring diagram will use that.
  
  
-==== Power requirements ​ ====+==== OLED Power requirements ​ ====
  
  
 The OLED and driver require a 3.3V power supply and 3.3V logic levels for communication. The power requirements depend a little on how much of the display is lit but on average the display uses about 20mA from the 3.3V supply. Built into the OLED driver is a simple switch-cap charge pump that turns 3.3v-5v into a high voltage drive for the OLEDs. You can run the entire display off of one 3.3V supply or use 3.3V for the chip power and up to 4.5V for the OLED charge pump or 3.3V for the chip power and a 7-9V supply directly into the OLED high voltage pin. The OLED and driver require a 3.3V power supply and 3.3V logic levels for communication. The power requirements depend a little on how much of the display is lit but on average the display uses about 20mA from the 3.3V supply. Built into the OLED driver is a simple switch-cap charge pump that turns 3.3v-5v into a high voltage drive for the OLEDs. You can run the entire display off of one 3.3V supply or use 3.3V for the chip power and up to 4.5V for the OLED charge pump or 3.3V for the chip power and a 7-9V supply directly into the OLED high voltage pin.
 +
 +==== 128x32 OLED ====
 +
 +The easier of the OLEDs to power is the small SPI one. The OLED is designed to be 5V compatible so you can power it with 3-5V and the onboard regulator will take care of the rest
 +
 +[[http://​www.ladyada.net/​images/​oled12864/​spi12832solder.jpg|{{ ​ http://​www.ladyada.net/​images/​oled12864/​spi12832solder_t.jpg?​nolink&​500 ​ |}}]]
 +
 +Simply connect **GND** to ground, and **Vin** to a 3 to 5V power supply. There will be a 3.3V output on the **3Vo** pin in case you want a regulated 3.3V supply for something else.
 +
 +=== 128x64 OLED ===
 +
 +The 128x64 OLED is a little more complex to get running as it is not 5V compatible by default, so you have to provide it with 3.3V power
  
 [[http://​www.ladyada.net/​images/​oled12864/​oledback.jpg|{{ ​ http://​www.ladyada.net/​images/​oled12864/​oledback_t.jpg?​nolink&​500x442 ​ |}}]] [[http://​www.ladyada.net/​images/​oled12864/​oledback.jpg|{{ ​ http://​www.ladyada.net/​images/​oled12864/​oledback_t.jpg?​nolink&​500x442 ​ |}}]]
Line 27: Line 37:
  
 For most users, we suggest connecting **VDD** and** VBAT** together to 3.3V and then leaving **VCC** unconnected For most users, we suggest connecting **VDD** and** VBAT** together to 3.3V and then leaving **VCC** unconnected
 +
  
  
 ==== Wiring ​ ==== ==== Wiring ​ ====
  
 +==== 128x32 SPI OLED ====
  
-The OLED runs at 3.3V so you'll need to use a level shifting ​chip to use with a 5V microcontrollerThe following will assume that is the case. If you're running ​3.3V microcontroller system, you can skip the level shifter.+The 128x32 SPI OLED is very easy to get up and running because it has built in level shifting. 
 +First up, take piece of 0.1" header 8 pins long 
  
 +[[http://​www.ladyada.net/​images/​oled12864/​spi12832pins.jpg|{{ ​ http://​www.ladyada.net/​images/​oled12864/​spi12832pins_t.jpg?​nolink&​500 ​ |}}]]
  
 +Plug the header long end down into a breadboard and place the OLED on top. Solder the short pins into the OLED PCB
 +
 +[[http://​www.ladyada.net/​images/​oled12864/​spi12832solder.jpg|{{ ​ http://​www.ladyada.net/​images/​oled12864/​spi12832solder_t.jpg?​nolink&​500 ​ |}}]]
 +
 +Finally, connect the pins to your Arduino - **GND** goes to ground, **Vin** goes to 5V, **DATA** to digital **9**, **CLK** to digital **10**, **D/C** to digital **11**, **RST** to digital **13** and finally **CS** to digital **12** ​
 +
 +[[http://​www.ladyada.net/​images/​oled12864/​spi12832wiring.jpg|{{ ​ http://​www.ladyada.net/​images/​oled12864/​spi12832wiring_t.jpg?​nolink&​500 ​ |}}]]
 +
 +<class notewarning>​
 +If you're using the 128x32 OLED, be sure to uncomment the "#​define SSD1306_128_32"​ in the top of Adafruit_SSD1306.h to change the buffer size
 +</​class>​
 +
 +==== 128x64 OLED ====
 +
 +The 128x64 OLED runs at 3.3V and does not have a built in level shifter so you'll need to use a level shifting chip to use with a 5V microcontroller. The following will assume that is the case. If you're running a 3.3V microcontroller system, you can skip the level shifter.
  
 We'll assume you want to use this in a breadboard, take a piece of 0.1" header 10 pins long We'll assume you want to use this in a breadboard, take a piece of 0.1" header 10 pins long
Line 60: Line 89:
 [[http://​www.ladyada.net/​images/​oled12864/​chipwire1.jpg|{{ ​ http://​www.ladyada.net/​images/​oled12864/​chipwire1_t.jpg?​nolink&​500x385 ​ |}}]] [[http://​www.ladyada.net/​images/​oled12864/​chipwire1.jpg|{{ ​ http://​www.ladyada.net/​images/​oled12864/​chipwire1_t.jpg?​nolink&​500x385 ​ |}}]]
  
-Connect pin 2 to **RES** (reset) and pin 4 to **CS** (chip select). Pin 1 goes to 3.3V and pin to ground.+Connect pin 2 to **RES** (reset) and pin 4 to **CS** (chip select). Pin 1 goes to 3.3V and pin to ground.
  
 [[http://​www.ladyada.net/​images/​oled12864/​chipwire2.jpg|{{ ​ http://​www.ladyada.net/​images/​oled12864/​chipwire2_t.jpg?​nolink&​500x350 ​ |}}]] [[http://​www.ladyada.net/​images/​oled12864/​chipwire2.jpg|{{ ​ http://​www.ladyada.net/​images/​oled12864/​chipwire2_t.jpg?​nolink&​500x350 ​ |}}]]
  
-You can connect the inputs of the level shifter to any pins you want but in this case we connected digital I/O **13** to pin 3 of the level shifter, **12** to pin 5, **11 **to pin 8, **10** to pin 10 and **9 **to pin 14. This matches the example code we have written. Once you get this working, you can try another set of pins. +You can connect the inputs of the level shifter to any pins you want but in this case we connected digital I/O **13** to pin 3 of the level shifter, **12** to pin 5, **11 **to pin 9, **10** to pin 11 and **9 **to pin 14. This matches the example code we have written. Once you get this working, you can try another set of pins. 
  
 [[http://​www.ladyada.net/​images/​oled12864/​wired.jpg|{{ ​ http://​www.ladyada.net/​images/​oled12864/​wired_t.jpg?​nolink&​500x367 ​ |}}]] [[http://​www.ladyada.net/​images/​oled12864/​wired.jpg|{{ ​ http://​www.ladyada.net/​images/​oled12864/​wired_t.jpg?​nolink&​500x367 ​ |}}]]
  
-Download and install our Arduino ​library. If you're using another systemits pretty simple to adapt our code, the interface we use is basic bit-twiddling SPI.+==== Arduino Library & Examples ==== 
 + 
 +Download and install our Arduino ​libraries – the links are at the bottom of this page. If you're using a different microcontrollerthe code is pretty simple to adapt, the interface we use is basic bit-twiddling SPI.
  
 Load the example sketch to demonstrate the capabilities of the library and display. Load the example sketch to demonstrate the capabilities of the library and display.
Line 104: Line 135:
  
  
-**[[https://​github.com/​adafruit/​SSD1306|You can download our SSD1306 OLED display Arduino library from github]]** which comes with example code. The library can print text, bitmaps, pixels, rectangles, circles and lines. It uses 1K of RAM since it needs to buffer the entire display but its very fast! The code is simple to adapt to any other microcontroller.+**[[https://​github.com/​adafruit/​Adafruit_SSD1306|You can download our SSD1306 OLED display Arduino library from github]]** which comes with example code. The library can print text, bitmaps, pixels, rectangles, circles and lines. It uses 1K of RAM since it needs to buffer the entire display but its very fast! The code is simple to adapt to any other microcontroller. ​You'll also have to install the  [[https://​github.com/​adafruit/​Adafruit-GFX-Library|Adafruit GFX graphics core library at this github repo]] and install it after you've gotten the OLED driver library. 
 + 
 +**[[http://​www.adafruit.com/​datasheets/​UG-2864HSWEG01.pdf|UG-2864HSWEG01]] Datasheet** 
 + 
 +**[[http://​www.adafruit.com/​datasheets/​UG-2864HSWEG01%20user%20guide.pdf|UG-2864HSWEG01]] User Guide**
  
 +**[[http://​www.adafruit.com/​datasheets/​SSD1306.pdf|SSD1306]] Datasheet**
  
 +**[[https://​github.com/​adafruit/​Adafruit-128x32-SPI-OLED-breakout-board-PCB|GitHub repo for 128x32 PCB]]**
  
 +**[[https://​github.com/​adafruit/​Adafruit-128x64-Monochrome-OLED-PCB|GitHub repo for 128x64 PCB]]**
/home/ladyada/public_html/wiki/data/attic/products/oled12864/index.html.1294353674.txt.gz · Last modified: 2016/01/28 18:05 (external edit)