Browsing this Thread:
1 Anonymous Users
Topic options
View mode
舊的在前
Re: 我開啟DEMO程式卻出現??
版主
Joined
: 2004/4/30 10:53最後登入時間
: 2021/11/30 18:11
From CAE, Microchip
Group:
站務管理者 註冊會員
Level : 75
HP : 744 / 1861
MP : 5367 / 111040
EXP : 45
確定在 MPLAB IDE 下沒有重複開啟同一Project? 如果沒有的話,就就先關閉所有的 Project 後在重新建立一個新的 Project 看看。
發表於: 2008/7/24 14:33
我開啟DEMO程式卻出現??
初級會員
Joined
: 2007/3/15 16:16最後登入時間
: 2012/12/18 18:16
From 神之王國
Group:
註冊會員
Level : 4
HP : 0 / 92
MP : 11 / 4717
EXP : 68
我有一塊DM300027實驗版 裡面有三個範例! 一個是給30F系列使用! 我有30F4012 IC 去跑這範例: #include "p30F2010.h" // the above include path may be different for each user. If a compile // time error appears then check the path for the file above and edit // the include statement above. #define XTFREQ 7372800 //On-board Crystal frequency #define PLLMODE 16 //On-chip PLL setting #define FCY XTFREQ*PLLMODE/4 //Instruction Cycle Frequency #define BAUDRATE 9600 #define BRGVAL ((FCY/BAUDRATE)/16)-1 int main(void) { ADPCFG = 0xFF; //Make analog pins digital LATE = 0x0; TRISE = 0xF0; //Configure LED pins as output TMR1 = 0; // clear timer 1 PR1 = 0x7270; // interrupt every 250ms IFS0bits.T1IF = 0; // clr interrupt flag IEC0bits.T1IE = 1; // set interrupt enable bit T1CON = 0x8030; // Fosc/4, 1:256 prescale, start TMR1 TRISF = 0xC; U1BRG = BRGVAL; U1MODE = 0x8000; // Reset UART to 8-n-1, alt pins, and enable U1STA = 0x0440; // Reset status register and enable TX & RX _U1RXIF=0; // Clear UART RX Interrupt Flag while(1) { int a; while (_U1RXIF==0); // Wait and receive one Character a = U1RXREG; while(!U1STAbits.TRMT); // Echo back received character with quotes U1TXREG = '"'; while(!U1STAbits.TRMT); U1TXREG = a; while(!U1STAbits.TRMT); U1TXREG = '"'; while(!U1STAbits.TRMT); U1TXREG = ' '; _U1RXIF=0; // Clear UART RX Interrupt Flag } return 0; } void __attribute__((interrupt, no_auto_psv)) _T1Interrupt(void) { IFS0bits.T1IF = 0; // clear interrupt flag LATE ^= 0xF; //Toggle LED's } 開專案有一個檔名LED.mcp 但是都出現 LED.mcp is already open. 為何??
發表於: 2008/7/23 22:35
剛摸PIC的電源工程師 PIC12F508 [font=Impact]剛摸PIC的電源工程師 PIC12F508 [/font]
You can view topic.
你 不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.