How to set RL78 MCU LVD (voltage detector) function with code generator in e2 studio

Hi Dears,

MCU: R5F10WLFAFB#30

We have tried to setting RL78 MCU, LVD (voltage detector) with reset and/or interrupt mode).

But even if we use the code generator to set it up as below, it seems no change on the whole driver or code, so we wonder if this function in e2 studio is worked or not.

Or if you can tell use how to set or check the LVD regiser is shown in the some .c file or .h files? 

and here is our e2 studio version and installed packs

Thank you.

  • Hello,

    The registers of LVD are LVIM and LVIS.

    But the voltage levels of LVD are controlled by Option Byte at 0x00C1:

    So by changing the voltage level on Code Generation, you basically change the option byte that will be loaded when you download your program on the device.

    Regards

  • Hi AZ_Renesas,

    Thank you for your commets.

    We know this funciton is set by Option Byte at 0x00C1

    We tried to use the code generation tool again, has found that 

    Q1.

    When applying "Reset" mode only, the code did not change anaything - even new .c .h are new generated.

    but once applying "interrupt & Reset" mode, the code generator does add the some .c and .h files additionally.

    So, we wonder if only "Reset" mode can be used.

    Also we can not find related setting in "iodefine.h"

    Q2.

    Based on Q1, should we need to define option byte "C1H" register and set the value manually for reset mode LVD? 

    Regards,

    Yu

  • 1) Yes, reset mode can be used. If you check LVIMDS1 and LVIMDS0 bits of option byte you will see different values when you change between reset mode, interrupt mode, interrupt and reset mode.

    In reset mode you do not see any .c and .h files because these files only handle the interrupt of LVD, not the general function of LVD. If only reset is selected there is no reason for these files to exist.

    2) You do not need to do anything manually. Just select reset mode, download the program and check the values of option byte. You should see LVIMDS1 =1 and LVIMDS0 = 1.