• slider image 442
  • slider image 497
  • slider image 498
  • slider image 499
  • slider image 500
  • slider image 502
:::


Browsing this Thread:   1 Anonymous Users






Re: dspic3010 初學問題
#4
版主
版主


查看用戶資訊
像底下的例子先攔下下來看是誰出錯再處理
void __attribute__((__interrupt__)) _OscillatorFail(void);
void __attribute__((__interrupt__)) _AddressError(void);
void __attribute__((__interrupt__)) _StackError(void);
void __attribute__((__interrupt__)) _MathError(void);
void __attribute__((__interrupt__)) _DMACError(void);

void __attribute__((__interrupt__)) _AltOscillatorFail(void);
void __attribute__((__interrupt__)) _AltAddressError(void);
void __attribute__((__interrupt__)) _AltStackError(void);
void __attribute__((__interrupt__)) _AltMathError(void);
void __attribute__((__interrupt__)) _AltDMACError(void);

/*
Primary Exception Vector handlers:
These routines are used if INTCON2bits.ALTIVT = 0.
All trap service routines in this file simply ensure that device
continuously executes code within the trap service routine. Users
may modify the basic framework provided here to suit to the needs
of their application.
*/
void __attribute__((__interrupt__)) _OscillatorFail(void)
{
        
INTCON1bits.OSCFAIL 0;        //Clear the trap flag
        
while (1);
}

void __attribute__((__interrupt__)) _AddressError(void)
{
        
INTCON1bits.ADDRERR 0;        //Clear the trap flag
        
while (1);
}
void __attribute__((__interrupt__)) _StackError(void)
{
        
INTCON1bits.STKERR 0;         //Clear the trap flag
        
while (1);
}

void __attribute__((__interrupt__)) _MathError(void)
{
       
        
INTCON1bits.MATHERR 0;        //Clear the trap flag
        
while (1);
}

void __attribute__((__interrupt__)) _DMACError(void)
{

        
        
INTCON1bits.DMACERR 0;        //Clear the trap flag
        
while (1);
}





/*
Alternate Exception Vector handlers:
These routines are used if INTCON2bits.ALTIVT = 1.
All trap service routines in this file simply ensure that device
continuously executes code within the trap service routine. Users
may modify the basic framework provided here to suit to the needs
of their application.
*/

void __attribute__((__interrupt__)) _AltOscillatorFail(void)
{
        
INTCON1bits.OSCFAIL 0;
        while (
1);
}

void __attribute__((__interrupt__)) _AltAddressError(void)
{
        
INTCON1bits.ADDRERR 0;
        while (
1);
}

void __attribute__((__interrupt__)) _AltStackError(void)
{
        
INTCON1bits.STKERR 0;
        while (
1);
}

void __attribute__((__interrupt__)) _AltMathError(void)
{
        
INTCON1bits.MATHERR 0;
        while (
1);
}

void __attribute__((__interrupt__)) _AltDMACError(void)
{
        
INTCON1bits.DMACERR 0;        //Clear the trap flag
        
while (1);
}

發表於: 2006/10/17 14:36
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dspic3010 初學問題
#3
新會員
新會員


查看用戶資訊
那如過真的事發生error trap 那要怎麼解決呢?
另外 我pwm的程式是照書上範例打的,卻也發生了這種狀況

發表於: 2006/10/17 11:46
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dspic3010 初學問題
#2
版主
版主


查看用戶資訊
是否發生了error trap 導致產生NMI 中斷,程式直接跳到Reset的位址執行了(因為default的NMI時執行 goto 0x0000)

發表於: 2006/10/17 11:39
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


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


查看用戶資訊
小弟我最近因實驗室的需要 開始使用dspic 可是卻遇到一個奇怪的問題

現在我是在試著使用pwm
但是每次我透過ICD2要模擬, 他只有頭一兩秒會有pwm的波型輸出 之後ICD2就會有ERROR的訊息發出
另外我甚至有試過 只是將兩根I/O PORT輸出腳 持續作 0和1切換可是卻也產生相同的問題 請問是哪邊出了問題~~

發表於: 2006/10/17 10:14
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... ]

教育訓練中心

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