Debug & programmer - E2 emulator
Debug & programmer - E2 emulator lite for RL78
IDE – CS+ , suggest for automotive product




Integrated Development Environment User's Manual: RL78 Debug Tool
back to top


Compiler – C Compiler Package for RL78 Family [CC-RL]
*Base on selected IDE , install the related compiler ( RL78 Compiler CC-RL for CS+ or for e² studio)






IDE plug in – Smart Configurator
*Base on selected IDE , install the related Smart Configurator

Renesas Flash Programmer (Programming GUI)




Integrated Development Environment User's Manual: Project Operation
back to top



RL78 Smart Configurator User's Guide: CS+
Smart Configurator User's Manual: RL78 API Reference
back to top


Integrated Development Environment User's Manual: RL78 Debug Tool
back to top


Integrated Development Environment User's Manual: RL78 Debug Tool
back to top

RL78 Smart Configurator User's Guide: CS+
back to top




RL78 Smart Configurator User's Guide: CS+
back to top



RL78 Smart Configurator User's Guide: CS+
back to top


RL78 Smart Configurator User's Guide: CS+
back to top



RL78 Smart Configurator User's Guide: CS+
back to top


RL78 Smart Configurator User's Guide: CS+
back to top


RL78 Smart Configurator User's Guide: CS+
back to top



RL78 Smart Configurator User's Guide: CS+
back to top


RL78 Smart Configurator User's Guide: CS+
back to top





RL78 Smart Configurator User's Guide: CS+
back to top
BSP_EI();
while(1)
{
}
Need to manual add driver start API , ex : R_Config_TAU0_0_Start();

RL78 Smart Configurator User's Guide: CS+
back to top
#include "r_smc_entry.h"
#include "platform.h"


RL78 Smart Configurator User's Guide: CS+
back to top



r_Config_TAU0_0_interrupt()


RL78 Smart Configurator User's Guide: CS+
back to top


RL78 Smart Configurator User's Guide: CS+
back to top

nop delay : wait delay , 1.0562ms
for (i = 0; i < 2000; i++)
{
__nop();
}
timer delay : timer delay , 1.007ms @ clock src 2500KHz , fCLK/2^4 , 1ms

example 1:
R_Config_TAU0_0_Start();
while(!(TCR00 == 0));
R_Config_TAU0_0_Stop();

example 2:
unsigned long tick_count = 0;
tick_count = 1;
R_Config_TAU0_0_Start();
while ((tick_count))
{
if (TMIF00 == 1)
{
TMIF00 = 0;
R_Config_TAU0_0_Stop();
if (--tick_count)
{
R_Config_TAU0_0_Start();
}
}
}

RL78 Smart Configurator User's Guide: CS+
back to top


RL78 Smart Configurator User's Guide: CS+
back to top



RL78 Smart Configurator User's Guide: CS+
back to top


RL78 Smart Configurator User's Guide: CS+
back to top



RL78 Smart Configurator User's Guide: CS+
back to top

RL78 Smart Configurator User's Guide: CS+
back to top
example
P7_bit.no3 = ~P7_bit.no3;
P7_bit.no3 ^= 1;
P7_bit.no3 = 1;
P7_bit.no3 = 0;
/*
b7 b6 b5 b4 b3 b2 b1 b0
0 0 0 0 1 0 0 0
*/
#define P73_PIN (0x08U)
P7 ^= P73_PIN; //toggle
P7 &= ~P73_PIN; //on
P7 |= P73_PIN; //off



RL78 Smart Configurator User's Guide: CS+
back to top


RL78 Smart Configurator User's Guide: CS+
back to top


RL78 Smart Configurator User's Guide: CS+
back to top

RL78 Smart Configurator User's Guide: CS+
back to top



R_Config_INTC_INTP2_Start();

RL78 Smart Configurator User's Guide: CS+
back to top



RL78 Smart Configurator User's Guide: CS+
back to top

RL78 Smart Configurator User's Guide: CS+
back to top

RL78 Smart Configurator User's Guide: CS+
back to top



R_Config_IIC00_Master_Send(…,reg,...)
R_Config_IIC00_Master_Receive(…,data,...)
Write function example :R_Config_IIC00_Master_Send(…,data,...)
RL78 Smart Configurator User's Guide: CS+
back to top


RL78 Smart Configurator User's Guide: CS+
back to top

RL78 Smart Configurator User's Guide: CS+
back to top



R_Config_IICA0_Master_Send(…,reg,...)
R_Config_IICA0_Master_Receive(…,data,...)
Write function example :R_Config_IICA0_Master_Send(…,data,...)
RL78 Smart Configurator User's Guide: CS+
back to top


RL78 Smart Configurator User's Guide: CS+
back to top

RL78 Smart Configurator User's Guide: CS+
back to top

RL78 Smart Configurator User's Guide: CS+
back to top

RL78 Smart Configurator User's Guide: CS+
back to top


| CPOL | CPHA | mode | Type |
|---|---|---|---|
| 1 | 1 | 3 | 1 |
| 0 | 1 | 1 | 2 |
| 1 | 0 | 2 | 3 |
| 0 | 0 | 0 | 4 |
RL78 Smart Configurator User's Guide: CS+
back to top



R_Config_CSI01_Start();

RL78 Smart Configurator User's Guide: CS+
back to top


RL78 Smart Configurator User's Guide: CS+
back to top

RL78 Smart Configurator User's Guide: CS+
back to top



R_Config_UART1_Start();

RL78 Smart Configurator User's Guide: CS+
back to top

