Re: PIC初學問題
|
||||
---|---|---|---|---|
版主
|
參照:
看樣子光說聲"謝謝"是不夠的,分享一下你的解決方法吧!
發表於: 2009/12/17 10:15
|
|||
|
Re: PIC初學問題
|
||||
---|---|---|---|---|
資深會員
|
這種就是我很討厭的類型 : 只想穫得 不想付出 ( 比問後 不聞不問 好一點點 )
你已穫得解答 , 怎麼解答 ? 稍為回報一下會怎樣 ? 長此下去 , 以後的求問者 , 大概只能得到 " 請參考 XXX DATA SHEET " 的解答了......
發表於: 2009/12/17 4:41
|
|||
|
Re: PIC初學問題
|
||||
---|---|---|---|---|
新會員
|
感謝各位大大詳細的回答, 已獲得解答, 謝謝.
發表於: 2009/12/15 17:40
|
|||
|
Re: PIC初學問題
|
||||
---|---|---|---|---|
資深會員
|
http://www.microchip.com.tw/modules/n ... t_id=30246#forumpost30246
這是觀念問題 , 中斷產生後 會自動將 GIE 清為 0 , 以預防重覆進入 你原先的問題 可能是無法正確進入 中斷程式 , 以致於無法用 RETFIE 返回( 會重設立 GIE ) Attach file: Link only for registered users
發表於: 2009/12/14 18:07
|
|||
|
Re: PIC初學問題
|
||||
---|---|---|---|---|
版主
|
發表於: 2009/12/14 17:19
|
|||
|
PIC初學問題
|
||||
---|---|---|---|---|
新會員
|
請問各位大大 :
我FOLLOWMPLAB C18編譯器用戶指南.pdf的範例程式做測試(程式碼如下), COMPILER IS OK, 但是在做軟體模擬時卻遇到不會進入中斷服務程式的情形, TIMER0OVERFLOW前後相關FSR SATUS如下: Setup 完畢, timer0溢位前 T0CON = 0x9F INTCON = 0xA0 RCON = 0x0C timer0計數至0xFFFFh, 溢位後 T0CON = 0x9F INTCON = 0x24 RCON = 0x0C TMR0H = 0xFF TMR0L = 0x7F 程式中沒有改變INTCON的指令, 為何在溢位後會改變其值, 致使無法進入中斷服務常式? P.S. 我用MICROCHIP C18 TOOLSUIT FOR COMPILER, WATCHDOG DISABLE. #include <p18cxxx.h> #include <timers.h> #define NUMBER_OF_LEDS 8 void timer_isr (void); static unsigned char s_count = 0; #pragma code low_vector=0x18 void low_interrupt (void) { _asm GOTO timer_isr _endasm } #pragma code #pragma interruptlow timer_isr void timer_isr (void) { static unsigned char led_display = 0; INTCONbits.TMR0IF = 0; s_count = s_count % (NUMBER_OF_LEDS + 1); led_display = (1 << s_count++) - 1; PORTB = led_display; } void main (void) { TRISB = 0; PORTB = 0; OpenTimer0 (TIMER_INT_ON & T0_SOURCE_INT & T0_16BIT); INTCONbits.GIE = 1; while (1) { } }
發表於: 2009/12/14 10:49
|
|||
|