Electronics Projects

Programmer for Renesas RL78 Families

Renesas RL78 is a fast developing family family of 16-bit lower-power microcontrollers. The RL78/G13 Demonstration Kit (RDK) shown below allows one to perform a test development by using the on-board microcontroller and numerous peripheral analog and digital devices. The board is equipped with an LCD, comes with various application programs on CD, and is supported by IAR Embedded Workbench, including its free version.

RDK board

After playing working with it for a while I wanted to program my own device. The manufacturer provides various debuggers and programmers which are over $100, so I thought on utilizing the RDK for that. The board contains a full functioning programmer and in-circuit debugger but is designed to program only the on-board microcontroller. However, it can be easily turned into a stand-alone debugger as shown below. The changes I made are reversible and the full functionality of the RDK can be restored, if needed. The general view of the "hacked" debugger along with the custom proto-board is shown on the left image below.

The in-circuit programming of RL78 microcontrollers is performed over a single high-speed (1 MHz) bidirectional line TOOL0. In addition to that the reset pin of the MCU is involved. Therefore, in the minimum configuration there are just 4 lines needed to connect the programmer and the custom target board: TOOL0, RST, Vss, and Vdd. The Vdd line is optional and can be used to deliver power form the RDK to the target board. If the target board has its own power supply, the Vdd line is not required. Obviously, one should isolate the on-board MCU so that it won't influence the programming of an external one. This can be done by cutting off the TOOL0 and RST wires connecting the on-board programmer with the MCU. I did two cuts shown in the middle image. The cut PCB traces are circled and can be restored, if needed without loosing the functionality of the original board. These traces are located under the LCD, which I removed in order not to be bothered by its bright back-light, which is always on. The LCD is glued to the PCB with a kind of double sided Scotch-type tape. Pull it up carefully and take it out of the connector.

General view Fix 1 Fix 2

Next step is to deliver the TOOL0 and RST signals outside. For that I utilized the on-board PM0D1 connector. Its pins 11 and 12 are already connected to +3.3V and GND, respectively. I removed 0-Ohm resistors R41 and R42 (marked on board and located to the right of the connector). This isolates pins 7 and 8 of the connector from the rest of the board. Last operation is to connect pin 4 of U22 (the RST line) with the left contact spot of R41 (see the right image) with a short wire jumper. A similar jumper is needed to connect pin 11 of U22 with the left contact spot of R42. That's it. The RST pin of the on-board MCU will be still pulled up to 3.3V via on-board resistor R99. This way pins 7, 8, 11, 12 of the PMOD1 connector will carry signals RST, TOOL0, GND, and Vdd, respectively. I attached a 20-cm 4-wire programming cable to those pins via a 6-pin header. Longer cable length is not recommended.

It has to be mentioned that the TOOL0 line must be pulled up to +3.3V on the programmer side. For that I mounted a 1 Kohm resistor on the connector board attached to the other end of the programming cable (see the left image below). The male pin header has pitch 1.27mm (a model from Sullivan). Furthermore, the RST pin must be pulled up via a 4.7 - 10 Kohm resistor to Vdd on the target end. I assembled a small test board with a 20-pin RL78G13 device on it, containing that resistor.

Connector Schematic Layout

The modified programmer is still recognized by the IAR Embedded Workbench and one can perform in-circuit programming and debugging of your own devices. I tried several RL78G13 devices, everything works just fine.

Very important: It turns out that the free version of the IAR Embedded Workbench can only program the devices in the Debug mode. This way the minimum current consumption of the MCU in the sleep mode is about 270 μA. To achieve a sub-microampere sleep mode current consumption another software tool has to be used for programming: Renesas Flash Programmer. It is a free download from the Renesas web page. It supports fancy Renesas programmers E1 and E20 and also recognizes the attached RDK as a COMxx device. The xx depends on your computer configuration. It looks like even if the RDK is connected to the computer via a USB cable a virtual COM port is opened to communicate with it. To program the CPU now one should first obtain a .HEX file with the IAR IDE and then load this file into the MCU with the Flash Programmer. This way the sleep mode current consumption with working 12-bit Interval Timer drops down to 0.4 μA.

Downloads:


Last modified:Mon, Jan 23, 2023.

04045