|
|||||||||||
| 技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng) 驅(qū)動編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機(jī) | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計(jì) | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe |
實(shí)際應(yīng)用問題,大蝦們多指較。 |
| 作者:hpuyuxuan 欄目:單片機(jī) |
程序編譯能過,仿真也能過,就是程序燒到片子上,RA1不輸出高電平,程序好像就不執(zhí)行。 是不是在焊電路的過程中要加什么東西啊,片子是pic16f8628a的,晶振16M。 #include<pic.h> //PIC頭文件 #include<pic16f62xa.h> //PIC16f62x系列頭文件 #define PORTBIT(add,bit) ((unsigned)(&add)*8+(bit)) static bit PORT_0 @ PORTBIT(PORTB,0); //定義PORTB 0位*/ static bit PORT_1 @ PORTBIT(PORTB,1); //定義PORTB 1位*/ static bit PORT_2 @ PORTBIT(PORTB,2); //定義PORTB 2位*/ static bit PORT_3 @ PORTBIT(PORTB,3); //定義PORTB 3位*/ static bit PORT_4 @ PORTBIT(PORTB,4); //定義PORTB 4位*/ static bit PORT_5 @ PORTBIT(PORTB,5); //定義PORTB 5位*/ static bit PORT_6 @ PORTBIT(PORTB,6); //定義PORTB 6位*/ static bit PORT_7 @ PORTBIT(PORTB,7); //定義PORTB 7位*/ void delay (int x); main() { delay(5); di(); TRISB1=TRISB2=0; //RB1 RB2置為輸出口 while(1) //等待中斷 { PORT_1=1; PORT_2=0; } } void delay (int x) { int y; while(x--) { for(y=125;y>0;--y){;} } } |
| 2樓: | >>參與討論 |
| 作者: su_mj000 于 2007/4/22 6:35:00 發(fā)布:
分開設(shè)置試試 TRISB1=0; TRISB2=0; |
|
| 3樓: | >>參與討論 |
| 作者: 蘭天白云 于 2007/4/22 13:20:00 發(fā)布:
片子是pic16f8628a的, 片子是pic16f8628a的, 但頭文件是????????????????????? #include<pic16f62xa.h> //PIC16f62x系列頭文件 PORT_1=1; 有如何讓RA1輸出高電平呢???? |
|
| 4樓: | >>參與討論 |
| 作者: jinling14 于 2007/4/22 16:48:00 發(fā)布:
都是些低級錯(cuò)誤 |
|
|
|
| 免費(fèi)注冊為維庫電子開發(fā)網(wǎng)會員,參與電子工程師社區(qū)討論,點(diǎn)此進(jìn)入 |
Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號 |