求助:初始化完成后中断引脚一直为低电平,读SSR寄存器为0xFF,读IIR寄存器也是0xFF。
初始化后寄存器配置如下:为写入后读出来的数据
IER: 00 IIR: 01 LCR: 00 MCR: 00 LSR: 60 MSR: 00 SCR: ab FCR: 01
读写操作例程如下
void CH438WriteReg(unsigned char add,unsigned char data)
{
SetOutPut();
Writedata(add);
SET_CS_L();
SET_ALE_H();
Ddl_Delay1us(1);
SET_ALE_L();
Writedata(data);
SET_WR_L();
Ddl_Delay1us(1);
SET_WR_H();
SET_CS_H();
}
unsigned char CH438ReadReg(unsigned char addr)
{
unsigned char value;
SetOutPut();
Writedata(addr);
SET_CS_L();
SET_ALE_H();
Ddl_Delay1us(1);
SET_ALE_L();
SetInPut();
SET_RD_L();
Ddl_Delay1us(1);
value = ReadData();
SET_RD_H();
SET_CS_H();
return value;
}