• 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: 請教一下,CCS與C18的問題
#3
資深會員
資深會員


查看用戶資訊
基本上,用 CCS 編程並不需要用到 TMR1IF,因為 CCS 會幫您編中斷派遣程式,所以,你只需要編中斷處理程式,然後在主程式中啟動中斷,就完成啦。

#INT_TIMER1
{
}

void main()
{
....
disable_enterrupts(INT_TIMER1);
....
enable_interrupts(INT_TIMER1);
...
}
根本用不到TMR1IF 啊,呵呵

enjoy !

當然啦,如果您要自己編中斷派遣程式也行,請參考下列 HELP 資訊

#INT_GLOBAL


Syntax:
#int_global

Elements:
None

Purpose:
This directive causes the following function to replace the compiler interrupt dispatcher. The function is normally not required and should be used with great caution. When used, the compiler does not generate start-up code or clean-up code, and does not save the registers.

Examples:
#int_global

isr() { // Will be located at location 4

#asm

bsf isr_flag

retfie

#endasm

}

Example Files:
ex_glint.c

Also See:
#int_xxxx

發表於: 2007/3/18 11:26
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請教一下,CCS與C18的問題
#2
資深會員
資深會員


查看用戶資訊
看到您的問題,應該是對暫存器存取的方式不太瞭解。
其實PIR1bits.TMR1IF是在原來C18檔頭中定義。
您要作的是看DataSheet中TMR1IF的定義位址然後在CCS直接用
#bit語法直接定義旗標即可。

發表於: 2007/3/18 1:06
不要問我哪裡來,我只是個流浪天涯的工程師
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


請教一下,CCS與C18的問題
#1
新會員
新會員


查看用戶資訊
我是一位新手,之前用過18f452並使用C18.現在使用16f917,使用CCS.發現先前C18有EX:PIR1bits.TMR1IF(timer1中斷旗標)可使用
CCS我找不到.
想請教各位高手及前輩,CCS有沒有類似PIR1bits.TMR1IF的指令.

發表於: 2007/3/17 4:03
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... ]

教育訓練中心

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