⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hwinit.c

📁 M16C单片机功率控制源码
💻 C
字号:
/****************************************************************
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -