AT93C46/56/55串行EEPROM及单片机程序
RT1,5?′;
本文链接地址:http://www.oyaya.net/fanwen/view/160387.html
DECLARE CLRDI LITERALLY ‘CALL BITCLR?. IOPORT1,5?′;
EWEN:PROCEDURE PUBLIC;
DECLARE I BYTE;
CLRCS; CLRDI; CLRCLK;
SETCS; SETDI; SETCLK;
DO I=1 TO 2;
CLRCLK; CLRDI; SETCLK;
END;
DO I=1 TO 2;
CLRCLK; SETDI; SETCLK;
END;
DO I = 0 TO 6;
CLRCLK; SETDI; SETCLK;
END;
CLRCLK; CLRCS; SETCS;
SETCLK; CLRCLK;
END EWEN;
READ:PROCEDURE(ADDR) PUBLIC;
DECLARE (ADDR,I,COUNT) BYTE;
CLRCS; CLRDI;
CLRCLK; SETCS;
DO I= 1 TO 2;
CLRCLK; SETDI; SETCLK;
END;
DO I =1 TO 2;
CLRCLK; CLRDI; SETCLK;
DO COUNT=1 TO 7;
BITOUT(COUNT)=SHR(BITOUT(COUNT),1);
END;
CLRCS; CLRDI; CLRCLK;
CALL TIME(100);
SETCS; CLRC;
END READ;
WRITE: PROCEDURE(ADDR,DATA) PUBLIC;
DECLARE (ADDR,DATA) BYTE;
CLRCS; CLRDI; CLRCLK;
SETCS; SETDI; SETCLK;
CLRDI; CLRCLK; SETCLK;
SETDI; CLRCLK; SETCLK;
END;
DO I =-1 TO 8;
X=ROL(ADDR,1);
《AT93C46/56/55串行EEPROM及单片机程序(第3页)》