This is an operation guide to introduce the major functions for those using the RL78 Web simulator for the first time.
It provides an explanation of how to run the sample programs and how to use the simulator GUI, the automatic code generation tool, and others in an easy-to-understand manner.
Click [Workbench] in the lower right of the [Welcome] screen.
Expand the downloaded sample project into an arbitrary folder.
Select [Import] from the [File] menu of e2studio.
An import dialog will pop-up. Select [Existing Projects into Workspace] from [General], and click [Next].
The screen will switch to the project import screen.
Click [Browse] in [Select root directory:] and select the expanded downloaded sample project folder, [ADC_OneShot].
Place a check [Search for nested projects]. A list of nested projects will appear.
Check Project [ADC_OneShot] and click [Finish].
Loading of project is completed when the selected project appears in the project explorer.
Right click [ADC_OneShot] in the project explorer to indicate the menu, then select [Build Project].
Converts analog input value set by the potentiometer to digital when SW1 is pressed. Selects 8 bit resolution when SW2 is depressed and 10 bit resolution when SW3 is depressed.
Simulator screen |
Assigned function |
Potentiometer |
Connect to AD input |
SW1 |
Start analog to digital (A/D) conversion |
SW2 |
Set to 8 bit resolution |
SW3 |
Set to 10 bit resolution |
Consumption current simulator is disabled in default mode and must be enabled. Indicate [Consumption Current] view.
If the [Consumption Current] panel is not visible,Select [debug],[Consumption Current] in the [renesas views] menu.
Enable the simulator by placing a check against the power supply mark icon in the upper right hand corner of the [Consumption Current] tool bar.
Select [ADC_OneShot DebugBuild] in the project explorer, right click to indicate the menu and select [Debug As], [Debug Configurations..].
Select [Renesas Simulator Debugging (RX, RL78)] from [ADC_OneShot DebugBuild] debug configuration dialog. Click [Debug] button to start debug.
Perspective switch confirmation dialog will appear. Click [Yes]
To re-connect to debugger, select the applicable debugger from the [Debug] tool bar pull-down menu.
Simulator GUI will boot simultaneously when the debugger is booted.
Select [Open] from Simulator GUI [File] menu.
A file selection dialog will appear. Select [ I/O Panel file] from the file type on the lower right, and select the following work space folder:
/ADC_OneShot /G13_RSK_Board.pnl.
The following board simulator screen will appear.
Add a variable to indicate the value after A/D conversion to the numerical expression view.
Add a variable to indicate the value after A/D conversion to the numerical expression view.
gADC_Result
Configuration will be changed to renew the added “gADC_Result” even during operation. Right click on “gADC_Result” and select [Real-time Refresh] from the menu.
Select [Resume] from the execution menu to run the program.
It is set to stop at the head of the main ( ) function. Run the program by clicking on [Resume] from the [Run] menu.
Pressing down the Resume icon on the tool bar will result in the same action.
Set the input voltage level by operating the potentiometer with the mouse, in the I/O panel indicated by the simulator GUI. A/D conversion will occur when SW1 is clicked and the value will be indicated in “gADC_Result” registered in the formula panel.
Furthermore, it will be indicated in 8 bit resolution when SW2 is pressed and in 10 bit resolution when SW3 is pressed.
When A/D conversion is made using the SW1 button while SW3 is selected, “gADC_Result” registered in the formula panel will be indicated in 10 bit resolution.
By changing the input potential using the potentiometer and followed by A/D conversion with the SW1 button, the value of “gADC_Result” registered in the formula panel will change.
When A/D conversion is made using the SW1 button while SW2 is selected, “gADC_Result” registered in the formula panel will be indicated in 8 bit resolution.
Select [Suspend] from [Run] menu to terminate the program.
Indicate the results of consumption current simulation in the [Consumption Current] view and confirm that consumption current has increased during the period of A/D conversion.
Graphs can be enlarged or reduced by a right click in the [Consumption Current] view to indicate the menu.
Drag mouse over the graph to indicate detailed information.
Select [End] or [Disconnect] from the [Run] menu.
Select [End] from the [File] menu.
Click [Workbench] in the [Welcome] screen of e2studio.
Expand the downloaded sample project into an arbitrary folder.
Select [Import] from the [File] menu of e2studio.
An import dialog will pop-up. Select [Existing Projects into Workspace] from [General], and click [Next>].
The screen will switch to the project import screen.
Click [Browse…] in [Select root directory:] and select the expanded downloaded sample project folder, [an_r20an0399jj0100_rl78].
Place a check [Search for nested projects]. A list of nested projects will appear.
Check Project [RL78G13_CG_Sample_e2s] and click [Finish].
Loading of project is completed when the selected project appears in the project explorer.
Right click [RL78G13_CG_Sample_e2s] in the project explorer to indicate the menu, then select [Build Project].
Consumption current simulator is disabled in default mode and must be enabled. Indicate [Consumption Current] view.
If the [Consumption Current] panel is not visible,Select [debug],[Consumption Current] in the [renesas views] menu.
Enable the simulator by placing a check against the power supply mark icon in the upper right hand corner of the [Consumption Current] tool bar.
Select [RL78G13_CG_Sample_e2s SimulatorDebug] in the project explorer, right click to indicate the menu, then select [Debut as] and [Debug Configurations..].
Select [RL78G13_CG_Sample_e2s SimulatorDebug] of [Renesas Simulator Debugging (RX, RL78)] of debug configuration dialog. Click [Debug] button to start debug.
Perspective Switch confirmation dialog will appear. Click [Yes]
To re-connect to debugger, select the applicable debugger from the [Debug] tool bar pull-down menu.
Simulator GUI will boot simultaneously when the debugger is booted.
Select [Open] from the Simulator GUI [File] menu.
A file selection dialog will appear. Select [I/O Panel file] from the file type on the lower right, and select the following work space folder:
/RL78G13_CG_Sample_e2s /G13_RSK_Board.pnl
The following board simulator screen will appear.
Numerical expressions will be added to confirm the variables and the value of the expressions in the sample program.
Click [Add new numerical expression] in the numerical expression view and register variables and expressions.
Please register the required variable names and numerical expressions when confirming each of the functions.
Setting will be changed to renew the added variables even during operation. Right click on the variable and select [Real-time Refresh] from the menu.
Select [Resume] from the execution menu to run the program.
It is set to stop at the head of the main ( ) function. Run the program by clicking on [Resume] from the [Run] menu.
Pressing down the Resume icon on the tool bar will result in the same action.
The sample program is designed, based on the hardware configuration of RSKRL78G13.
RL78/G13 (R5F100LE 64pin) is used for the microcomputer and operates under the following clock:
- High speed system clock: 20MHz
- High speed on-chip oscillator clock: 12MHz (for Snooze Mode)
- Sub-system clock: 32.768 kHz
Major functions of the sample are as follows:
(1) LED flashing (12 bit interval timer)
(2) PWM output
(3) Square wave output
(4) Number of switch depression counter (timer event counter)
(5) UART communications
(6) CSI communications
(7) IIC communications
(8) DMA transfer
(9) Standby function (Halt, Stop, Snooze)
Run the program and open the I/O panel of the simulator GUI.
Resume the program.
Confirm LED0 in I/O panel is flashing.
Interrupt the program if it is running.
Open the numerical expression view and add the following variable:
gADC_Result
Resume the program and open the I/O panel of the simulator GUI.
Change the potential by operating the potentiometer on the I/O panel.
A/D conversion is carried out when SW3 on the I/O panel is depressed.
Confirm that the flashing interval of LED on the I/O panel has changed.
Display the numerical expression view and confirm that the value of gADC_Results change.
Interrupt the program if it is running.
Open the numerical expression view and add the following variable:
gEventCount
Resume the program and open the I/O panel of the simulator GUI.
Counting-up of variable will start when SW3 on the I/O panel is depressed.
Confirm that the flashing interval of LED on the I/O panel has changed.
Display the numerical expression view and confirm that the value of “gEventCount” will increment each time SW3 is depressed.
Interrupt the program if it is running.
Select [Timing Chart] in [Simulator] menu of simulator GUI. The timing chart window will be displayed.
Select [Select Pin] from the [Edit] menu and register “P16/TI01/TO01/INTP5” for the pin name in the [Select Pin] dialog.
Waveform will be displayed in the timing chart window when the program is resumed.
Interrupt the program to measure the cycle. From the right click menu, set “Marker A set” (blue) and “Marker B set” (green) and confirm that the cycle is 1ms. Marker position can be moved to the location of the rising and the trailing gradient, using the search function on the [Edit] menu.
Interrupt the program if it is running.
Open the serial window by selection [Serial] in the [Simulator] menu.
Select [UART0] on the upper left hand side of the window. It cannot be changed once it has been selected.
Press [Format] button to configure UART0.
Item |
Setting |
Baud rate |
19,200 bps |
Transfer direction |
LSB first |
Data bit length |
8 |
Stop bit length |
1 |
Parity |
No parity |
Select [Timing Chart] from [Simulator] menu on the simulator GUI. The timing chart window will appear.
Select from the [Edit] menu and register
“P11/SI00/RXD0/TOOLRXD/SDA00” for the pin name in the [Select Pin] dialog.
Resume the program to indicate the data transmitted from the microcomputer to the serial window. As it is a transmission received, seen from the serial window side, it will be indicated on the “Received Data” side.
Entering “0x7a” in the lower left area and pressing “Send” will temporarily suspend the receiving of data. Pressing “Send” after entering “0x79” will resume the reception of data.
Transmit “0x7a” and “0x79” again to interrupt the program.
Display the timing chart and confirm the waveform.
Marker position can be moved to the location of the rising and the trailing gradient, using the [search] function on the [Edit] menu.
Interrupt the program if it is running.
Select [Timing Chart] from the [Simulator] menu of simulator GUI. The Timing Chart window will be displayed.
Select [Select Pin] from the [Edit] menu and register “P03/ANI16/SI10/RXD1/SDA10” and “P02/ANI17/SO10/TXD1” as the pin names in the [Select Pin] dialog.
Select [Serial] from the [Simulator] menu.
A new serial window will open. Select [CSI_10] from the upper left side of the window. It cannot be changed once it has been selected.
Press [Formal] button to configure CSI10. Place a check mark next to [Repeat].
Item |
Configured contents |
Clock mode |
Slave |
Transfer clock |
10 kHz |
Transfer direction |
MSB first |
Data bit length |
8 |
Data phase |
Normal |
Clock phase |
Normal |
Configure a one-byte transmission data (value is arbitrary) at the bottom left of the serial window. Resume the program and press [Auto Send] in the serial window just once.
Depressing SW2 in the I/O panel in this condition will receive data transmitted from the microcomputer. Depressing SW2 again will repeat the transmission and reception.
Simultaneously, the transmission data configured previously will be transmitted to the microcomputer. In this sample, data received by CSI10 will not be used.
Similarly, open the serial window and select [CSI_20], depress [Format] button and configure CSI20.
Item |
Configured contents |
Clock mode |
Master |
Transfer clock |
10 kHz |
Transfer direction |
LSB first |
Data bit length |
8 |
Data phase |
Normal |
Clock phase |
Normal |
Transmission of data in single-byte units can be made by the input of transmission data to the lower left of the serial window and depressing the [Send] button. The [Auto Send] button will transmit all the transmission data.
Data transmitted from the serial window can be confirmed by the reception buffer, “gCSI20_RXBuffer”, of CSI20. The value can be confirmed by returning to e2studio and adding “gCSI20_RXBuffer” to the numeric expression.
Waveform will be displayed in the Timing Chart window.
Marker position can be moved to the location of the rising and the trailing gradient, using the [search] function on the [Edit] menu.
Interrupt the program if it is running.
Select [Timing Chart] in [Simulator] menu of simulator GUI. The Timing Chart window will be displayed.
Select [Select Pin] from the [Edit] menu and register “P60/SCLA0” as the pin name in the [Select Pin] dialog.
Select [Serial] in the [Simulator] menu.
A new serial window will open. Select [IICA_0] from the upper side of the window. It cannot be changed once it has been selected.
Press [Formal] button to configure IICA0. Also place a check mark next to [Repeat].
Resume the program. Depressing SW2 in the I/O panel will transmit data from the microcomputer to the slave address.
The slave address will return ACK response when the address match, and will hold the IIC bus. Depressing [Auto Receive] button here will enable the reception of the continuation of the data.
Wave form will be displayed in the Timing Chart window.
Marker position can be moved to the location of the rising and the trailing gradient, using the search function on the [Edit] menu.
DMA transfer made from RAM to SFR.
RAM address of the originator is re-configured to the leading address of a 16 byte array declared in the program. The initial value of RAM (16 bytes) is {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}.
Channel 2 of the timer is used as the interval timer and the interval time is set to 1000 [ms]. INTDMA0 interrupt will occur after the transfer of 16 bytes, so the originator address is return to the leading address of the array and will repeat the 16 byte transfer.
Interrupt the program if it is running.
Add [*(char *)0xFF07] (Address of P7) to the numerical expression view. Select [Real Time Refresh] from the right click menu while the added row is being selected.
Confirm that the value of [*(char *)0xFF07] changes every second in simulated time axis when the program is resumed.
Interrupt the program if it is running.
Select [Signal Data Editor] in the [Simulator] menu and open the signal editor.
Select [Select Pin] from the [Edit] menu. Register “P41/TI07/TO07”, “P42/TI04/TO04” and “P43” as the three pin names.
Set “1, 0, 0” to the signal editor, starting sequentially from P41. Depress [Start] button of signal input. Depressing SW1 on the I/O panel when P41 to P43 are entered will transfer to Halt mode. It will transfer to Stop mode In case of “0”, “1”, and “1”, and to Snooze mode in case of “0”, “0”, and “1”.
LED0 to LED3 will turn off when transitioned to stand-by.
Suspend program to confirm the transitioning into each mode and confirm the stopped position of the program counter.
Display the results of Consumption Current simulation on thee [Consumption Current] view and confirm the consumed current.
A right click in the [Consumption Current] view will indicate the menu to enlarge or reduce graphs.
Drag mouse over the graph to indicate detailed information.
Select [End[ or [Disconnect] from the [Run] menu.
Select [End] from the [File] menu.
Click [Workbench] in the lower right of the [Welcome] screen.
Expand the downloaded sample project into an arbitrary folder.
Select [Import] from the [File] menu of e2studio.
An import dialog will pop-up. Select [Existing Projects into Workspace] from [General], and click Next>.
The screen will switch to the project import screen.
Click [Browse..] in [Select root directory:] and select the expanded downloaded sample project folder, [an_r20an0399jj0100_rl78].
Place a check [Search for nested projects]. A list of nested projects will appear.
Check Project [RL78G13_CG_Sample_e2s] and click [Finish].
Loading of project is completed when the selected project appears in the project explorer.
Select [Show View], [Other] in the [Window] menu of e2studio.
“Show View” dialog will open.
Select [Code Generator], [Peripheral Functions] and click [OK].
[Peripheral Functions] view will be displayed.
Select [Timer] from the Peripheral Functions view menu.
Set square width of Square-wave Setting for Channel 5 to 1ms and click [Generate Code].
Message indicating generation of file was successful will be indicated on the console.
Right click on [RL78G13_CG_Sample_e2s] in the project explorer to display the menu and select [Build Project].
Select [RL78G13_CG_Sample_e2s SimulatorDebug] from the project explorer, right click the mouse to display the menu, then select [Debug As], [Debug Configurations..].
Select [RL78G13_CG_Sample_e2s SimulatorDebug] in [Renesas Simulator Debugging (RX,RL78)] of the debug configuration dialog. Click [Debug] button to start debug.
Perspective Switch confirmation dialog will open. Click [Yes]
To re-connect to debugger, select the applicable debugger from the [Debug] tool bar pull-down menu.
Simulator GUI will boot simultaneously when the debugger is booted.
Select [Timing Chart] from the [Simulator] menu of the simulator GUI.
Select [Select Pin] from the [Edit] menu and register “P05/TI05/TO05” as the pin name in the “Select Pin” dialog.
Select [Resume] from the [Run] menu to run the program.
It is set to stop at the head of the main ( ) function. Run the program by clicking on [Resume] from the [Run] menu.
Pressing down the Resume icon on the tool bar will result in the same action.
Waveform will be displayed in the Timing Chart Window when the program is resumed.
Interrupt the program and measure the cycle. From the right click menu, set “Marker A set” (blue) and “Marker B set” (green) and confirm that the cycle is 1ms. Marker position can be moved to the location of the rising and the trailing gradient, using the search function on the [Edit] menu.
Confirm the consumption current by the display of consumption current simulation result in the [Consumption Current] view.
The consumption current simulator could be disabled. Confirm that it is enabled.
End any programs that are running and confirm that the power supply mark icon on the upper right of the tool bar in the [Consumption Current] view has been checked.
If not, select the [Run] menu [Exit] or [Disconnect].
Once you end the debugging, after you enable to check the power mark in [Consumption Current] view,Please resume from the steps in "3-2-4 Debug Configuration”.
Graphs can be enlarged or reduced by indicating the menu by a right click in the [Consumption Current] view
Drag mouse over the graph to indicate detailed information.
Select [Show View], [Other..] in the [Window] menu of e2studio.
The view display dialog will open.
Select [Code Generator], [Peripheral Functions] and click [OK].
[Peripheral Functions] view is displayed.
Select [Serial] in the Peripheral Functions view menu.
Set reception/transmission rate of UART0 to 9600 bps and click [Generate Code].
Successful file generation will be indicated in the console.
Right click [RL78G13_CG_Sample_e2s] in the project explorer to indicate the menu, then select [Build Project].
Select [RL78G13_CG_Sample_e2s SimulatorDebug] in the project explorer, right click the mouse to indicate the menu and select [Debug As], [Debug Configurations..].
Select [RL78G13_CG_Sample_e2s SimulatorDebug] of [Renesas Simulator Debugging (RX,RL78)] debug configuration dialog. Debug will start when the [Debug] button is clicked.
Perspective switch confirmation dialog will appear. Click [Yes].
To re-connect to debugger, select the applicable debugger from the [Debug] tool bar pull-down menu.
Simulator GUI will boot simultaneously when the debugger is booted.
Select [Select Pin] from the [Edit] menu and register “P11/SI00/RXD0/TOOLRXD/SDA00” as the pin names in the Select Pin dialog.
Select [Serial] from the [Simulator] menu of the Simulator GUI. The Serial window will be displayed. Select “UART0” on the upper left side of the window. Once it has been selected, no changes can be made.
Select [Resume] from the execution menu to run the program.
It is set to stop at the head of the main ( ) function. Run the program by clicking on [Resume] from the [Run] menu.
Pressing down the Resume icon on the tool bar will result in the same action.
Data transmitted from the microcomputer will be displayed in the serial window when the program is resumed. It will be indicated in the “Receive Data” side, as it will appear to be a reception seen from the serial window side.
In case of transmitting a single byte to the microcomputer, input the data to be transmitted to the area on the lower left and depress [Send] button. The waveform will be displayed in the Timing Chart window.
Confirm the consumption current by the display of consumption current simulation result in the [Consumption Current] view.
Graphs can be enlarged or reduced by indicating the menu by a right click in the [Consumption Current] view.
Drag mouse over the graph to indicate detailed information.
Select [End] or [Disconnect] from the [Run] menu.
Select [End] from the [File] menu.
Select [Show View], [Other] in the [Window] menu of e2studio.
“Show View” dialog will open
Select [Code Generator], [Peripheral Functions] and click [OK].
[Peripheral Functions] view will be displayed.
Select [Clock Output/Buzzer Output] from the Peripheral Functions view menu.
Select PCLBUZ0 tab when using PCLBUZ0 and PCLBUZ1 tab when using PCLBUZ1, set “Clock Output/Buzzer Output operation setting” to “Used”, and click [Generate Code] button.
Message indicating generation of file was successful will be indicated on the console.
Double click and open “src/r_main.c” in the project explorer.
Peripheral functions enabled in generating the code must be re-defined as peripheral functions in “r_main.c”.
In case PCLBUZ0 and PCLBUZ1 are both enabled in the generation of the code, add the following to the “start_function” function. In case one of them has been enabled, then only add the code of the one that has been enabled.
R_PCLBUZ0_Start();
R_PCLBUZ1_Start();
Right click [RL78G13_CG_Sample_e2s] in the project explorer to display the menu and select [Build Project].
Select [RL78G13_CG_Sample_e2s SimulatorDebug] from the project explorer, right click the mouse to display the menu, then select [Debug As], [Debug Configurations..].
Select [RL78G13_CG_Sample_e2s SimulatorDebug] in [Renesas Simulator Debugging (RX,RL78)] of the debug configuration dialog. Click [Debug] button to start debug.
Perspective Switch confirmation dialog will open. Click [Yes].
To re-connect to debugger, select the applicable debugger from the [Debug] tool bar pull-down menu.
Simulator GUI will boot simultaneously when the debugger is booted.
Select [Timing Chart] from the [Simulator] menu of the simulator GUI. The Timing Chart window will be displayed.
Select [Select Pin] from the [Edit] menu and register “P140/PCLBUZ0/INTP6” and “P141/PCLBUZ1/INTP7” as the pin names in the “Select Pin” dialog.
Select [Resume] from the [Run] menu to run the program.
It is set to stop at the head of the main ( ) function. Run the program by clicking on [Resume] from the [Run] menu.
Pressing down the Resume icon on the tool bar will result in the same action.
Waveform will be displayed in the Timing Chart Window when the program is resumed.
Select [End[ or [Disconnect] from the [Run] menu.
Select [End] from the [File] menu.