This community-contributed tutorial uses the temperature sensor of the Renesas AE-CLOUD1 to display temperature on an OLED module using I2C. Temperature is taken from the ENS210 onboard sensor with I2C. This tutorial was produced by community members and not checked by Renesas or Medium One. Thanks to Michael Li for the good parts. Blame me for any errors. If you do find any errors, please help us by providing feedback. 🙂
HERE’S WHAT YOU NEED TO GET STARTED:
- Renesas Synergy AE-CLOUD1 Kit (Order Here)
- Windows computer
- SEGGER J-Link Software – download
- OLED demo binary (OLED.srec) – download
- OLED hardware module (128×64) – Amazon link, document for LED module link
- Grove cables (generic) – example Amazon link (only need one cable)
STEP 1: INSTALL J-LINK SOFTWARE
The software needed for this tutorial is available at this link:
STEP 2: ASSEMBLE HARDWARE COMPONENTS
The hardware components you will need for this tutorial are shown below.
The WiFi module is not used in this tutorial.
STEP 3: CONNECT BOARD HARDWARE COMPONENTS
Connect it to the JTAG connector of the board and the debugger. Connect the board to USB power.
Plug the debugger into your computer. Your computer will now have two USB cables plugged into it.
STEP 4: CONNECT OLED MODULE WITH GROVE WIRES
The OLED module comes nicely packaged, but does not come with any wires. You’ll need to purchase your own Grove cable and connect the Grove connector on the AE-CLOUD1 board to the 4 pins on the OLED module.
Connect the Grove cable to the Grove connector closest to the PMOD or USB connector. It will say, I2C on it.
Plug your LCD module into a breadboard or connect the Grove cable directly to the pins. You do not need a breadboard, but if you want to build additional projects, it is useful. Here’s one on Amazon with 20 wires for $4. Here’s another example with 4 breadboards and 120 wires for $12. Buy at your own risk. These breadboard kits are examples only and have not been tested.
- Grove pin 1 is SCL on the LCD panel, yellow, serial clock
- Grove pin 2 is SDA on the LCD panel, data, white
- Pin 4 is GND, ground, black
After you connect the LCD module to your AE-CLOUD1 board, the module will be black at this stage.
STEP 5: FLASH BOARD WITH OLED DEMO BINARY
You need to flash the board with a pre-compiled binary to test the LCD module and ENS210 onboard environmental sensor.
Start up J-Flash Lite. Select Renesas R7FS5D97E as the device. The list of Manufactures is long but in alphabetical order.
Select SWD as the Interface.
Download the file OLED.srec from the Renesas AECLOUD1 OLED GitHub repo releases section. Then select the file in J-Flash Lite from where you downloaded it locally.
Program the device.
STEP 6: TEST OLED MODULE
Reboot your board by pulling the USB power cable out and plugging it back in. You will see the default screen, which is a monochrome bitmap stored into the program as a C array. You can edit this later with the source code on GitHub. For now, let’s review the screen to make sure your wiring works.
You will see text screens that you can also edit, in this case three additional screens.
Currently, the project is not pushing sensor data to the Renesas IoT Sandbox. In the future, I hope to add this in.
You will see the temperature displayed from the onboard temperature sensor.
Congratulations, you have now successfully displayed temperature information directly from the AE-CLOUD1 kit to an OLED display using I2C! Nice work!
PART 2: (OPTIONAL) CUSTOMIZE TEXT AND GRAPHICS
Steps past this section are optional. You only need to follow the next steps if you wish to customize the text and graphics in the demo application. You will need Renesas e2 Studio and Synergy for the customization.
STEP 7: INSTALL DEVELOPMENT SOFTWARE
STEP 8: DOWNLOAD FILES FROM GITHUB
In a web browser go to this URL:
Go to the “Clone or download” green button on GitHub.
A drop-down menu will open and allow you to “Download ZIP”.
STEP 9: EXTRACT FILES ON YOUR WINDOWS COMPUTER
I suggest using 7-Zip for the extraction. It is free and handles long file names and directory structures better than the zip utility that comes with Windows 10.
After extracting the files with 7-zip, my files look like this:
STEP 10: INSTALL BOARD SUPPORT PACKAGE
Copy the file Renesas.S5D9_IOT_BOARD.1.3.0.pack into the BSP Packs folder inside of your e2 Studio installation. The default installation location is:
STEP 11: SETUP A NEW WORKSPACE IN E2STUDIO
Although you can import your project into an existing workspace, I like to create a new workspace to keep things organized.
When e2 Studio starts, clear the welcome screen.
Clear the notifications in “Smart Browser”.
Under “File”, select “Switch workspace”.
STEP 12: CREATE A NEW PROJECT
Under File, select New -> C/C++ Project.
Select Renesas Synergy C Executable Project.
Name the project.
Make sure the SSP version is 1.3.0. Select S5D9_IOT_ENABLER as the Board. The device is R7FS5D97E2A01CLK.
STEP 13: IMPORT SOURCE FILES INTO E2 STUDIO
Under “File”, select “Import”.
Select “General -> File System”.
Browse for the directory you just extracted.
Check the box next to renesas-aecloud1-oled-master.
Check “Overwrite existing resources without warning’.
Your project will now look like this:
STEP 14: TEST BUILD
Press the hammer to test the build.
You should get a “Build Finished. 0 errors” message in the Console.
The binary OLED.srec file is in the Debug folder.
In the Property tab, the “last modified” time should be the time of your build.
Congratulations, you’ve just built the OLED demo from source. You can now get to the fun part and modify the text and graphics that are displayed to the OLED module.
STEP 15: CUSTOMIZE TEXT MESSAGES
Under src, select the file hal_entry.c.
Use the search feature to find the string that displays on your OLED screen. For example, search for OPPKEY. Edit the text string. Use only upper case letters.
After editing the strings. Compile the code and install the new binary with J-Flash Lite.
You can also change the delay in milliseconds between screens.
STEP 16: CUSTOMIZE IMAGE
To change the startup image, you will need to create a bitmap monochrome image with a max size of 128×64 pixels.
You can use Paint on Windows to save as Monochrome Bitmap.
Once you have a monochrome bitmap, you need to convert the bitmap into a c array. I’m using the free tool LCD Assistant for this.
The C array will look something like this:
Back in e2 Studio, change the existing array in ssd1306_oled.c to your new array.
STEP 17: TRANSFER OLED.SREC TO YOUR BOARD
Recompile and transfer to your board using the J-Flash Lite tool described earlier in this tutorial.
As a reminder, the OLED.srec binary will be created in the Debug folder.
From Windows 10, the default location is:
You will need to navigate to this binary using SEGGER J-Flash Lite.
STEP 18: PROVIDE COMMUNITY FEEDBACK
If you have any questions, feedback, fixes, or would like to post your completed project (“I did it”), please join our community forum.