AT89S52 + SST39SF020,代码与电路如下,读取ChipID一直错误,到底是我电路有问题,还是代码有问题?
正确ID应该是B 6BF,我读出的却是 02 1C
电路图中有处错误,WR与RD应该对换下。
(原文件名:无标题.jpg)
sbit LED = P1^0;
sbit A16 = P3^4;
sbit A17 = P3^5;
sbit CE = P1^1;
void main(void)
{
unsigned int i;
char c;
UART_Init();
UART_Puts("uart is ready!
");
A16 = 0;
A17 = 0;
while(1)
{ LED ^= 1;
CE = 0;
XBYTE[0x5555] = 0xAA;
XBYTE[0x2AAA] = 0x55;
XBYTE[0x5555] = 0x90;
c = XBYTE[0x0001];
UART_Putc(c);
c = XBYTE[0x0000];
UART_Putc(c);
XBYTE[0x5555] = 0xAA;
XBYTE[0x2AAA] = 0x55;
XBYTE[0x5555] = 0xF0;
CE = 1;
for(i=10000;i>0;i--);
}
}
我们都用74hc573 ,总线上加4k7上拉电阻!
-----------------------------------------------------------------------
573跟373只是管脚不同,功能都一样的吧?我之前怀疑过上拉,但S52是带上拉的,看过ram扩展,也都没带上拉,是不是可以排除上拉的原因?
一周热门 更多>