hwinit.c
来自「M16CsingleChipTimers.zip为定时器及其中断设置。包含与上微」· C语言 代码 · 共 26 行
C
26 行
/****************************************************************
KPIT Cummins Infosystems Ltd, Pune, India. - 01-Sept-2003.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*****************************************************************/
#include "hardware.h"
void hw_initialise (void)
{
/* hardware initialisation code here */
PD6.BYTE = 0x80; /* output port TX */
PRCR.BYTE = 0x2 | 0x1; /* Turn off protection for the cpu and clock register */
PM0.BYTE = 0x80; /* Single Chip mode. No BCLK output */
PM1.BYTE = 0x08; /* Expand internal memory, no global wait state */
CM0.BYTE = 0x0; /* No sub-clock (Xc) generation */
CM1.BYTE = 0x0; /* CPU_CLOCK = MAIN_CLOCK, low drive on Xin */
PRCR.BYTE = 0; /* Turn on protection on all registers */
/* turn off battery measurement circuit */
PD8.BIT.PD8_1 = OUTPUT;
P8.BIT.P8_1 = HIGH;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?