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


Browsing this Thread:   1 Anonymous Users






Re: 为什么进不了外部中断? 请指教
#2
資深會員
資深會員


查看用戶資訊
參照:

tdnx611g 寫道:
#include"p33fj16mc304.h"
int main()
{
_INT0EP=1;//下降沿中断
_INT0IP=6;//中断优先级为6
_INT0IE=1;//中断使能
ADPCFG=0XFF;//禁用ad
TRISC=0;//c口输出,驱动led,只是中断状态
LATC=0xff;//让led全亮
TRISB=0XFF;//中断0的pin,设为输入.
while(1);

}

void _ISR _INT0Interrupt(void)
{
_INT0IF=0;//清中断标志
LATC=0X00;//一旦进入中断,让led全灭.
}


总是进不去中断,int0脚,上皆有上拉电阻.


dsPIC33FJ32MC202/204 and dsPIC33FJ16MC304
devices implement a total of 22 registers for the
interrupt controller:
• INTCON1
• INTCON2
• IFSx
• IECx
• IPCx
• INTTREG

7.3.1 INTCON1 AND INTCON2
Global interrupt control functions are controlled from
INTCON1 and INTCON2. INTCON1 contains the
Interrupt Nesting Disable (NSTDIS) bit as well as the
control and status flags for the processor trap sources.
The INTCON2 register controls the external interrupt
request signal behavior


看一下吧 ~~~ DATASHEET 73頁

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


为什么进不了外部中断? 请指教
#1
新會員
新會員


查看用戶資訊
#include"p33fj16mc304.h"
int main()
{
_INT0EP=1;//下降沿中断
_INT0IP=6;//中断优先级为6
_INT0IE=1;//中断使能
ADPCFG=0XFF;//禁用ad
TRISC=0;//c口输出,驱动led,只是中断状态
LATC=0xff;//让led全亮
TRISB=0XFF;//中断0的pin,设为输入.
while(1);

}

void _ISR _INT0Interrupt(void)
{
_INT0IF=0;//清中断标志
LATC=0X00;//一旦进入中断,让led全灭.
}


总是进不去中断,int0脚,上皆有上拉电阻.

發表於: 2009/10/17 18:42
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... ]

教育訓練中心

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