Usage example
Detect the falling of the supply voltage by Interrupt & reset mode, and perform arbitrary processing in interrupt function.
[GUI setting example]
Voltage detector |
||||
LVD |
Used | |||
Low voltage detector operation setting |
Used | |||
Operation mode setting |
Interrupt & reset mode | |||
INTLVI Priority |
Low | |||
Reset generation level (VLVDL) |
2.75(V) | |||
Interrupt generation level (VLVDH) |
3.15(V) |
[API setting example]
r_main.c
void main(void)
{
R_MAIN_UserInit();
/* Start user code. Do not edit comment generated here */
/* Enable the voltage detector interrupt */
R_LVD_InterruptMode_Start();
while (1U)
{
;
}
/* End user code. Do not edit comment generated here */
}
r_cg_lvd_user.c
static void __near r_lvd_interrupt(void)
{
/* Start user code. Do not edit comment generated here */
/*** Processing to be performed before the reset ***/
/* End user code. Do not edit comment generated here */
}