IWDT HAL Module Guide

Similar documents
SEGGER J-Link Lite for Renesas Synergy TM

1. Uses of Breakpoints... 2

PK-S5D9 v1.0 Out-of-Box Demonstration Programming Guidelines

Getting Started Guide for Heartbeat Kit

Thread Monitor Framework Module Guide

Getting Started Guide for LED Toggle Kit

1. RTC HAL Module Features RTC APIs Overview RTC HAL Module Operational Overview... 3

I²C Slave HAL Module Guide

Key Matrix HAL Module Guide

Customizing a SSP Module

1. DTC HAL Module Features DTC HAL Module APIs Overview DTC HAL Module Operational Overview... 3

External IRQ HAL Module Guide

Getting Started with NetX Duo Web Server

Introduction to Renesas Synergy SSP v.1.2.0

I/O Port HAL Module Guide

Simple Audio Playback Example for DK-S124

1. Overview Board Specifications S3 Series Board System... 3

Renesas Flash Programmer V

USBX Mass Storage Class (Device)

e² studio Pin Configurator Usage

Out-of-Box Demonstration for S1/S3/S5 Target Boards

1. CAC HAL Module Features CAC HAL Module APIs Overview CAC HAL Module Operational Overview... 4

R-IN, RZ/T1, TPS-1 Groups

JPEG Decode Framework Module Guide

Block Media RAM Framework Module Guide

IAR Embedded Workbench for Renesas Synergy v8.21.1

Migrating Existing e 2 studio Projects to IAR Embedded Workbench for Renesas Synergy

Renesas Synergy Project Import Guide

1. Overview Hardware Hardware Configuration Clock Settings Pin Settings... 6

Synergy Standalone Configurator (SSC) v Release Note. Renesas Synergy Platform Synergy Tools & Kits. Release Note

USBX CDC ACM (Device) for Target Boards

Debugging Your Application with IAR C-SPY

ADC Periodic Framework Module Guide

1. Kit Contents Features Device Components Programming to the SK-S7G2 Starter Kit... 15

RL78 Family Flash Self-Programming Library Type01 Ver.2.21 for the CC-RL compiler

USER S MANUAL. Features. Evaluation System Contents. JESD204B High Speed ADC. Evaluation Kit. AN1809 Rev 0.00 Dec 5, 2012

USER S MANUAL ISL55110_11EVAL1Z, ISL55110_11EVAL2Z. Before Getting Started. BNC Connections. Scope Probe Connections. Power Down Feature

Target Board S5D5 (TB-S5D5)

1. Installation Creating the Project Workspace Opening Sample Code and Source Files Source Code Functionality...

Thread Monitor Framework Module Guide

APPLICATION NOTE. Introduction. Copying the SPICE Netlist. Model Editor. From SPICE Netlist to Allegro Design Sub-Circuit. AN1613 Rev.0.

1. Overview TPS-1 GUI Configuration Tool Procedure of configure TPS Error Code... 9

Capacitive Touch Button Framework Module Guide

1. Opening the sample code workspace Loading the selected sample code project Opening Sample Code and Source Files...

1. GPT HAL Module Features GPT HAL Module APIs Overview GPT HAL Module Operational Overview... 3

AP4 for RH850 V

Capacitive Touch Slider Framework Module Guide

USER S MANUAL ISL2800XEVAL1Z. Introduction. Reference Documents. Evaluation Board Schematic. Power Supplies. Optional Transient Protection

APPLICATION NOTE. Basic SPI Bus Information. Bus Configuration and SPI Protocol of Multiple DCPs. SPI Protocol and Bus Configuration of Multiple DCPs

USBX TM Host Class Mass Storage Module Guide

1. Installation Creating the Project Workspace Opening Sample Code and Source Files Source Code Functionality...

R-IN32M3-EC, EC-1, RZ/T1

GUIX Studio v Release Note. Renesas Synergy Platform Synergy Software Express Logic GUIX Studio v

FIGURE 1. DIGITAL POT POWER TRENDS

USBX Device Class Mass Storage Module Guide

Using ADC to Wake Up the MCU from Low Power Modes

Bluetooth Low Energy on DK-S7G2 and DK S3A7

USBX Host Class Hub Module Guide

e² studio V7.0.1 Linux Host Public Beta for RZ

Target Board S1JA (TB-S1JA)

PG-FP6 Gang Programmer V1.00 User s Manual

1. Installation Creating the Project Workspace Adding Sample Code into DS Adding GNU Toolchain Support for DS-5...

1. Overview of RX DSP Library System Requirements for the Sample Project... 2

