乖女从小被C到大H文NP|人妻洗澡被强公日日澡电影|小柔被六个男人躁到早上电影|被男人吃奶跟添下面特舒服|被绑在坐桩机上抹春药BL推文

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

專(zhuān)注差異化嵌入式產(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ú)限潛能!

新品推廣

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

新聞中心

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

PIC16F877擴(kuò)展6264的程序

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

# 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寫(xiě)程序 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); }

 



子长县| 青冈县| 蒲城县| 灌云县| 合川市| 札达县| 大方县| 凭祥市| 新安县| 忻州市| 丰城市| 达州市| 黄骅市| 兴山县| 金秀| 榆社县| 邵阳市| 定西市| 石楼县| 孝义市| 通道| 蒙自县| 紫阳县| 资阳市| 酒泉市| 资中县| 防城港市| 连江县| 沂南县| 乐至县| 舒城县| 北票市| 剑川县| 萍乡市| 酒泉市| 濮阳市| 龙州县| 安龙县| 沧源| 孟津县| 沙坪坝区|