• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
  • slider image 488
  • slider image 491
:::


Browsing this Thread:   1 Anonymous Users






Re: PIC初學問題
#7
版主
版主


查看用戶資訊
參照:

sushying 寫道:
感謝各位大大詳細的回答, 已獲得解答, 謝謝.


看樣子光說聲"謝謝"是不夠的,分享一下你的解決方法吧!

發表於: 2009/12/17 10:15
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC初學問題
#6
資深會員
資深會員


查看用戶資訊
這種就是我很討厭的類型 : 只想穫得 不想付出 ( 比問後 不聞不問 好一點點 )
你已穫得解答 , 怎麼解答 ? 稍為回報一下會怎樣 ?

長此下去 , 以後的求問者 , 大概只能得到 " 請參考 XXX DATA SHEET " 的解答了......

發表於: 2009/12/17 4:41
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC初學問題
#5
新會員
新會員


查看用戶資訊
感謝各位大大詳細的回答, 已獲得解答, 謝謝.

發表於: 2009/12/15 17:40
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC初學問題
#4
資深會員
資深會員


查看用戶資訊
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
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC初學問題
#3
版主
版主


查看用戶資訊
W401 教育訓練的教材再第五章有說明。

http://www.microchip.com.tw/modules/w ... glefile.php?cid=4&lid=236

發表於: 2009/12/14 17:19
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC初學問題
#2
中級會員
中級會員


查看用戶資訊
OpenTimer0( TIMER_INT_ON &
T0_16BIT &
T0_SOURCE_INT &
T0_EDGE_RISE &
T0_PS_1_1 );
WriteTimer0(TMR0_VAL);
INTCON2bits.TMR0IP = 0; //設定為低優先中斷
INTCONbits.TMR0IF = 0;
RCONbits.IPEN = 1; //開啟中斷優先功能
INTCONbits.PEIE = 1; //外設中斷
INTCONbits.GIE = 1; //全域中斷enable

看完你就懂了

發表於: 2009/12/14 13:29
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


PIC初學問題
#1
新會員
新會員


查看用戶資訊
請問各位大大 :
我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
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







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.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------