📄 init_65.c
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -