The load cell appnote for Road test: Renesas Solution Starter Kit for RX23E-A comes with example firmware. In combination with the stater kit PC Tool, you get a balance display. The firmware source is available as an e² studio project, but there's no ready-to-load binary. In this post I show how to build it. If you're not into source code: I'll attach the binary in a format that can be loaded on the board with Renesas' Flash Programmer.
What do you need:
- The software from Renesas Solution Starter Kit for RX23E-A: get up and running (at least the PC Tool. The rest is optional)
- e² studio, with support for rx23, and the CCRX toolchain (optional)
- a load cell (I ordered a 1 KG one)
- Flash Programmer software
Load and build the example in e² studio (optional)
Start e² studio, and select Import Sample Project from the Welcome Page. Select Online -> RX. Select the device:
Select the Load Cell project and import it
Right-click on the imported project, and select Properties. Navigate to C/C++ Build -> Settings -> Toolchain. Select the Renesas CCRX chain.
By default, the project builds binaries for a debugger. To load it on to our starter kit with Flash Programmer, we need to generate a .mod file. Switch to the Tool Settings tab, and navigate to Converter -> Output. Select Motorola S format file
Apply and Close. Build (your 60 days evaluation time starts ticking now)
Load the firmware to the board
Disconnect your board. Change JP17 from Emulator to USB. Plug your board back in.
Run Renesas Flash Programmer, and start a new project. Select RX200, give your project a name, and select COM port. Then click on Tool Details and select the COM of your board. Now browse to the .mod file that was generated during the build. You'll find it in the HardwareDebug/ subfolder of your e² studio project. Alternative, download the one I attached to this blog. Press Start and the firmware gets loaded.
When done, unplug the board, and move JP17 back to Emulator.
Run the application
Set the jumpers as indicated in the appnote
Install and connect the load cell
I mounted mine under my table, and used a wardrobe handle as hook.
Connections
wire | purpose | RX23E-A pin | CN2 |
black | VSS (EXC-) | REF0N | R0N (2) |
red | VCC (EXC+) | REF0P | R0P (3) |
white | OUT- (Signal Lo) | AIN0 | AIN0 (4) |
green | OUT+ (Signal Hi) | AIN1 | AIN1(5) |
Start PC Tool and Connect. You will notice that the 1st 4 tabs are disabled. But the Application tab now works. It shows the weight in a graph.
In this example, I weight a bottle opener, and lift it briefly:
Restore the original firmware
You can use Flash Programmer to restore the original firmware. Follow the same steps, but take the rx23ea_rssk_fw.mot that comes with the PC Tool. It sits in the same directory as the .exe
Original Renesas toolchain project, but with the binaries precompiled: rx23ea_loadcell_20230716.zip
Project ported to GCC toolchain, also with binaries prebuilt: rx23ea_loadcell_gcc_20230717.zip
follow-up: Renesas Solution Starter Kit for RX23E-A: investigation into the Load Cell application