S1C17W13 CLG 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. - 02 Aug, 2016 rev1.1.0 Change GNU17v3 project file. ------------------------------------------------------------------------------ 1. Folder Configuration s1c17w13_clg_sample |_ s1c17w13_clg_gnu17v2 Sample project for GNU17v2 |_ s1c17w13_clg_gnu17v3 Sample project for GNU17v3 2. Sample Software Specification This sample software executes the processing shown below using the Clock Generator embedded in the microcontroller. - Oscillate and stop OSC1. - Oscillate and stop OSC3. - Oscillate and stop IOSC. - Change the system clock to OSC1. - Change the system clock to OSC3. - Change the system clock to IOSC. - In the case of system clock is IOSC/OSC3, do the transition control between SLEEP mode and RUN mode. - Do the transition control between OSC1 HALT, IOSC RUN, and OSC3 RUN. - Change the system clock of OSC3. 3. Hardware Requirements This sample program works by using the built-in oscillation (IOSC) in the microcomputer. Then change the system clock to OSC1 or OSC3. Therefore it needs transducer. For details, please refer to "Clock Generator (CLG)" in S1C17W13 technical manual. 4. Behavior 0) Start to oscillate OSC1, change the system clock to OSC1, and then stop the IOSC oscillation. 1) Stop CPU (HALT) and repeat to interrupt the timer three times per second. Each time a timer interrupt is received, start the IOSC oscillation, execute 10 milliseconds of loop, display a difference between the T16 timer count values before and after the loop on Simulated I/O, and stop IOSC. 2) Trim IOSC's oscillating frequency automatically based on the OSC1's oscillating clock. 3) Since this operation is the same as step 1, the automatic trimming result can be confirmed. 4) Stop CPU (HALT) and repeat to interrupt the timer three times per second. Each time a timer interrupt is received, start the OSC3 oscillation (4MHz), execute 10 millisecond of loop, display a difference between the T16 timer count values before and after the loop on Simulated I/O, and stop OSC3. 5) After IOSC started to oscillate, stop CPU (SLEEP). In order to wake up CPU from the sleep mode, it is necessary to put the level "L" signal into port P04. When CPU wakes up and IOSC automatically starts to oscillate, execute 10 milliseconds of loop, display a difference between the T16 timer count values before and after the loop on Simulated I/O, and stop IOSC. This operation is repeated three times. 6) After OSC3 started to oscillate (4MHz), stop CPU (SLEEP). In order to wake up CPU from the sleep mode, it is necessary to put the level "L" signal into port P04. When CPU wakes up and OSC3 automatically starts to oscillate, execute 10 millisecond of loop, display a difference between the T16 timer count values before and after the loop on Simulated I/O, and stop OSC3. This operation is repeated three times. 7) At first, start the IOSC oscillation, execute 10 milliseconds of loop, display a difference between the T16 timer count values before and after the loop on Simulated I/O. Next, start the OSC3 oscillation (1MHz), stop the IOSC oscillation, execute 10 milliseconds of loop, display a difference between the T16 timer count values before and after the loop on Simulated I/O. Then, start the IOSC oscillation, change the clock, and stop the OSC3 oscillation in order to start the OSC3 oscillation at 4MHz. Then, start the OSC3 oscillation (4MHz), stop the IOSC oscillation, execute 10 milliseconds of loop, display a difference between the T16 timer count values before and after the loop on Simulated I/O. 8) Finally, the program starts the IOSC oscillation, stops the OSC1 and OSC3 oscillations to finish the series of operations. 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 "s1c17w13_clg_gnu17v2" project. For GNU17v3.x, select "s1c17w13_clg_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