📄 r8c2c2d_s002_reset_init.c
字号:
/************************************************************************************
* *
* System file name : r8c2c2d_s002_reset_init.c *
* System name : R8C2C/2D(5.0V/20MHz) *
* *
* Version : 1.00 *
* ROM size : - *
* RAM size : - *
* Contents : Initialization program after resets *
* note : New 2007-03-03 *
* *
************************************************************************************/
/************************************************************
* Include file *
/***********************************************************/
#include "sfr_r8c2c2d.h" /* Definition of the R8C/2C,2D SFR for Sango */
/************************************************************
* Declaration of function prototype *
************************************************************/
void reset_init(void); /* Initial setting of processor and system clock control registers */
/*** Extern ***/
/*** Static ***/
/************************************************************
* Declaration of interrupt *
************************************************************/
/************************************************************
* Definition of RAM area *
************************************************************/
/*** Input parameters ***/
/*** Output parameters ***/
/*** Static ***/
/************************************************************
* Definition of base section *
************************************************************/
/************************************************************
* Definition of port *
************************************************************/
/************************************************************
* Data table *
************************************************************/
/************************************************************************************
Name :reset_init
Parameters :-
Returns :-
Description :Initial setting of processor and system clock control registers
************************************************************************************/
void reset_init(void){
prc0 = 1; /* Protect off : System control resistor protect cancellation */
cm11 = 0; /* Xin-Xout On-chip feed back resistor enabled */
cm13 = 1; /* Xin-Xout pin */
cm15 = 1; /* Xin-Xout drive capacity select bit : HIGH */
asm("NOP"); /* Waiting for stable of oscillation */
asm("NOP"); /* Waiting for stability */
cm05 = 0; /* Main clock : oscillation */
asm("NOP"); /* Waiting for stability */
asm("NOP"); /* Waiting for stability */
cm16 = 0; /* Main clock = No division mode:20MHz */
cm17 = 0; /* Main clock = No division mode:20MHz */
asm("NOP"); /* Waiting for stability */
asm("NOP"); /* Waiting for stability */
cm06 = 0; /* Main clock division : CM16 and CM17 enabled */
cm07 = 0; /* System clock is selected */
asm("NOP"); /* Waiting for stability */
asm("NOP"); /* Waiting for stability */
ocd2 = 0; /* Main clock change */
cm12 = 0; /* Xcin-Xcout On-chip feed back resistor enabled */
cm04 = 1; /* Xcin-Xcout oscillation function is selected */
asm("NOP"); /* Waiting for stability */
asm("NOP"); /* Waiting for stability */
prc0 = 0; /* Protect on : System control resister protect */
}
/************************************************************************************
Name :-
Parameters :-
Returns :-
Description :-
************************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -