forked from arduino/Arduino
-
Notifications
You must be signed in to change notification settings - Fork 4
RL78 G23 64p FPB SSD1309 (Arduino™ Sketch)
SuguruHarada64 edited this page Jul 1, 2024
·
12 revisions
- This page describes how to operate a sample that displays strings on OLED using SSD1309 as an example.
- For basic information such as how to install the Arduino IDE and Arduino libraries, and how to write sketches to the board, see Quick Start Guide.
- This page uses the following environments and products for explanations.
- Arduino IDE 2.3.2
- Arduino Library v2.3.1
- U8g2 2.34.22
- RL78/G23-64p Fast Prototyping Board
-
SSD1309 (Operating voltage: 5V)
- If you use SSD1309 with an operating voltage of 3.3V, you need to change the drive voltage.
- Please see below for instructions on how to change the drive voltage.
How to drive the board's port output to 3.3V.
- Start Arduino IDE and select the library icon

- Enter "U8g2" in the library manager form, search for it, and press the "Install" button

- The "U8g2" library will be downloaded and installed in the Arduino IDE
- Select「File」→「Examples」→「U8g2」→「full_buffer」→「HelloWorld」

- Change the sketch below
- Line 159 "//U8G2_SSD1309_128X64_NONAME0_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=/ 13, / data=/ 11, / cs=/ 10, / dc=/ 9, / reset=*/ 8 );” delete the "//" part at the beginning to remove the comment

- Line 371 change "Hello World!" in "u8g2.drawStr(0,10,"Hello World!");" to "RL78/G23 and SSD1309"
- Write "u8g2.drawStr(0,20,"RENESAS!");" next line

- Connect the pins of RL78/G23-64p FPB and SSD1309 as shown below
- If you are using an SSD1309 with an operating voltage of 3.3V, connect VCC to the 3V3 pin of the FPB.
■SSD1309 and RL78/G23-64p FPB pin correspondence table
SSD1309 pin | RL78/G23-64p FPB pin |
---|---|
CS | 10 |
DC | 9 |
RES | 8 |
SDA | 11 |
SCL | 13 |
VCC | 5V |
GND | GND |
■Connection diagram of SSD1309 and RL78/G23-64p FPB
- Compile and upload
- Select "Upload" in the Arduino IDE will start compile and upload

- An OLED string will be displayed as shown below