PB0 25 PB1 26 PB2 27 PB3 28 PB4 29 PB5 30 PB6 31 PB7 32 VCC PC0 9 PC1 10 PC2 11 PC3 12 PC4 13 PC5 14 PC6 15 PC7 16

QE for USB: A Dedicated Tool for USB

Renesas Starter Kit Sample Code for Cubesuite + Toolchain

USBX Device Class HID Module Guide

1. ADC HAL Module Features ADC HAL Module APIs Overview ADC HAL Module Operational Overview... 4

USER S MANUAL ISL54206AEVAL1Z. Picture of Evaluation Board (Top View) Description. Board Architecture/Layout. Features.

Synergy Software Package Pin Configurator Usage

Renesas Flash Programmer V

APPLICATION NOTE. Introduction. Scope. Hardware Connections. Serial Port Operation. The X24C44 NOVRAM Teams up with 8051 Microcontrollers

1. AGT HAL Module Features AGT HAL Module APIs Overview AGT HAL Module Operational Overview... 4

USER S MANUAL. Key Board Features. Description. References. Specifications. Ordering Information ISL91110IIN-EVZ, ISL91110II2A-EVZ, ISL91110IIA-EVZ

R20AN0311EJ0106 Rev.1.06 Interface conversion module for Ethernet Driver and Embedded system M3S-T4-Tiny Nov 30, 2016

1. Overview BACnet Demo Software Architecture Programming and Debugging Building Sample Project... 5

APPLICATION NOTE. 16-Bit Data Bus Operation. Summary of 16-Bit Data Bus Performance. 80C286/80386 Hardware Comparison. AN112 Rev 1.

Development Kit S124 (DK-S124)

Development Kit S128 (DK-S128)

Checking Analog Inputs in Sleep State in S3A7

Mutual Capacitive Touch Software Application Design with Synergy S124 and S3A7 MCUs

USER S MANUAL. Description. Evaluation Board. Board Architecture/Layout. Features

USER S MANUAL. Description. Key Features. References. Specifications. Ordering Information ISL9120IIA-EVZ. Evaluation Board User Guide

FileX Port Block Media Framework Module Guide

Tools used Renesas R32C/100 Standard Toolchain version (compiler, assembler, linker): E8a in-circuit debugger.

Audio Playback I2S Framework Module Guide

Introduction Serial Programing... 2 Write Cycle... 2 Read Cycle... 2 Shared Timing Requirements Write Timing Diagram...

RX Family APPLICATION NOTE. DNS client using the embedded TCP/IP M3S-T4-Tiny Module Firmware Integration Technology. Introduction.

USBX Host Class HID Module Guide

USER S MANUAL. ISL54059EVAL1Z Through ISL54064EVAL1Z. Description. Picture of Evaluation Board (Top View) Board Architecture/Layout.

Self-Capacitive Touch Software Application Design with Synergy S124 and S3A7 MCUs

NetX Telnet Client Module Guide

Capacitive Touch Slider Framework Module Guide

Old Company Name in Catalogs and Other Documents

Audio Record ADC Framework Module Guide

Renesas Synergy APPLICATION NOTE. Project Migration Guide: SSP v1.0.0 to SSP v Introduction. Goals and Objectives.

APPLICATION NOTE. Hardware Implementation. Power-On-Reset (POR) Software Implementation. Low Voltage Reset (LVR) Watchdog Timer

EX 6 XT 5 RESET 2 3 INT VCC FIGURE 1. TYPICAL HARDWARE CONNECTION FOR INTERFACING AN X24C44 TO A 6805 MICROCONTROLLER.

RL78/G11 APPLICATION NOTE. Demonstration Application. Introduction. Target Device. R01AN3918EG0100 Rev July 12, 2017

Old Company Name in Catalogs and Other Documents

Transcription:

