• 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: 中斷堆疊會爆
#2
版主
版主


查看用戶資訊
1. 你是用 PIC16Fxxx 的元件吧?
2. ADRESH 的轉換值讀到 tempr1 後再減 84 ,如果結果變負值你叫查表程式要去哪裡查,PIC16Fxxx 是用 RETLW 0xNN 方式查表範圍錯誤當然堆疊就錯了。

發表於: 2005/5/16 15:38
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


中斷堆疊會爆
#1
新會員
新會員


查看用戶資訊
我使用下列程式結果會有兩種錯誤的情形,
第一種是程式run一下以會產detctor stack overfllow
第二種則桯式會停在ccnst unsigned char temm[]= 或
const unsigned char temdis[]= 的地方整個程式無法正常run
下方程-34及-85 則是因設定值的關係.
可否幚忙一下...急急急
void isr_c(){ //cpu中斷處
while(_eocf==1)
{}

_emi=0;
adp();
_emi=1;
_eadi=0;
} // A/D convent intrrupt address

ccnst unsigned char temm[]=
{0Xb6,0Xb5,0Xb4,0Xb2,0Xb0,0Xaf,
0Xad,0Xac,0Xaa,0Xa7,0Xa6,0Xa4,
0Xa2,0Xa1,0X9e,0X9d,0X9b,0X99,
0X97,0X94,0X92,0X90,0X8e,0X8c,
0X89,0X87,0X85,0X83,0X81,0X7f,
0X7d,0X7b,0X79,0X76,0X74,0X72,
0X70,0X6e,0X6c,0X6a,0X68,0X66,
0X64,0X62,0X60,0X5f,0X5d,0X5b, 0X59,0X58,0X56,0X54};
const unsigned char temdis[]=
{0x5a,0x59,0x59,0x58,0x57,0x56,
0x56,0x55,0x55,0x54,0x54,0x53,
0x53,0x52,0x52,0x51,0x51,0x50,
0x50,0x4f,0x4e,0x4d,0x4d,
0x4c,0x4c,0x4b,0x4b,0x4a,0x4a,
0x49,0x49,0x48,0x48,0x47,0x47,
0x46,0x46,0x45,0x45,0x44,0x44,
0x43,0x43,0x42,0x42,0x41,0x41, 0x41,0x40,0x40,0x3f,0x3f,0x3e,
0x3e,0x3d,0x3d,0x3c,0x3c,0x3b,
0x3b,0x3a,0x3a,0x39,0x39,0x39,
0x38,0x38,0x37,0x37,0x36,0x36, 0x35,0x35,0x34,0x34,0x34,0x33, 0x33,0x32,0x32,0x31,0x31,0x30, 0x30,0x2f,0x2f,0x2e,0x2e,
0x2d,0x2d,0x2c,0x2b,0x2b, 0x2a,0x2a,0x29,0x29,0x28,0x27, 0x27,0x26,0x26,0x25,0x25,0x24, 0x24,0x23,0x22,0x21,0x21,0x20,
0x20,0x1f,0x1e,0x1d,0x1d,0x1c,
0x1c,0x1b,0x1a,0x1a,0x19,0x18,
0x17,0x16,0x16,0x15,0x14,0x13,
0x12,0x11,0x10,0x10,0x0f};

//*********************************************************
void adp()
{
unsigned int i;
unsigned int tempr,tempr1;
tempr1=_adrh;
if(adsef==1)
{
stemp-=34;
tempr=temm[stemp];
tempr1=_adrh;
tempr1-=84;
temp=temdis[tempr1];
}}

發表於: 2005/5/16 12:23
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... ]

教育訓練中心

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