init_65.c

来自「pll锁向环控制程序」· C语言 代码 · 共 38 行

C
38
字号
#include <reg51x.h>
#include "78e65.h"
void Initialize78E65(void)
{
         PCON      =    0;           //CPU in nomal condition
         POR       =    0;           //P4 can't drive LED directly
         P4CONA    =    0;           //P4 as general I/O port
         P4CONB    =    0;
         P0        =    0xff;             //data not confirmed
         P1        =    0xff;             //data not confirmed
         P2        =    0xff;             //data not confirmed
         P3        =    0xcf;        //data to be confirmed, WR,RD,INT1,INT0,TxD,RxD=1; T0,T1=0
         P4        =    0xff;        //data to be confirmed, P4.0,P4.1,INT2,INT3=1
         CHPENR    =    0x87;        //enable CHPCON write attribution
         CHPENR    =    0x59;
         CHPCON    =    0x08;        //disable AUX-RAM, fang 2005.1.8
         CHPENR    =    0;           //disable CHPCON write attribution
         SCON      =    0;           //clear transmition/receiving flag & disable receiving
         WDTC      =    0;           //disable watch dog
         AUXR      =    1;           //disable ALE output, fang 2005.1.8
         PWMCON1   =    0;           //disable all PWM fuction
         PWMCON2   =    0;
         TCON      =    0;           //stop t0, t1, and clear t0/t1 interrupt flag
         TMOD      =    0;
         T2CON     =    0;           //stop t2 and clear t2 interrupt flag
         T2MOD     =    0;
}
//================w78e65 ROM(xdata) en==========
void OSAUX_RAM_EN(char data temp)
{
	if(temp==1){
		CHPENR=0x87;
		CHPENR=0x59;
		CHPCON=0x10;
		CHPENR=0x00;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?