Application Note Renesas Synergy Platform R11AN0214EU0101 Rev.1.01 Introduction This module guide will enable you to effectively use a module in your own design. Upon completion of this guide, you will be able to add this module to your own design, configure it correctly for the target application and write code, using the included application project code as a reference and efficient starting point. References to more detailed API descriptions and suggestions of other application projects that illustrate more advanced uses of the module are available in the Renesas Synergy Knowledge Base (as described in the References section at the end of this document), and should be valuable resources for creating more complex designs. The Independent Watchdog Timer (IWDT) HAL module is a high-level API for watchdog timer applications and is implemented on r_iwdt. The Watchdog Timer uses the IWDT peripheral on the Synergy MCU. A user can configure the timeout period, issue the stop control on sleep mode and standby mode, as well as adjust the window period and generation of events on a WDT underflow, or, on a refresh outside the permitted window. Contents 1. IWDT HAL Module Features... 2 2. IWDT HAL Module APIs Overview... 2 3. IWDT HAL Module Operational Overview... 3 3.1 IWDT HAL Module Important Operational Notes and Limitations... 5 3.1.1 IWDT HAL Module Period Calculation... 5 3.1.2 Triggering DMAC/DTC with the IWDT HAL Module... 5 3.1.3 Triggering Event Link Controller Events with the IWDT HAL Module... 5 3.2 IWDT HAL Module Limitations... 5 4. Including the IWDT HAL Module in an Application... 6 5. Configuring the IWDT HAL Module... 6 5.1 Configure Option Function Select Register 0 (OFS0)... 7 5.2 Configuring the Interrupts for the IWDT HAL Module... 7 5.3 IWDT HAL Module Clock Configuration... 7 5.4 IWDT HAL Module Pin Configuration... 7 6. Using the IWDT HAL Module in an Application... 7 7. Using the IWDT HAL Module in an Application... 8 8. Customizing the IWDT HAL Module for a Target Application... 9 9. Running the IWDT HAL Module Application Project... 10 10. IWDT HAL Module Conclusion... 10 11. IWDT HAL Module Next Steps... 11 12. IWDT HAL Module Reference Information... 11 R11AN0214EU0101 Rev.1.01 Page 1 of 12

1. IWDT HAL Module Features The IWDT HAL module key features includes: One of two possible event triggers for IWDT underflows or refreshing outside of the permitted window, such as a device reset, or NMI generation Internal Watchdog timer peripheral clock source to improve safety Automatic hardware configuration after reset Figure 1 IWDT HAL Module organization, options, & stack implementations 2. IWDT HAL Module APIs Overview The IWDT HAL module defines API functions to open, refresh, read, and get and clear the IWDT status. The following tables summarizes the available APIs and includes an example of each, along with a brief description. A table of status return values follows the API summary table. Table 1 IWDT HAL Module API Summary Function Name.cfgGet Example API Call and Description g_iwdt0.p_api->cfgget(g_iwdt0.p_ctrl, g_iwdt0.p_cfg);.open.refresh.statusget.statusclear Initialize the IWDT in register start mode. In auto-start mode with NMI output it registers the NMI callback. g_iwdt0.p_api->open(g_iwdt0.p_ctrl, g_iwdt0.p_cfg); Initialize the IWDT in register start mode. In auto-start mode with NMI output it registers the NMI callback. g_iwdt0.p_api->refresh(g_iwdt0.p_ctrl); Refresh the watchdog timer. g_iwdt0.p_api->statusget( g_iwdt0.p_ctrl, &status); Read the status of the IWDT. g_iwdt0.p_api->statusclear( g_iwdt0.p_ctrl, clear); Clear the status flags of the IWDT. R11AN0214EU0101 Rev.1.01 Page 2 of 12

Function Name.counterGet.timeoutGet.versionGet Example API Call and Description g_iwdt0.p_api->counterget(g_iwdt0.p_ctrl, &counter); Read the current IWDT counter value. g_iwdt0.p_api->timeoutget(g_iwdt0.p_ctrl, &timeout); Read the watchdog timeout values. g_iwdt0.p_api->versionget(&version); Retrieve the API version using the version pointer. Note: For details on operation and definitions for the function data structures, typedefs, defines, API data, API structures, and function variables, review the SSP User s Manual API References for the associated module. Table 2 Status Return Values Name Description SSP_SUCCESS Function successfully executed. SSP_ERR_ASSERTION Null Pointer(s). SSP_ERR_INVALID_ARGUMENT One or more configuration options is invalid. SSP_ERR_ABORTED Invalid clock divider for this watchdog Note: Lower-level drivers may return common error codes. Refer to the SSP User s Manual API references for the associated module for a definition of all relevant status return values. 3. IWDT HAL Module Operational Overview The IWDT HAL module configures the IWDT Interface. The following figure shows an operational example of the IWDT. When refreshed during the counter s valid refresh period, the timer count value is reset. When the IWDT underflows or is refreshed outside of the permitted refresh window, one of the following events can occur: Resetting of the device Generation of an NMI Figure 2 IWDT HAL Module operation All Synergy microcontroller series include Option-Setting Memory. Use Option-Setting Memory to set the operating state of peripherals after a reset. The Option Function Select (OFS) can be used to set the IWDT, WDT, LVD, and CGC high-speed on-chip oscillator (HOCO) state. R11AN0214EU0101 Rev.1.01 Page 3 of 12

