国产精品无码一区二区三区A片_无码狠狠躁久久久久久久91_国产精品久久久久久久_国产99九九久久无码熟妇_国产人妻精品久久久久野外_久久夜色精品国产欧美乱极品_91精品国产色综合久久不卡98口_精品人妻系列无码人妻免费视频

技術(shù)熱線: 4007-888-234
設(shè)計(jì)開(kāi)發(fā)

專注差異化嵌入式產(chǎn)品解決方案 給智能產(chǎn)品定制注入靈魂給予生命

開(kāi)發(fā)工具

提供開(kāi)發(fā)工具、應(yīng)用測(cè)試 完善的開(kāi)發(fā)代碼案例庫(kù)分享

技術(shù)支持

從全面的產(chǎn)品導(dǎo)入到強(qiáng)大技術(shù)支援服務(wù) 全程貼心伴隨服務(wù),創(chuàng)造無(wú)限潛能!

新品推廣

提供新的芯片及解決方案,提升客戶產(chǎn)品競(jìng)爭(zhēng)力

新聞中心

提供最新的單片機(jī)資訊,行業(yè)消息以及公司新聞動(dòng)態(tài)

PIC16F877擴(kuò)展6264的程序

更新時(shí)間: 2019-03-26
閱讀量:1973

# include # define unch unsigned char # define unint unsigned int # define OE RE0 # define WR RE1 # define GS RE2 //373鎖存器的片選端

//延時(shí)程序 void delay(void) { unint i; for(i = 0;i < 0xfff;i++) continue; } //RAM讀程序 void read(unch *data,unint address,unch num) { unint addressl,addressh; unint i; for(i = 0;i < num;i++,data++) { addressh = address % 256; addressl = address / 256; TRISE = 0x00; //設(shè)置RE端為輸出 TRISD = 0x00; TRISB = 0x00; GS = 1; //鎖存器的使能端 PORTD = addressl; //D口設(shè)置為地址低8PORTB = addressh; //A口設(shè)置為地址高5asm("nop"); asm("nop"); GS = 0; WR = 1; OE = 0; TRISD = 0xFF; *data = PORTD; //讀入數(shù)據(jù) asm("nop"); asm("nop"); OE = 1; address = address + 1; } } //RAM寫程序 void write(unch *data, unint address, unint num) { unint addressl,addressh; unint i; for(i = 0;i < num; i++,data++) { addressh = address % 256; addressl = address / 256; TRISE = 0x00; //設(shè)置RE口為輸出 TRISD = 0x00; TRISB = 0x00; GS = 1; //鎖存器的使能端 PORTD = addressl; //D口設(shè)置為地址低8PORTA = addressh; //A口設(shè)置為地址低5asm("nop"); asm("nop"); GS = 0; //鎖存地址 WR = 0; PORTD = *data; asm("nop"); asm("nop"); WR = 1; address = address + 1; } }

main() { unch string[],str[5]={0x23,0x34,0x54,0x23,0x72}; write(str,0,5); TRISA = 0xFF; TRISB = 0xFF; TRISE = 0xFF; TRISD = 0xFF; read(string,0,5); while(1); }