最近在学习这款芯片的使用,本人照着手册上的时序图进行函数的编写,可是怎么调都无法成功
void WriteRawIO(unsigned char Address,unsigned char value)
{
#if 1
ALE=0;
RC500CS=1;
WR=1;
RD=1;
AD_OUT();
ALE=1;
OUTPORT(Address);
__nop();
ALE=0;
RC500CS=0;
__nop();
WR=0;
__nop();
OUTPORT(value);
__nop();
WR=1;
__nop();
RC500CS=1;
#endif
}
unsigned char ReadRawIO(unsigned char Address)
{
#if 1
unsigned char data;
ALE=0;
RC500CS=1;
WR=1;
RD=1;
AD_OUT();
ALE=1;
OUTPORT(Address);
__nop();
ALE=0;
AD_IN();
RC500CS=0;
__nop();
RD=0;
__nop();
data = INPORT;
__nop();
RD=1;
__nop();
RC500CS=1;
return data;
}
在读取的时候无法成功读取
xbyte_temp = ReadRawIO(RegPage);