The following table details IWDT parameters configurable by the OFS registers: Table 3 WDT Parameters Control IWDT Start Mode Select IWDT Timeout Period IWDT-Clock Frequency Division Ratio (The IWDT is clocked from PCLKB) IWDT Window End Position Description Automatically starts the IWDT after a Reset in enabled. Specifies the IWDT timeout (number of clock cycles). 128 cycles 512 cycles 1024 cycles 2048 cycles IWDTCLK / 1 IWDTCLK / 16 IWDTCLK / 32 IWDTCLK / 64 IWDTCLK / 128 IWDTCLK / 256 0% (no window end position set) 25% 50% 75% 100% IWDT Window Start Position 0% 25% 50% 75% 100% (no window start position set) IWDT Reset Interrupt Request The IWDT can either generate an Interrupt Signal or a Reset signal. IWDT Stop Control The IWDT can continue to count or Stop counting in Sleep, Snooze, Software Standby, or Deep Software Standby mode Note: For details on the Option Function Select Register 0 (OFS0), see the applicable Synergy MCU hardware manual. The OFS register values are set via the properties dialog (see the following figure). The properties dialog is accessible from the BSP tab of Synergy Configuration editor. R11AN0214EU0101 Rev.1.01 Page 4 of 12

Figure 3 OFS register values 3.1 IWDT HAL Module Important Operational Notes and Limitations 3.1.1 IWDT HAL Module Period Calculation The IWDT operates from the IWDTCLK source. Assuming the largest parameters for IWDT, the time from the last refresh to device reset, or NMI generation, is under 35 seconds, derived from: IWDTLCK = 15 khz Clock division ratio = IWTCLK/256 Timeout period = 2048 cycles IWDT clock frequency = 15 khz / 256 = 58.59 Hz Cycle time = 1 / 58.59 Hz = 17.07 ms Timeout = 17.07 ms x 2048 cycles = 34.95 seconds 3.1.2 Triggering DMAC/DTC with the IWDT HAL Module To trigger a data transfer using the DMAC or DTC peripheral when the IWDT counter underflows, or when a refresh is attempted outside of the valid refresh period, configure the IWDT to generate an NMI, and, configure the DMAC/DTC transfer with activation source set to ELC_EVENT_IWDT_UNDERFLOW. For details, see the associated DMAC and DTC Module Guides. 3.1.3 Triggering Event Link Controller Events with the IWDT HAL Module The IWDT can trigger the start of another peripheral using the Event Link Controller (ELC). See the ELC Module Guide for a list of available peripherals. 3.2 IWDT HAL Module Limitations When using a J-Link debugger, the IWDT counter does not count; it does not reset the device or generate an NMI. When there is no active task ready to run, ThreadX puts the MCU in sleep mode. If the IWDT is configured to stop the counter in low power mode, then your application must restart the timer when used with the ThreadX RTOS. See the latest SSP Release Notes for other operational limitations to this module. R11AN0214EU0101 Rev.1.01 Page 5 of 12

4. Including the IWDT HAL Module in an Application Note: It is assumed that you are familiar with creating a project, adding threads, adding a stack to a thread and configuring a block within the stack. If you are unfamiliar with any of these items, refer to the first few chapters of the SSP User s Manual to learn how to manage each of these important steps in creating SSP-based applications. To add the IWDT Driver to an application, simply add it to a thread using the stacks selection sequence provided in the following table. (The default name for the Transfer Driver is g_iwdt0. This name can be changed in the associated Properties window.) Table 4 IWDT Driver Selection Sequence Resource ISDE Tab Stacks Selection Sequence g_wdt0 IWDT HAL on r_iwdt Threads New Stack> Driver> Monitoring> IWDT HAL on r_iwdt When the IWDT HAL module on r_iwdt is added to the thread stack, the configurator automatically adds any needed lower-level modules. Any drivers that need additional configuration information are box text highlighted in Red. Modules with a Gray band are individual modules that stand alone. 5. Configuring the IWDT HAL Module Figure 4 IWDT HAL Module stack The user must configure the IWDT HAL module must be configured for the desired operation. The SSP configuration window automatically identifies (by highlighting the block in red) any required configuration selections, such as interrupts or operating modes, which must be configured for lower-level modules for successful operation. Only those properties that can be changed without causing conflicts are available for modification. Other properties are locked and are not available for changes. Unavailable properties are identified with a lock icon for the locked property in the Properties window in the ISDE. This approach simplifies the configuration process, making it less error-prone than previous manual approaches. The available configuration settings and defaults for all the user accessible properties are in the Properties tab in the SSP configurator and are summarized in the following tables for easy reference. One of the properties most often identified as requiring a change is the interrupt priority; this configuration setting is available within the Properties window of the associated module. Simply select the indicated module and then view the Properties window; the interrupt settings are often toward the bottom of the properties list, so scroll down until they become available. Also, note that the interrupt priorities listed in the Properties window in the ISDE includes an indication as to the validity of the setting based on the targeted MCU (CM4 or CM0+). This level of detail is not included in the following tables, but is easily visible with the ISDE when configuring interrupt-priority levels. Note: You may want to open your ISDE, create the module and explore the property settings in parallel with looking over the following configuration settings. This helps to orient you and can be a useful hands-on approach to learning the ins and outs of developing using the SSP. Table 5 Configuration Settings for the IWDT HAL Module on r_iwdt ISDE Value Description Property Parameter BSP, Enabled, Disabled Include parameter checking code Checking Default: BSP Name g_wdt0 Module Name R11AN0214EU0101 Rev.1.01 Page 6 of 12

