• 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: 請問C18可以只用低(0x18)的中斷嗎?
#3
版主
版主


查看用戶資訊
看一下 Timer1 的方塊圖,因為8-bit MCU 無法一次讀取 16-bit 的 Timer1 的值,所以會有一些特殊的方式來讀取 Timer1 的值。
只要讀寫 Timer1L 的值時,Timer1H 的值才會被寫入會Latch 到暫存器裡。也就是說 Timer1H 無法直接去讀到內容的,因為要考慮到 16-bit 的同步性。

Attach file:



jpg  (0.00 KB)


發表於: 2008/7/8 12:32
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問C18可以只用低(0x18)的中斷嗎?
#2
資深會員
資深會員


查看用戶資訊
大家好:
使用MPLAB V8.10,
我想IPEN=0;是使用高(0x08)中斷=16F中斷.
我想請問版主,為何我使用軟體模擬或ICD2時;
於WATCH視窗看TMR1H和TMR1L,卻只有TMR1L
能看到變化而TMR1H卻不變,能幫忙否解說!
Thanks.

發表於: 2008/7/7 11:01
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


請問C18可以只用低(0x18)的中斷嗎?
#1
資深會員
資深會員


查看用戶資訊
大家好:
使用p18f4423
相關設定如下=>
void init_cpu(void)
{
... //一些I/O設定
RCON=0X00; //IPEN=0;
IPR1=0;
IPR2=0;
INTCON2=0XF0;
INTCON3=0X00;
TMR1IE=1; //只致能TMR1中斷
PR2=0XFF;
CCPR1L=0;
CCPR2L=0;
INTCON=0XC0; //GIE=1,PEIE=1
}
//---------------------------------------------------------------------
#pragma code InterruptVectorLow = 0x18
void InterruptVectorLow (void)
{
_asm
goto InterruptHandlerLow //jump to interrupt routine
_endasm
}
// Low priority interrupt routine
#pragma code
#pragma interruptlow InterruptHandlerLow

void InterruptHandlerLow (void)
{
if(TMR1IF)
{
TMR1IF=0;
TMR1L=(65536-time1_base)%256;
TMR1H=(65536-time1_base)/256;
{
//---------------------------------------------------------------------
// High priority interrupt vector
#pragma code InterruptVectorHigh = 0x08
void InterruptVectorHigh (void)
{
_asm
goto InterruptHandlerHigh //jump to interrupt routine
_endasm
}
//---------------------------------------------------------------------
// High priority interrupt routine
#pragma code
#pragma interrupt InterruptHandlerHigh
//
void InterruptHandlerHigh (void)
{
//沒有功能,只是測試
}
我的問題=>
1.一開始是高(0x08)中斷沒有寫,不知到程式執行到那兒?
2.加了高(0x08)中斷後為何一直執行高(0x08)中斷呢?
不解;因我已將高(0x08)中斷除能,為何還會進入高(0x08)中斷?
煩請先進幫忙解說,Thanks.

發表於: 2008/7/7 9:19
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... ]

教育訓練中心

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