Difference between revisions of "2.23inch OLED HAT"

From Waveshare Wiki
Jump to: navigation, search
Line 74: Line 74:
 
===Exampels===
 
===Exampels===
 
We provide examples for this module based on three popular hardware platform (STM32, Arduino and RaspberryPi). The libraries include supports Drawing points, lines, figures and displaying strings.
 
We provide examples for this module based on three popular hardware platform (STM32, Arduino and RaspberryPi). The libraries include supports Drawing points, lines, figures and displaying strings.
 +
 +
You can download the codes from [[#Demo codes] and unzip it to get examples.
 
;STM32 examples
 
;STM32 examples
STM32 example is based on STM32F103RBT6 ([https://www.waveshare.com/xnucleo-f103rb.htm XNULCEO-F103RB])
+
STM32 example is based on Waveshare ([https://www.waveshare.com/xnucleo-f103rb.htm XNULCEO-F103RB])
 
{|class=wikitable style="text-align:center"
 
{|class=wikitable style="text-align:center"
 +
|+ I2C Interface
 
!2.23inch OLED HAT!!STM32 Board
 
!2.23inch OLED HAT!!STM32 Board
 
|-
 
|-
Line 87: Line 90:
 
|CLK||PB13
 
|CLK||PB13
 
|}
 
|}
 +
{|class="wikitable" style="text-align:center"
 +
|+ SPI interface
 +
!2.23inch OLED HAT!!STM32 Board
 +
|-
 +
|VCC||3.3V
 +
|-
 +
|GND||GND
 +
|-
 +
|DIN||PB15
 +
|-
 +
|CLK||PB13
 +
|-
 +
|CS||PB12
 +
|-
 +
|DC||PC6
 +
|-
 +
|RST||PC2
 +
|}
 +
*Connect
  
 
==Resource==
 
==Resource==

Revision as of 04:08, 4 September 2019

2.23inch OLED HAT
2.23inch OLED HAT
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Instruction

This is a 2.23inch OLED display within controller.You can directly add it on Raspberry Pi by the 40 PIN pinheader, or connect it to other hardware platform via the IIC and SPI interfaces.The interface of 2.23inch OLED HAT is default SPI, you can also switch to I2C by soldering the resitors on the back of OLED.

Specification

Controller SSD1305
Interface SPI/I2C (default SPI)
Display size 2.23inch
Pixel size 0.41mm x 0.39mm
Display color White
Working voltage 3.3V

Usage Guide

PINS

PIN Description
VCC 3.3V/5V
GND GND
DIN MOSI of SPI interface / SDA of I2C interface
CLK SCLK of SPI interface / SCL of I2C interface
CS Chip select of SPI interface (Low active) / GND when set to I2C itnerface
DC Command / Data selection (SPI) / GND (I2C)
2.23inch-oled-hat-user-manual-1.png

The interface of 2.23inch OLED HAT is default SPI interface, that is 0R resistors are soldered to SPI sides. If you want to use I2C interface, you need to solder the 0R resistors to I2C side,

Working principle

SSD1305 is a controller for 132*64 resolution OLED, however, this 2.23inch OLED HAT has only 128*32 resolution, therefore only part of SSD1305's buffer are used.

I2C
2.23inch-oled-hat-user-manual-2.png

At the begging, the Master device sends a byte (7 bits address and 1 bit R/W)to slaver device and wait for a response.

After getting response, the Master device sends a control byte, this byte tells slave device the data followed later is command or data.

Then Master device will send data or command to slaver device.

For more details please refer to Page22 Figure 8-6 of Datasheet

SPI
2.23inch-oled-hat-user-manual-3.png

For details of the SPI communicating, you can refer to Datasheet Page21 Figure8-5.

Exampels

We provide examples for this module based on three popular hardware platform (STM32, Arduino and RaspberryPi). The libraries include supports Drawing points, lines, figures and displaying strings.

You can download the codes from [[#Demo codes] and unzip it to get examples.

STM32 examples

STM32 example is based on Waveshare (XNULCEO-F103RB)

I2C Interface
2.23inch OLED HAT STM32 Board
VCC 3.3V
GND GND
DIN PB15
CLK PB13
SPI interface
2.23inch OLED HAT STM32 Board
VCC 3.3V
GND GND
DIN PB15
CLK PB13
CS PB12
DC PC6
RST PC2
  • Connect

Resource

Documents

Demo codes

Dimension

2.23inch-OLED-HAT-size.jpg

FAQ

...

Supports

Support

If you require technical support, please go to the Support page and open a ticket.