ISDE Value Description Property NMI Callback NULL Callback. A user callback function can be registered in the open API. If this callback function is provided, it is called from the interrupt service routine (ISR) each time the IRQn triggers. Since the callback is called from an ISR, care should be taken not to use blocking calls or lengthy processing. Spending excessive time in an ISR can affect the responsiveness of the system. Note: The example values and defaults are for a project using the Synergy S7G2 MCU Family. Other MCUs may have different default values and available configuration settings. 5.1 Configure Option Function Select Register 0 (OFS0) All series of Synergy microcontrollers have an Option-Setting Memory which can be used to set the operating state of peripherals after a reset. The OFS can be used to set the state of the IWDT, WDT, LVD and CGC high-speed on-chip oscillator (HOCO). See the description in the operational overview section earlier in this document. 5.2 Configuring the Interrupts for the IWDT HAL Module Use the ISDE to configure the IWDT interrupts in the same way as configuring the other options for the IWDT module. If the IWDT is configured to generate an NMI interrupt on underflow or invalid refresh the interrupt must be enabled in the BSP. Note: To enable interrupts, set the priority of the IWDT > IWDT NMIUNDF N. This sets BSP_IRQ_CFG_IWDT_UNDERFLOW in ssp_cfg/bsp/bsp_irq_cfg.h to the priority level selected. When the IWDT NMIUNDF N interrupt is enabled in the BSP, the corresponding ISR will be defined. The ISR will call a user callback function if one was registered in the open API. 5.3 IWDT HAL Module Clock Configuration The IWDT has its own dedicated clock operating at a set frequency which cannot be modified. 5.4 IWDT HAL Module Pin Configuration No pins are required for IWDT operation. 6. Using the IWDT HAL Module in an Application The typical steps in using the IWDT HAL module in an application are: 1. Initialize the IWDT HAL module using the open API. 2. Refresh the IWDT HAL module as needed using the refresh API. The following figure shows common steps in a typical operational flow. Figure 5 Flow Diagram of a Typical WDT HAL Module Application R11AN0214EU0101 Rev.1.01 Page 7 of 12

7. Using the IWDT HAL Module in an Application The application project associated with this module guide shows typical steps to using the module in an example application. You may want to import and open the application project within ISDE and view the configuration settings for the IWDT HAL module. You can also read over the code in IWDT_HAL_MG.c, demonstrating the IWDT HAL module APIs in a complete design. The application project configures the IWDT to run in auto-start mode with (IWDTCLK (15 KHz)/16) and a timeout of 2048 cycles (approximately 2.18 seconds). The GPT timer0 is configured to refresh the IWDT periodically and toggle the Green LED as an activity indication. SW5 is configured to disable IWDT refresh, generating an IWDT reset signal. On reset, the application identifies the cause of the last reset. If the reset is caused by IWDT, the Red LED illuminates to inform the user that an IWDT reset has occurred. Pressing SW4 clears this state. Table 6 Software and Hardware Resources Used by the Application Project Resource Revision Description e 2 studio 5.4.0 or later Integrated Solution Development Environment (ISDE) SSP 1.3.0 or later Synergy Software Platform IAR EW for Renesas Synergy 7.71.3 IAR Embedded Workbench for Renesas Synergy SSC 5.4.0 or later Synergy Standalone Configurator SK-S7G2 v3.0 to v3.2 Starter Kit The following flow depicts this application project. Figure 6 IWDT HAL Module Application Project Flow Diagram The IWDT_HAL_MG_AP.c file is co-located with the project once imported in the ISDE. You can open this file within the ISDE, read along, and learn how to identify key uses of the APIs. To refresh IWDT, the GPT0 is set to period time mode to refresh WDT using a 200ms interrupt subroutine. On startup, the hardware auto-starts the IWDT, with the configuration set in the synergy configurator->bsp. The application configures the IWDT interface and the GPT0 by making open calls to g_wdt.p_api->open and R11AN0214EU0101 Rev.1.01 Page 8 of 12