STMK0 = 1U; /* disable INTST0 interrupt */
SDR00L = (unsigned char)c;
while(STIF0 == 0)
{
}
STIF0 = 0U; /* clear INTST0 interrupt flag */
RL78 Smart Configurator User's Guide: CS+
back to top
uart1 tx
void UART1_SendByte(int c)
{
STMK1 = 1U; /* disable interrupt */
SDR10L = (unsigned char)c;
// STIF1 = 0U; /* clear interrupt flag */
while(STIF1 == 0)
{
}
STIF1 = 0U; /* clear interrupt flag */
}
void UART1_sendString(unsigned char* str)
{
while (*str)
{
UART1_SendByte(*str++);
}
}
uart1 rx
int UART1_Get(void)
{
unsigned char c = 0;
while (SRIF1 == 0);
SRIF1 = 0;
c = SDR11L;
return c;
}
// 115200 : 1 bytes (10bit) = 0.08ms
// set timer interval delay , clock src 2500KHz , fCLK/2^4 , 1ms
int boot_UART1_Get_withTimeOut(unsigned long timeout, unsigned char *data)
{
unsigned long tick_count;
tick_count = timeout;
R_Config_TAU0_0_Start();
/* wait for a byte to arrive */
while ((SRIF1 == 0) && (tick_count))
{
if (TMIF00 == 1)
{
TMIF00 = 0;
R_Config_TAU0_0_Stop();
if (--tick_count)
{
R_Config_TAU0_0_Start();
}
}
}
if (tick_count == 0)
{
*data = '0';
return FALSE;
}
*data=(uint8_t) SDR11L;
SRIF1 = 0;
return TRUE;
}
RL78 Smart Configurator User's Guide: CS+
back to top


RL78 Smart Configurator User's Guide: CS+
back to top


RL78 Smart Configurator User's Guide: CS+
back to top



RL78 Smart Configurator User's Guide: CS+
back to top


MCU clock src : 40M ,
clock div : 40M / 2^6 = 625K Hz ,
target freq : 100Hz = 10000 us


period : 1/100 (which is 10000us) = (val_m + 1 ) * (1/ 625K)
=> val_m : 625K/100 – 1 = 6250 – 1 = 6249 (0x1869)
duty(%) = val_s / (val_m + 1) *100 , 50/100 = val_s/(val_m + 1)
=> val_s = (1/2)*6250 = 3125 (0xC35)
duty(%) = val_s / (val_m + 1) *100 , 75/100 = val_s/(val_m + 1)
=> val_s = (3/4)*6250 = 4687.5 (0x1250)
RL78 Smart Configurator User's Guide: CS+
back to top


R_Config_TAU0_2_Start();

RL78 Smart Configurator User's Guide: CS+
back to top


RL78 Smart Configurator User's Guide: CS+
back to top

RL78 Smart Configurator User's Guide: CS+
back to top

RL78 Smart Configurator User's Guide: CS+
back to top




example :
static void __near r_Config_S12AD0_interrupt(void)
{
/* Start user code for r_Config_S12AD0_interrupt. Do not edit comment generated here */
ADC_Process_in_IRQ();
/* End user code. Do not edit comment generated here */
}
void ADC_Process_in_IRQ(void)
{
FLAG_PROJ_TRIG_ADC_CH = 1;
}
void GetADC(unsigned char ch)
{
unsigned short tmp_buffer = 0;
FLAG_PROJ_TRIG_ADC_CH = 0;
R_Config_S12AD0_Start();
while(!FLAG_PROJ_TRIG_ADC_CH);
R_Config_S12AD0_Get_ValueResult((e_ad_channel_t) ch,&tmp_buffer);
R_Config_S12AD0_Stop();
FLAG_PROJ_TRIG_ADC_CH = 0;
adc_buffer[ch] = tmp_buffer;
}

RL78 Smart Configurator User's Guide: CS+
back to top

.\
.

RL78 Smart Configurator User's Guide: CS+
back to top
BSP_EI();
Need to manual add main loop , ex : while(1)
{
}

RL78 Smart Configurator User's Guide: CS+
back to top

RL78 Smart Configurator User's Guide: CS+
back to top

download program after rebuild

debug function





Integrated Development Environment User's Manual: RL78 Debug Tool
back to top




Renesas Flash Programmer V*.** Flash memory programming softwareUser's Manual
back to top





variable place address (SRAM)

function place address (FLASH)

section size display in map file


Display section message






| item | note |
|---|---|
| data | variables with initial value |
| bss | variables with no initial value |
| text | program code |
| const | constant data |

Code assignment example

CC-RL Compiler User's Manual
back to top

| item | note |
|---|---|
| data | variables with initial value |
| bss | variables with no initial value |
| text | program code |
| const | constant data |

Code assignment example

CC-RL Compiler User's Manual
back to top

| item | note |
|---|---|
| data | variables with initial value |
| bss | variables with no initial value |
| text | program code |
| const | constant data |

Code assignment example

CC-RL Compiler User's Manual
back to top

Code assignment example

check the address in map file

CC-RL Compiler User's Manual
back to top

Code assignment example

check the address in map file

CC-RL Compiler User's Manual
back to top

CC-RL Compiler User's Manual
back to top

Project split example , modify the projec name



Add the macro define for extra project

CC-RL Compiler User's Manual
back to top

how to fix


CC-RL Compiler User's Manual
back to top
when entry debug mode , unable to set break point


Link Options > Output debug Information
turn on output debug mode information
Common Options > Output File Type and Path
enable Execute Module (Load Module File)
will be able to set break point after entry debug mode

CC-RL Compiler User's Manual
back to top