
SH7285 Group
Example of Initialization
REJ06B0860-0100/Rev.1.00 June 2009 Page 3 of 21
2. Applications
Configuration program for the minimum hardware setup is required to execute the main function created in C code. This
application note describes the configuration example for the configuration program.
All of the SH7285 application notes assume to use the sample program described in this application note as the
configuration program.
2.1 Sample Program
The configuration program consists of several source files such as the resetprg.c, describing the PowerON_Reset_PC
function, and the hwsetup.c, describing the hardware setup function. Main source files are as follows.
• resetprg.c
• hwsetup.c
• cpg.c
"resetprg.c" is a source file created on the file automatically generated by the High-performance Embedded Workshop, and
describes the PowerON_ResetPC function. The PowerON_ResetPC function initially executed after the reset is canceled. Its
beginning address is set in the reset vector defined by the vecttbl.c.
"hwsetup.c" describes the HardwareSetup function called by the PowerON_Reset_PC function. The HardwareSetup
function calls the io_set_cpg function to set the CPG.
"cpg.c" describes the io_set_cpg function which is called from the HardwareSetup function. The io_set_cpg function sets
the frequency control registers (FRQCR, MCLKCR, and ACLKCR) to clear the module standby function for internal
peripheral modules.
Figure 1 shows flow charts of the PowerON_Reset_PC function, the HardwareSetup function, and the io_set_cpg function.
Komentarze do niniejszej Instrukcji