g_timer0.p_api->open), respectively. The IWDT refreshes by periodically calling the g_iwdt.p_api->refresh call via the GPTO. When switch SW5 is pressed, the g_iwdt_refresh_flag clears. This event causes the GPT0 interrupt subroutine to stop the IWDT refresh, initiating an IWDT underflow. On the next reset, the application checks for the cause of RESET. If the IWDT bit of RSTSR1_b (RSTSR1 SFR) is set, the program illuminates the Red LED and remains in a loop until the user presses SW4. Pressing SW5 disables the IWDT refresh and it remains disabled until user acknowledges the RESET condition by pressing SW4. Note: A few key properties are configured in this application project to support operations and the physical properties of the target board and MCU. The following properties indicate the values set for this specific project. You can also open the application project and view these settings in the property window as a hands-on exercise. Table 7 IWDT HAL Module Configuration Settings for the Application Project (BSP settings) ISDE Property Value Set IWDT Start Mode Select IWDT is automatically activated after a reset (auto-start mode) IWDT Timeout Period 2048 cycles IWDT Clock Frequency Division Ratio 16 IWDT Window End Position 0%(no window end position) IWDT Window Start Position 100%(no window start position) IWDT Reset Interrupt Request NReset is enabled IWDT Stop Control Stop counting when in Sleep, Snooze mode, Software Standby, or Deep Software Standby mode Table 8 GPT0 Configuration Settings for the Application Project in Threads ISDE Property Value Set Parameter Checking Default(BSP) Name g_timer0 Channel 0 Mode Periodic Period Value 200 Period Unit Milliseconds Duty Cycle Value 50 Duty Cycle Unit Unit Raw Counts Auto Start True GTIOCA Output Enabled False GTIOCA Stop Level Pin Level Low GTIOCB Output Enabled False GTIOCB Stop Level Pin Level Low Callback gpt_callback Interrupt Priority Priority 4 (CM4: valid, CM0+: invalid) 8. Customizing the IWDT HAL Module for a Target Application Some configuration settings can normally be changed by the developer from those shown in the application project, such as changing the IWDT configuration in BSP. For example, the user can change the RESET interrupt request from the RESET action to the NMI callback and define a callback in r_iwdt stack. R11AN0214EU0101 Rev.1.01 Page 9 of 12

9. Running the IWDT HAL Module Application Project To run the Independent WDT HAL module application project in order to see it executed on a target kit, you can simply import it into your ISDE, compile and run debug. To help you implement the IWDT HAL module application in a new project, use the following instructions to aid you as you define, configure, auto-generate files, add code, compile and debug the project on the target kit. Following these steps is a good hands-on approach that helps make the development process with SSP practical, while reading this guide tends to be theoretical. To create and run the IWDT application project simply use the following steps: 1. Create a new Renesas Synergy project for the SK-S7G2 called, IWDT_HAL_MG_AP. 2. Select the Threads tab. 3. Select the HAL/common thread. 4. Add the IWDT driver, GPT driver, and External IRQ drivers for SW4 and SW5 5. Add IWDT_HAL_MG.c and IWDT_HAL_MG.h to the new project. 6. Connect to the host PC using the USB cable (use the J19 DEBUG_USB connector). 7. Start to debug the application. 8. Stop the debug operation and restart the board. Short the RESET jumper J2 to test the IWDT application without J-Link. 9. The Green LED (LED1 on SK-S7G2) starts blinking at the rate of 200 ms, indicating an IWDT refresh. 10. Press switch SW5. Observe that the blinking Green LED stops, indicating that the IWDT is not getting refreshed. 11. After approximately 2.218 seconds, the IWDT RESET initiates resetting the device. To indicate this reset the Red LED (LED2 on SK- S7G2) glows along with Green flashing LED. 12. Press SW4 to acknowledge the IWDT RESET, this turns OFF the Red LED. Note: Since the project runs without J-Link support, SEMI-HOSTING is not enabled. However, the Amber LED (LED3 on SK-S7G2) lights when it detects any error in the IWDT, GPT and external interrupts API calls. In such case users are advised to connect J-Link and do a step-by-step debug operation to explore the bug. Figure 7 IWDT Application stages from IWDT Driver Application Project Description of IWDT Application stages from Left to Right (see figure) Green LED blinking On press of SW5 (red arrow); after a RESET, Red LED (bottom right of image) glowing On press of SW4 (bottom left of image). Note that the Red LED is turned OFF Amber LED (lower left corner of image) is glowing on detection of any error caused by API calls. 10. IWDT HAL Module Conclusion This module guide has provided all the background information needed to select, add, configure and use the module in an example project. Many of these steps were time consuming and error-prone activities in previous generations of embedded systems. The Renesas Synergy Platform makes these steps much less time consuming and removes the common errors, like conflicting configuration settings or the incorrect selection of low-level drivers. The use of highlevel APIs (as demonstrated in the application project) illustrates additional development time savings by allowing work to begin at a high level and avoiding the time required in older development environments to use or, in some cases, create, lower-level drivers. R11AN0214EU0101 Rev.1.01 Page 10 of 12

