Simple LED blink program on RL78/F14?

I am quite new to microcontrollers and would like some help getting started with RL78/F14.

I would like to know how to write a program to make an LED blink.

  • Use peripheral code generator in e2 studio or stand-alone Applilet.

    Create a timer interval with timer interrupt

    Switch the port connected to the LED to output

    Push "Generate code".

    In r_systeminit() the timer and the port will be initialized.
    The file r_cg_timer_user.c holds the timer interrupt routine. Here you have to add the code to toggle the LED port.
         P0 =~ _01_Pn0_OUTPUT_1;

    Start timer by calling R_TAU0_Channel0_Start() in main().

  • In reply to FrankL:

    Thank you Frank for your reply.

    So I tried out your solution . I am trying to use pin P90 to blink the LED (RL78/F14, 64 pins).

    However, I am getting "undefined" error when I put the value "P9 =~ _01_Pn0_OUTPUT_1;"

  • In reply to abhay:

    You forgot to add the header "#include r_cg_port.h"" in the file where you toggle the output?

  • In reply to FrankL:


    I too test RL78 (R5F100LG) and try LED blinking

    It's right?

    void main(void)
    /* Start user code. Do not edit comment generated here */
    while (1U)
    /* End user code. Do not edit comment generated here */

     And what means chekbox "1" at the end in tab Port's?

    Thank You!

  • In reply to FrankL:

    Someone told me that my pin selection is wrong pin 57 (P90 function) in RL78/F14, 64-pins (R5F10PLJ), has no timer function, So I should be using Pin 34 or some other pin with timer input.

    I am using CS+ IDE but can't seem to make the board work for some reason.

    Hardware Manual: 

  • In reply to FrankL:

    Update: So I got the LED to light up, using pin 34.
    Will update later if I could use the timer function or not
  • Abhay can you please share how you used the INTTM0 interrupt to toggle the LED. I f possible please share the program.
  • In reply to FrankL:

    Update 2: Got the board to work this week. The problem was that I didn't know how to operate the CS+ IDE properly.
  • In reply to abhay:


    I am glad to hear that you resolved your issue!

    Mike Clements
    RenesasRulz Moderator
  • In reply to abhay:

    Could you share the code which you have used to flash the LED Blinking
  • In reply to Goko:

    Please have a look at the RSKRL78G13 sample code.