Data Sheet
1.5inch OLED Module User Manual
The timing of SPI is composed of CPHA and CPOL. The timing controls the data
transmission of SPI communication.
CPOL (Clock polarity): Controls the steady state value of the clock when no data is
transferred. CPOL=0, SCK pin is low at idle state.
CPHA (Clock phase): Control when the first data is captured, at the first edge or the second
edge. CPHA=0, data is captured at the first edge.
The combination of CPOL and CPHA are the four communication modes of SPI. We
generally use SPI0, that is CPHA=0, CPOL=0.
3. I2C Communication Protocol
For detailed information, please visit Datasheet Page 23
First, transfer 7-bits address of slave device plus 1-bit read/write bit. Then waiting for
response from slave device. It is similar to most of I2C communication. Users can control the DC
pin to change the address of slave device.
Second, transfer 1-bit data bit plus 1-bit command control bit plus 6-bits control byte. The
most important is the command control bit. If the bit is set 0, it means the data transferred is
command, and if it is set 1, data will be transmitted.
Finally, 8-bits data is transferred.
Note: OLED data cannot be read when the controller communicating via serial port for.
HOW TO USE
We provide STM32, Arduino and Raspberry Pi (BCM2835, WiringPi and Python) demo code.
The OLED can be used to:
1. Drawing point, line, figures and circles. And can set their size, solid/dashed, linewidth, full or
nor, etc.
2. Supports English characters display and provide five common fonts
3. Support display Bitmap and 16-bit grey level images.
STM32
1. Hardware connection (Based on XNUCLEO-F103RB)
PIN
XNUCLEO-F103RB
VCC
3V3/5V
GND
GND
DIN
PA7
CLK
PA5
CS
PB6
DC
PA8
RST
PA9