11. IWDT HAL Module Next Steps After you have mastered a simple IWDT module project, you may want to review a more complex example. Other application projects and application notes that demonstrate IWDT HAL use can be found as described in the References section at the end of this document. 12. IWDT HAL Module Reference Information SSP User Manual: Available in html format in the SSP distribution package and as a pdf from the Synergy Gallery. Links to all the most up-to-date r_iwdt module reference materials and resources are available on the Synergy Knowledge Base: https://enus.knowledgebase.renesas.com/english_content/renesas_synergy%e2%84%a2_platform/renesas_synergy_knowle dge_base/r_iwdt_module_guide_resources. R11AN0214EU0101 Rev.1.01 Page 11 of 12

Website and Support Support: https://synergygallery.renesas.com/support Technical Contact Details: America: https://www.renesas.com/en-us/support/contact.html Europe: https://www.renesas.com/en-eu/support/contact.html Japan: https://www.renesas.com/ja-jp/support/contact.html All trademarks and registered trademarks are the property of their respective owners. R11AN0214EU0101 Rev.1.01 Page 12 of 12

Revision History Rev. Date Description Page Summary 1.00 Aug 24, 2017 Initial release 1.01 Updated software versions and made minor corrections

Notice 1. Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples. You are fully responsible for the incorporation or any other use of the circuits, software, and information in the design of your product or system. Renesas Electronics disclaims any and all liability for any losses and damages incurred by you or third parties arising from the use of these circuits, software, or information. 2. Renesas Electronics hereby expressly disclaims any warranties against and liability for infringement or any other disputes involving patents, copyrights, or other intellectual property rights of third parties, by or arising from the use of Renesas Electronics products or technical information described in this document, including but not limited to, the product data, drawing, chart, program, algorithm, application examples. 3. No license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights of Renesas Electronics or others. 4. You shall not alter, modify, copy, or otherwise misappropriate any Renesas Electronics product, whether in whole or in part. Renesas Electronics disclaims any and all liability for any losses or damages incurred by you or third parties arising from such alteration, modification, copy or otherwise misappropriation of Renesas Electronics products. 5. Renesas Electronics products are classified according to the following two quality grades: "Standard" and "High Quality". The intended applications for each Renesas Electronics product depends on the product s quality grade, as indicated below. "Standard": Computers; office equipment; communications equipment; test and measurement equipment; audio and visual equipment; home electronic appliances; machine tools; personal electronic equipment; and industrial robots etc. "High Quality": Transportation equipment (automobiles, trains, ships, etc.); traffic control (traffic lights); large-scale communication equipment; key financial terminal systems; safety control equipment; etc. Renesas Electronics products are neither intended nor authorized for use in products or systems that may pose a direct threat to human life or bodily injury (artificial life support devices or systems, surgical implantations etc.), or may cause serious property damages (space and undersea repeaters; nuclear power control systems; aircraft control systems; key plant systems; military equipment; etc.). Renesas Electronics disclaims any and all liability for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for which the product is not intended by Renesas Electronics. 6. When using the Renesas Electronics products, refer to the latest product information (data sheets, user s manuals, application notes, "General Notes for Handling and Using Semiconductor Devices" in the reliability handbook, etc.), and ensure that usage conditions are within the ranges specified by Renesas Electronics with respect to maximum ratings, operating power supply voltage range, heat radiation characteristics, installation, etc. Renesas Electronics disclaims any and all liability for any malfunctions or failure or accident arising out of the use of Renesas Electronics products beyond such specified ranges. 7. Although Renesas Electronics endeavors to improve the quality and reliability of Renesas Electronics products, semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Further, Renesas Electronics products are not subject to radiation resistance design. Please ensure to implement safety measures to guard them against the possibility of bodily injury, injury or damage caused by fire, and social damage in the event of failure or malfunction of Renesas Electronics products, such as safety design for hardware and software including but not limited to redundancy, fire control and malfunction prevention, appropriate treatment for aging degradation or any other appropriate measures by your own responsibility as warranty for your products/system. Because the evaluation of microcomputer software alone is very difficult and not practical, please evaluate the safety of the final products or systems manufactured by you. 8. Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product. Please investigate applicable laws and regulations that regulate the inclusion or use of controlled substances, including without limitation, the EU RoHS Directive carefully and sufficiently and use Renesas Electronics products in compliance with all these applicable laws and regulations. Renesas Electronics disclaims any and all liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations. 9. Renesas Electronics products and technologies shall not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited under any applicable domestic or foreign laws or regulations. You shall not use Renesas Electronics products or technologies for (1) any purpose relating to the development, design, manufacture, use, stockpiling, etc., of weapons of mass destruction, such as nuclear weapons, chemical weapons, or biological weapons, or missiles (including unmanned aerial vehicles (UAVs)) for delivering such weapons, (2) any purpose relating to the development, design, manufacture, or use of conventional weapons, or (3) any other purpose of disturbing international peace and security, and you shall not sell, export, lease, transfer, or release Renesas Electronics products or technologies to any third party whether directly or indirectly with knowledge or reason to know that the third party or any other party will engage in the activities described above. When exporting, selling, transferring, etc., Renesas Electronics products or technologies, you shall comply with any applicable export control laws and regulations promulgated and administered by the governments of the countries asserting jurisdiction over the parties or transactions. 10. Please acknowledge and agree that you shall bear all the losses and damages which are incurred from the misuse or violation of the terms and conditions described in this document, including this notice, and hold Renesas Electronics harmless, if such misuse or violation results from your resale or making Renesas Electronics products available any third party. 11. This document shall not be reprinted, reproduced or duplicated in any form, in whole or in part, without prior written consent of Renesas Electronics. 12. Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electronics products. (Note 1) "Renesas Electronics" as used in this document means Renesas Electronics Corporation and also includes its majority-owned subsidiaries. (Note 2) "Renesas Electronics product(s)" means any product developed or manufactured by or for Renesas Electronics. (Rev.3.0-1 November 2016) SALES OFFICES Refer to "http://www.renesas.com/" for the latest and detailed information. Renesas Electronics America Inc. 2801 Scott Boulevard Santa Clara, CA 95050-2549, U.S.A. Tel: +1-408-588-6000, Fax: +1-408-588-6130 Renesas Electronics Canada Limited 9251 Yonge Street, Suite 8309 Richmond Hill, Ontario Canada L4C 9T3 Tel: +1-905-237-2004 Renesas Electronics Europe Limited Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, U.K Tel: +44-1628-585-100, Fax: +44-1628-585-900 Renesas Electronics Europe GmbH Arcadiastrasse 10, 40472 Düsseldorf, Germany Tel: +49-211-6503-0, Fax: +49-211-6503-1327 Renesas Electronics (China) Co., Ltd. Room 1709, Quantum Plaza, No.27 ZhiChunLu Haidian District, Beijing 100191, P.R.China Tel: +86-10-8235-1155, Fax: +86-10-8235-7679 Renesas Electronics (Shanghai) Co., Ltd. Unit 301, Tower A, Central Towers, 555 Langao Road, Putuo District, Shanghai, P. R. China 200333 Tel: +86-21-2226-0888, Fax: +86-21-2226-0999 Renesas Electronics Hong Kong Limited Unit 1601-1611, 16/F., Tower 2, Grand Century Place, 193 Prince Edward Road West, Mongkok, Kowloon, Hong Kong Tel: +852-2265-6688, Fax: +852 2886-9022 Renesas Electronics Taiwan Co., Ltd. 13F, No. 363, Fu Shing North Road, Taipei 10543, Taiwan Tel: +886-2-8175-9600, Fax: +886 2-8175-9670 Renesas Electronics Singapore Pte. Ltd. 80 Bendemeer Road, Unit #06-02 Hyflux Innovation Centre, Singapore 339949 Tel: +65-6213-0200, Fax: +65-6213-0300 Renesas Electronics Malaysia Sdn.Bhd. Unit 1207, Block B, Menara Amcorp, Amcorp Trade Centre, No. 18, Jln Persiaran Barat, 46050 Petaling Jaya, Selangor Darul Ehsan, Malaysia Tel: +60-3-7955-9390, Fax: +60-3-7955-9510 Renesas Electronics India Pvt. Ltd. No.777C, 100 Feet Road, HAL II Stage, Indiranagar, Bangalore, India Tel: +91-80-67208700, Fax: +91-80-67208777 Renesas Electronics Korea Co., Ltd. 12F., 234 Teheran-ro, Gangnam-Gu, Seoul, 135-080, Korea Tel: +82-2-558-3737, Fax: +82-2-558-5141 http://www.renesas.com 2017 Renesas Electronics Corporation. All rights reserved. Colophon 6.0