Download Print this page
Renesas RL78/G23 Manual

Renesas RL78/G23 Manual

Elcl multiple parameter monitoring function
Hide thumbs Also See for RL78/G23:

Advertisement

Quick Links

RL78/G23
ELCL Multiple Parameter Monitoring Function
Introduction
This application note describes how to monitor multiple input signals (parameters) using the logic and event
link controller (ELCL). By using ELCL, it is possible to reduce the resources (external parts, ROM, RAM, etc.)
because the functions realized by external parts or software can be realized by hardware.
Target Device
RL78/G23
When applying the sample program covered in this application note to another microcomputer, modify the
program according to the specifications for the target microcomputer and conduct an extensive evaluation of
the modified program.
R01AN5615EJ0200 Rev.2.00
Mar.24.22
Application Note
Page 1 of 42

Advertisement

loading

Summary of Contents for Renesas RL78/G23

  • Page 1 Application Note RL78/G23 ELCL Multiple Parameter Monitoring Function Introduction This application note describes how to monitor multiple input signals (parameters) using the logic and event link controller (ELCL). By using ELCL, it is possible to reduce the resources (external parts, ROM, RAM, etc.) because the functions realized by external parts or software can be realized by hardware.
  • Page 2 RL78/G23 ELCL Multiple Parameter Monitoring Function Contents Specifications .......................... 4 Conditions for Operation Confirmation Test ................6 Hardware ..........................7 Example of Hardware Configuration ....................... 7 Used Pins ..............................7 Software ..........................8 Overview of the sample program ......................8 Folder Configuration ..........................
  • Page 3 RL78/G23 ELCL Multiple Parameter Monitoring Function 5.3.2 Example of using four ports with no external interrupt function as interrupts ........37 5.3.3 How to Make Inputs Negative Logic ....................38 Sample Code ......................... 39 Reference ..........................39 Revision History ..........................40 R01AN5615EJ0200 Rev.2.00...
  • Page 4 RL78/G23 ELCL Multiple Parameter Monitoring Function 1. Specifications This application note describes an example of linking an output signal generated by ORing four input signals using ELCL to a specific peripheral function. Figure 1-1 shows the ELCL configuration and Figure 1-2 shows the timing chart.
  • Page 5 RL78/G23 ELCL Multiple Parameter Monitoring Function Figure 1-2 Timing chart INPUT A INPUT B INPUT C INPUT D ELOMONI3 ELOMONI4 ELOMONI5 ELOMONI6 OUTPUT E R01AN5615EJ0200 Rev.2.00 Page 5 of 42 Mar.24.22...
  • Page 6 ) : Reset mode LVD0 Rising edge TYP.1.90V Falling edge TYP.1.86V Integrated development environment (CS+) CS+ for CC V8.07.00 from Renesas Electronics Corp. C compiler (CS+) CC-RL V1.11 from Renesas Electronics Corp. Integrated development environment studio 2022-01 (22.01.0) from Renesas Electronics Corp.
  • Page 7 RL78/G23 ELCL Multiple Parameter Monitoring Function 3. Hardware 3.1 Example of Hardware Configuration Figure 3-1 shows an example of the hardware configuration in this application. Figure 3-1 Hardware Configuration RESET P137 RL78/G23 LED1 REGC P40/TOOL0 P11/TOOLRxD PC(via USB) P12/TOOLTxD Caution 1. This simplified circuit diagram was created to show an overview of connections only. When actually designing your circuit, make sure the design includes sufficient pin processing and meets electrical characteristic requirements.
  • Page 8 RL78/G23 ELCL Multiple Parameter Monitoring Function 4. Software 4.1 Overview of the sample program In this sample code, four timer (TAU0 channel 0, TAU0 channel 1, TAU0 channel 2 and TAU0 channel 3) are operated in interval timer mode. ELCL ORs the four timer completion interrupt (INTTM00, INTTM01, INTTM02 and INTTM03) as input signals and outputs the result as INTELCL.
  • Page 9 RL78/G23 ELCL Multiple Parameter Monitoring Function Figure 4-1 Operation overview Reset release g_timer_mode = 0 The LED1 OFF ALL TAUmn STOP (10) SW1 ON SW1 ON g_timer_mode = 4 g_timer_mode = 1 The LED1 is blinked at The LED1 is blinked at...
  • Page 10 RL78/G23 ELCL Multiple Parameter Monitoring Function Figure 4-3 shows the system configuration of the sample code. Select INTTM00, INTTM01, INTTM02 and INTTM03 as the ELCL input signal and INTELCL as the ELCL output signal. Figure 4-3 System configuration of the sample code...
  • Page 11 RL78/G23 ELCL Multiple Parameter Monitoring Function 4.2 Folder Configuration Table 4-2 shows folder configuration of source file and header files using by sample code except the files generated by integrated development environment and the files in the bsp environment. Table 4-2 Folder configuration (1/2)
  • Page 12 RL78/G23 ELCL Multiple Parameter Monitoring Function Table 4-3 Folder configuration (2/2) Folder/File configuration Outline Created by Smart configurator Note 3 ¥r01an5615_elcl_parameter<DIR> Root folder of this sample code ¥src<DIR> Folder for program source √ ¥smc_gen<DIR> Folder created by Smart Configurator √...
  • Page 13 RL78/G23 ELCL Multiple Parameter Monitoring Function 4.5 Variables Table 4-6 shows the global variables used in this sample code. Table 4-6 Global variables used in the sample code Type Variable name contents Functions used in volatile uint16_t g_ms_timer Count value of the wait process...
  • Page 14 RL78/G23 ELCL Multiple Parameter Monitoring Function 4.7 Function Specifications This part describes function specifications of the sample code. [Function name] main Main process Outline Header r_smc_entry.h, support_functions.h Declaration void main (void); Description This function initializes ELCL, sets ELCL output, and sets interrupts.
  • Page 15 RL78/G23 ELCL Multiple Parameter Monitoring Function [Function name] r_Config_INTC_intp0_interrupt INTP0 interrupt process Outline r_cg_macrodriver.h, r_cg_userdefine.h, Config_INTC.h, Config_TAU0_7.h Header #pragma interrupt r_Config_INTC_intp0_interrupt (vect=INTP0) Declaration Sets g_timer_mode to indicate the state of the timer. Description Sets the INTP0 interrupt generation flag g_timer_flag to 1.
  • Page 16 RL78/G23 ELCL Multiple Parameter Monitoring Function 4.8 Flow Charts 4.8.1 Main Process Figure 4-4 shows flowchart of main process. Figure 4-4 Main process main() Initialization of ELCL R_Config_MultipleParamete rMonitoring_Start() INTP0 Start Wait for SW1 (INTP0) to be R_Config_INTC_INTP0_Sta pressed rt()
  • Page 17 RL78/G23 ELCL Multiple Parameter Monitoring Function 4.8.2 Channel change process for TAU0 Figure 4-5 shows flowchart of the channel change process for TAU0. Figure 4-5 Channel change process for TAU0 (1/2) r_timer_update() LED1 = OFF STOP & Reset TAU0 R_TAU0_Set_PowreOff()
  • Page 18 RL78/G23 ELCL Multiple Parameter Monitoring Function Figure 4-6 Channel change process for TAU0 (2/2) g_timer_mode = 3 g_timer_mode = 4 Initialization of TAU00 Initialization of TAU00 R_Config_TAU0_0_Create R_Config_TAU0_0_Create Initialization of TAU01 Initialization of TAU01 R_Config_TAU0_1_Create R_Config_TAU0_1_Create Initialization of TAU02 Initialization of TAU02...
  • Page 19 RL78/G23 ELCL Multiple Parameter Monitoring Function 4.8.4 ELCL interrupt process Figure 4-8 shows flowchart of ELCL interrupt process. Figure 4-8 ELCL interrupt process r_Config_MultipleParameterM onitoring_interrupt() g_led_flag = 1 return 4.8.5 ELCL flip-flop reset process Figure 4-9 shows flowchart of ELCL flip-flop reset process.
  • Page 20 RL78/G23 ELCL Multiple Parameter Monitoring Function 4.8.6 INTP0 interrupt process Figure 4-10, shows flowchart of INTP0 interrupt process. Figure 4-10 INTP0 interrupt process r_Config_INTC_intp0_interrupt() 5 == (++g_timer_mode) g_timer_mode = 0 g_timer_flag = 1 Enable interrupt EI() Wait r_ms_delay(CHATTA_WAIT) PIF0 = 0 return R01AN5615EJ0200 Rev.2.00...
  • Page 21 RL78/G23 ELCL Multiple Parameter Monitoring Function 4.8.7 Wait process Figure 4-11 shows flowchart of Wait process. Figure 4-11 Wait process r_ms_delay() g_ms_timer = 0 Initialization of TAU07 R_Config_TAU0_7_Create TAU07 Start TS07 = 1 R_Config_TAU0_7_Start() g_ms_timer < CHATTA_WAIT TAU07 Stop TT07 = 1...
  • Page 22 RL78/G23 ELCL Multiple Parameter Monitoring Function 5. Application example In addition to the sample code, this application note contains the following Smart Configurator configuration files r01an5615_elcl_parameter.scfg The following is a description of the file and examples of settings and notes for use.
  • Page 23 ELCL Multiple Parameter Monitoring Function Select "Multiple Parameter Monitoring Function" and download it. Please download the common setting file "RL78/G23 Common ELCL Module" as well. Figure 5-2 Download the module After the download is complete, make sure that " ELCL multiple parameter monitoring" is available for selection.
  • Page 24 RL78/G23 ELCL Multiple Parameter Monitoring Function 5.2 r01an5615_elcl_parameter.scfg This is the Smart Configurator configuration file used in the sample code. It contains all the features configured in the Smart Configurator. The sample code settings are as follows. Table 5-1 Parameters of Smart Configurator (1/2)
  • Page 25 RL78/G23 ELCL Multiple Parameter Monitoring Function Table 5-2 Parameters of Smart Configurator (2/2) Tag name Component Contents Components Config_TAU0_0 Components: Interval timer Operating mode: 16 bit count mode Resource: TAU0_0 Operation clock: CK00 Clock source: f Interval value: 8000 count...
  • Page 26 RL78/G23 ELCL Multiple Parameter Monitoring Function 5.2.1 Clocks Set the clock used in the sample code. 5.2.2 System Set the on-chip debug of the sample code. "Control of on-chip debug operation" and "Security ID authentication failure setting" affect "On-chip debugging is enabled" in "Table 4-4 Option Byte Settings". Note that changing the settings.
  • Page 27 RL78/G23 ELCL Multiple Parameter Monitoring Function 5.2.8 Config_MultipleParameterMonitoring Initialize the ELCL in the sample code. In the sample code, INTTM00, INTTM01, INTTM02, and INTTM03 are selected for input, and INTELCL is selected for output. See Section 5.3 Component “ELCL multiple parameter monitoring” for details.
  • Page 28 RL78/G23 ELCL Multiple Parameter Monitoring Function 5.3 Component “ELCL multiple parameter monitoring” Figure 5-4 shows the component “ELCL multiple parameter monitoring” and Table 5-3 shows the options for this component. Figure 5-4 Component "ELCL multiple parameter monitoring" Checkbox Output E Table 5-3 Choices of component "ELCL multiple parameter monitoring"...
  • Page 29 RL78/G23 ELCL Multiple Parameter Monitoring Function Table 5-4 Choices of input parameter (ELISEL 0 - 11) Suitable ELISELn register Input parameter ELISEL 0 - 11 SAU0 Channel0 Data Output SAU0 Channel1 Data Output SAU0 Channel0 Communication Clock Output SAU0 Channel1 Communication Clock Output...
  • Page 30 RL78/G23 ELCL Multiple Parameter Monitoring Function Table 5-5 Choices of input parameter (ELISEL 0 - 5) Suitable ELISELn register Input parameter ELISEL0 P120 INTP6 INTURE0/INTTM10 INTTM16 INTUT1 ELISEL1 P121 INTP7 INTURE1/INTTM11 INTTM17 INTUR1 ELISEL2 P122 INTP8 INTTM12 INTST3/INTCSI30INTIIC30 INTIICA1 ELISEL3...
  • Page 31 RL78/G23 ELCL Multiple Parameter Monitoring Function Table 5-6 Choices of input parameter (ELISEL 6 - 11) Suitable ELISELn register Input parameter ELISEL6 INTP0 INTTM00 INTTM06 INTST2/INTCSI20/INTIIC20 INTSR1/INTCSI11/INTIIC11 INTSMSE ELISEL7 INTP1 INTTM01 INTITL INTSR2/INTCSI21/INTIIC21 INTSRE1/INTTM03H INTP10/INTCMP0 ELISEL8 INTP2 INTTM02 INTWDTI INTSRE2/INTM11H...
  • Page 32 RL78/G23 ELCL Multiple Parameter Monitoring Function 5.3.1 Setting the ELCL Register Table 5-7 to show Table 5-11 the initial settings of the ELCL register, and Figure 5-5 to Figure 5-9 show the ELCL configuration at that time. Refer to Figure 4-3 for the overall ELCL configuration.
  • Page 33 RL78/G23 ELCL Multiple Parameter Monitoring Function Table 5-8 ELCL register settings (Logic cell block L1) Register Register Name Setting Description Symbol ELL1SEL0 Event link L1 signal select Select the signal selected by ELISEL6 as the link register 0 target of L1...
  • Page 34 RL78/G23 ELCL Multiple Parameter Monitoring Function Table 5-9 ELCL register settings (Logic cell block L2) Register Register Name Setting Description Symbol ELL2SEL0 Event link L2 signal select Select the signal selected by ELISEL6 as the link register 0 target of L2...
  • Page 35 RL78/G23 ELCL Multiple Parameter Monitoring Function Table 5-10 ELCL register settings (Logic cell block L3) Register Register Name Setting Description Symbol ELL3SEL0 Event link L3 signal select Select the signal selected by ELISEL7 as the link register 0 target of L3...
  • Page 36 RL78/G23 ELCL Multiple Parameter Monitoring Function Table 5-11 ELCL register settings (Outputs) Register Register Name Setting Description Symbol ELOSEL0 Output signal select register Select the output signal [0] from logic cell block ELOSEL3 Output signal select register Select the output signal [3] from logic cell block...
  • Page 37 RL78/G23 ELCL Multiple Parameter Monitoring Function 5.3.2 Example of using four ports with no external interrupt function as interrupts The four ports that do not have external interrupt functions can be used as interrupts (INTELCL). Figure 5-10 shows an example configuration.
  • Page 38 RL78/G23 ELCL Multiple Parameter Monitoring Function 5.3.3 How to Make Inputs Negative Logic The component "ELCL multiple parameter monitoring" ORs four inputs with positive logic. The following sample code shows how to change the input to negative logic. Change the yellow part of the code output by the smart configurator as follows. When the program is automatically generated by the Smart Configurator again, it will be overwritten with the output value of the Smart Configurator (before the change).
  • Page 39 RL78 Smart Configurator User’s Guide : e studio (R20AN0579E) RL78 Smart Configurator User’s Guide : IAREW (R20AN0581E) (The latest version can be downloaded from the Renesas Electronics website.) Technical Update / Technical News (The latest version can be downloaded from the Renesas Electronics website.) All trademarks and registered trademarks are the property of their respective owners.
  • Page 40 RL78/G23 ELCL Multiple Parameter Monitoring Function Revision History Description Rev. Date Page Summary ‐ 1.00 Apr.13.21 First edition 2.00 Mar.24.22 Table 2-1 Operation Confirmation Conditions Operating voltage Rising edge TYP.1.875V -> 1.90V Falling edge TYP.1.835V -> 1.86V Updated tool version Table 2-1 Operation Confirmation Conditions Integrated development environment (CS+) : E8.05.00f ->...
  • Page 41 RL78/G23 ELCL Multiple Parameter Monitoring Function Description Rev. Date Page Summary 2.00 Mar.24.22 16-23, Updated some figures as follows due to the component "ELCL multiple parameter monitoring" update Figure 4-4 Main process Function name: R_Config_MultipleParameterMonitoring_Create () -> R_Config_ MultipleParameterMonitoring_Start () ELCLIF = 0 ELCLMK = 0 ->...
  • Page 42 RL78/G23 ELCL Multiple Parameter Monitoring Function Description Rev. Date Page Summary 2.00 Mar.24.22 Updated the contents in Table 5-3 with the component "ELCL multiple parameter monitoring” update. Table 5-3 Choices of component "ELCL multiple parameter monitoring" Item Added Checkbox Choices...
  • Page 43 Unit Products The following usage notes are applicable to all Microprocessing unit and Microcontroller unit products from Renesas. For detailed usage notes on the products covered by this document, refer to the relevant sections of the document as well as any technical updates that have been issued for the products.
  • Page 44 Renesas Electronics disclaims any and all liability for any damages or losses incurred by you or any third parties arising from the use of any Renesas Electronics product that is inconsistent with any Renesas Electronics data sheet, user’s manual or other Renesas Electronics document.