Wis 2.23inch Oled Hat User Guide

Wis 2.23inch Oled Hat User Guide

WIS logo

WIS 2.23inch OLED HAT

IS 2.23inch OLED HAT

PINS

PINDescription
VCC3.3V/5V
GNDGND
DINMOSI of SPI interface / SDA of I2C interface
CLKSCLK of SPI interface / SCL of I2C interface
CSChip select of SPI interface (Low active) / GND when set to I2C itnerface
DCCommand / Data selection (SPI) / GND (I2C)

PINSThe 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

Working principle

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

SPI

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 HATSTM32 Board
VCC3.3V
GNDGND
DINPB15
CLKPB13
SPI interface
2.23inch OLED HATSTM32 Board
VCC3.3V
GNDGND
DINPB15
CLKPB13
CSPB12
DCPC6

Open project, compile and download to XNUCLEO-F103RB board

Raspberry Pi example

Hardware connection

I2C interface
2.23inch OLED HATRaspberry Pi (BCM)
VCC3.3V
GNDGND
DINSDA
CLKSCL
SPI interface
2.23inch OLED HATRaspberry Pi(BCM)
VCC3.3V
GNDGND
DINMOSI
CLKSCLK
CSCE0
DC24
RST25

Software setting
Open terminal of Raspbain and enable I2C/SPI interface

Software setting

Choose Interfacing Options -> I2C -> Yes; or
Choose Interfacing Options -> SPI ->Yes;

Libraries Installation
Open terminal of Raspbain and install libraries (BCM2835, wiringPi, Python) as below

Libraries Installation

Libraries Installation 1

Runing example (Take SPI codes as example)
Copy Raspberry Pi codes which is downloaded before to Raspberry Pi, put it to /home/pi of Raspbian
Enter the corresponding directory of codes and execute commands to run:

Runing exampleRuning example 1

Note: If wiringPi and Python example work abnormally after bcm2835 example, please reboot and test again.

Arduino example
This examples are based on Waveshare UNO PLUS which is compatible with official Arduino UNO R3
• Connect OLED to UNO Plus according to figure below:

I2C interface
PINUNO PLUS
VCC3.3V
GNDGND
DINSDA/D14
CLKSCL/D15
SPI interface
PINUNO PLUS
VCC3.3V
GNDGND
DIND11(MOSI)
CLKD13(SCK)
CSD10
DCD8
RSTD9

How to create image data

• Open Image2Lcd software
• Open an BMP file
• Set Data type: *c

Scanning type: Horizontal
Grey Scale: Monochrome
Max height and width: 128 32

How to create image data

The expected result:

The expected result

Documents / Resouces

Download manual
Here you can download full pdf version of manual, it may contain additional safety instructions, warranty information, FCC rules, etc.


Related Manuals