S1C17M10 WDT2 Sample Software Copyright(C) SEIKO EPSON CORPORATION 2016. All rights reserved. History - 10 Apr, 2015 rev1.0.0 Newly developed. - 25 Sep, 2015 rev1.1.0 Add GNU17v3 project and change demo program. - 03 Feb, 2016 rev1.1.1 Change GNU17v3 project file. ------------------------------------------------------------------------------------- 1. Folder Configuration s1c17m10_wdt2 |_ s1c17m10_wdt2_gnu17v2 Sample project for GNU17v2 |_ s1c17m10_wdt2_gnu17v3 Sample project for GNU17v3 2. Sample Software Specification This sample software executes the processing shown below using the WDT2 module embedded in the microcontroller. - Sets WDT2 timeout to 4 second. - Runs WDT2 in NMI mode. Resets WDT2 counter 10 times every second. Stops reseting and waits for NMI (interrupt). Resets WDT counter at NMI occured. Waits for NMI again. Resets WDT counter again at NMI occured. Waits for 10 seconds. Stops WDT2. - Runs WDT2 in "RESET after NMI" mode. Resets WDT2 counter 5 times every second. Stops reseting and waits for NMI (interrupt). Resets WDT counter at NMI occurred. Waits for NMI again. Resets WDT counter again at NMI occurred. Waits for 10 seconds... - System resets and starts executing over again*. *Note that due to WDT calls a system reset the program starts over again, the output through SIM I/O becomes unavailable but printing via UART works OK. 3. Hardware Requirements SVTmini17M10 development is required. The COM port adapter is optional. The COM port adapter can be connected to CN3 connector (on SVTmini17M10 board): Pin 24 is connected to P02 port that is configured as TX Pin 26 is connected to P00 port that is configured as RX Pins 33 and 34 are GND *--------------------------------------------------------------------------* | SVTmini17M10 COM Port Adapter | | ____________________ __________ | | | | | | | | | SVTmini17M10 | | | | | | __________ | | COM PORT | | | | | |P02-|-TX_on_Pin24------RX-| | | | | | s1c17M10 |P00-|-RX_on_Pin26------TX-| ADAPTER | | | | |__________| | | | | | | | Pins 33,34 | | | | | GND O--|---------------------| GND | | | |____________________| |__________| | | | *-------------------------------------------------------------------------*/ 4. Behavior Here is sample output. Note that due to WDT calls a system reset here the program starts over again, the output through SIM I/O becomes unavailable but printing via UART still works good. <<< Start Watchdog Timer demonstration start >>> I. Start Watchdog Timer in 'NMI Mode'. NMI Mode[WDTCTL=0200h]: WDT counter has been reset: 1 NMI Mode[WDTCTL=0200h]: WDT counter has been reset: 2 NMI Mode[WDTCTL=0200h]: WDT counter has been reset: 3 NMI Mode[WDTCTL=0200h]: WDT counter has been reset: 4 NMI Mode[WDTCTL=0200h]: WDT counter has been reset: 5 NMI Mode[WDTCTL=0200h]: WDT counter has been reset: 6 NMI Mode[WDTCTL=0200h]: WDT counter has been reset: 7 NMI Mode[WDTCTL=0200h]: WDT counter has been reset: 8 NMI Mode[WDTCTL=0200h]: WDT counter has been reset: 9 NMI Mode[WDTCTL=0200h]: WDT counter has been reset: 10 NMI Mode[WDTCTL=0200h]: Stop reseting WDT counter and wait for NMI occurred... NMI Mode[WDTCTL=0200h]: 1 sec... NMI Mode[WDTCTL=0200h]: 2 sec... NMI Mode[WDTCTL=0200h]: 3 sec... NMI Mode[WDTCTL=0200h]: 4 sec... NMI Mode[WDTCTL=0300h]: 4 sec... NMI Mode[WDTCTL=0300h]: NMI occurred! NMI Mode[WDTCTL=0200h]: Reset WDT counter and wait for NMI occurred... NMI Mode[WDTCTL=0200h]: 1 sec... NMI Mode[WDTCTL=0200h]: 2 sec... NMI Mode[WDTCTL=0200h]: 3 sec... NMI Mode[WDTCTL=0200h]: 4 sec... NMI Mode[WDTCTL=0300h]: 4 sec... NMI Mode[WDTCTL=0300h]: NMI occurred! NMI Mode[WDTCTL=0300h]: Do nothing for 10 sec... 1 NMI Mode[WDTCTL=0300h]: Do nothing for 10 sec... 2 NMI Mode[WDTCTL=0300h]: Do nothing for 10 sec... 3 NMI Mode[WDTCTL=0300h]: Do nothing for 10 sec... 4 NMI Mode[WDTCTL=0300h]: Do nothing for 10 sec... 5 NMI Mode[WDTCTL=0300h]: Do nothing for 10 sec... 6 NMI Mode[WDTCTL=0300h]: Do nothing for 10 sec... 7 NMI Mode[WDTCTL=0300h]: Do nothing for 10 sec... 8 NMI Mode[WDTCTL=0300h]: Do nothing for 10 sec... 9 NMI Mode[WDTCTL=0300h]: Do nothing for 10 sec... 10 NMI Mode[WDTCTL=0200h]: Stop WTD. - Watchdog Timer test in NMI mode completed. II. Start Watchdog Timer in 'RESET After NMI Mode'. RESET After NMI Mode[WDTCTL=0400h]: WDT counter has been reset: 1 RESET After NMI Mode[WDTCTL=0400h]: WDT counter has been reset: 2 RESET After NMI Mode[WDTCTL=0400h]: WDT counter has been reset: 3 RESET After NMI Mode[WDTCTL=0400h]: WDT counter has been reset: 4 RESET After NMI Mode[WDTCTL=0400h]: WDT counter has been reset: 5 RESET After NMI Mode[WDTCTL=0400h]: Stop reseting WDT counter and wait for NMI occurred... RESET After NMI Mode[WDTCTL=0400h]: 1 sec... RESET After NMI Mode[WDTCTL=0400h]: 2 sec... RESET After NMI Mode[WDTCTL=0400h]: 3 sec... RESET After NMI Mode[WDTCTL=0400h]: 4 sec... RESET After NMI Mode[WDTCTL=0500h]: NMI occurred! RESET After NMI Mode[WDTCTL=0400h]: Reset WDT counter and wait for NMI occurred... RESET After NMI Mode[WDTCTL=0400h]: 1 sec... RESET After NMI Mode[WDTCTL=0400h]: 2 sec... RESET After NMI Mode[WDTCTL=0400h]: 3 sec... RESET After NMI Mode[WDTCTL=0400h]: 4 sec... RESET After NMI Mode[WDTCTL=0500h]: 4 sec... RESET After NMI Mode[WDTCTL=0500h]: NMI occurred! RESET After NMI Mode[WDTCTL=0500h]: Do nothing for 10 sec, wait for RESET... 1 RESET After NMI Mode[WDTCTL=0500h]: Do nothing for 10 sec, wait for RESET... 2 RESET After NMI Mode[WDTCTL=0500h]: Do nothing for 10 sec, wait for RESET... 3 RESET After NMI Mode[WDTCTL=0500h]: Do nothing for 10 sec, wait for RESET... 4 5. Adjustment This sample software includes GNU17v2.x and GNU17v3.x source code. Before using the sample software, follow instructions below to adjust the sample software either to GNU17v2.x or GNU17v3.x used. 1)Open Import Wizard to import this sample program into workspace. [File] > [Import] > [General] > [Existing Projects into Workspace] 2)Select the folder containing the sample program. For GNU17v2.x, select "s1c17m10_wdt2_gnu17v2" project. For GNU17v3.x, select "s1c17m10_wdt2_gnu17v3" project. 3)Check "Copy projects into workspace" and click "Finish" to import. As to configurations on GNU17 in detail, refer to S5U1C17001C Manual. EOF