S1C17W34/W35/S1C17W36 RTCA2 Sample Software Copyright(C) SEIKO EPSON CORPORATION 2016. All rights reserved. History - 14 Dec, 2015 rev1.0.0 Newly developed. - 19 Jan, 2016 rev1.0.1 Change GNU17v3 project file. - 08 Jul, 2016 rev1.1.0 Change CPU and RTCA2 header files. ----------------------------------------------------------------------------- 1. Folder Configuration s1c17w34_w35_w36_rtca2_sample |_ s1c17w34_w35_w36_rtca2_gnu17v2 Sample project for GNU17v2 |_ s1c17w34_w35_w36_rtca2_gnu17v3 Sample project for GNU17v3 2. Sample Software Specification This sample software executes the processing shown below using the RTCA2 embedded in the microcontroller. - Set the time of real time clock. - Get the time of real time clock. - Get the number of interrupts of real time clock. - Use theoretical regulation function. - Use the stopwatch. 3. Hardware Requirements This sample program runs in the OSC1 built-in oscillating circuit in the microcontroller. 4. Behavior 1) Initialize the Real Time Clock. 2) Enable one- and a half-second interrupts of real time clock. 3) Set the theoretical regulation function of real time clock (theoretical regulation interval: 4,096sec, correction factor: -58.2ppm). 4) Set the date and time of real time clock to "Sat 99-12-31 23:59:51" and set the clock to 24-hour mode. 5) Start real time clock and put CPU in a Halt state. 6) When an interrupt occurs in real time clock, release CPU from the Halt state. 7) Get the number of one-second interrupts of real time clock. 8) When the number of one-second interrupts is less than 10, put CPU in a Halt state again. 9) When the number of one-second interrupts is not less than 10, set the clock to 12-hour mode and get the date and time of real time clock (the value is "Sun 00-01-01 12:00:01 AM"). 10) Disable the one-second interrupt of real time clock. 11) Execute theoretical regulation at 4,096sec interval after real time clock starts. 12) Initialize the stopwatch. 13) Enable an interrupts of stopwatch. 14) Start stopwatch and put CPU in a Halt state. 15) When an interrupt occurs in stopwatch, release CPU from the Halt state. 16) Get the number of 1 Hz interrupts of stopwatch. 17) When the number of 1 Hz interrupts is less than 10, put CPU in a Halt state again. 18) When the number of 1 Hz interrupts is not less than 10, read a stopwatch count (10 Hz digit, 100 Hz digit). 19) Stop the stopwatch and disable an interrupt of stopwatch. 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 "s1c17w34_w35_w36_rtca2_gnu17v2" project. For GNU17v3.x, select "s1c17w34_w35_w36_rtca2_gnu17v3" project. 3)Check "Copy projects into workspace" and click "Finish" to import. Before using the sample software, follow instructions below to adjust the sample software either to S1C17W34, S1C17W35 or S1C17W36 used. 1) Select target CPU, which is in one of property when [Properties] is selected from project of the sample software. 2) Set the Debugger Startup Commands for the microcontroller on [GNU17 GDB Commands] dialog box, which is one of the property lists. Click [Create commands from template], select ICDmini for [Debugger], and [Overwrite] the command file for GNU17v2.x. As to configurations on GNU17 in detail, refer to S5U1C17001C Manual. EOF