CH376初始化总是失败,输入0x55,输出0xEA。求大神看看问题在哪?使用STC15F2K32S2单片机27M晶振。
/* ?òCH376???ü?? */
void WriteCH376Cmd(uchar mCmd)
{
CH376_DATA_DIR_OUT();
CH376_DATA_DAT_OUT(mCmd);
CH376_A0=1;
DelaymS(10);
CH376_WR=0;
DelaymS(10);
CH376_WR=1;
//CH376_A0=0;
//CH376_DATA_DIR_IN();
//DelayuS(10);
}
void WriteCH376Data(uchar mData)
{
CH376_DATA_DIR_OUT();
CH376_DATA_DAT_OUT(mData);
CH376_A0=0;
DelaymS(10);
CH376_WR=0;
DelaymS(10);
CH376_WR=1;
//CH376_DATA_DIR_IN();
//DelayuS(10);
}
uchar ReadCH376Data( void )
{
ucharmData;
//DelaymS(150);
CH376_DATA_DIR_IN();
CH376_A0=0;
DelaymS(10);
CH376_RD=0;
DelaymS(10);
mData=CH376_DATA_DAT_IN( );
CH376_RD=1;
return(mData);
}