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);
}