• slider image 514
  • slider image 516
  • slider image 517
  • slider image 518
  • slider image 519
:::


Browsing this Thread:   1 Anonymous Users






Re: 請問:外部計數怎麼用?
#4
版主
版主


查看用戶資訊
//************************************************
//* Function: Initialize Timer0 *
//************************************************
void InitializeTMR0(void)
{
T0CON=0b10111000; // high to low trigger, 16-bit mode, don't use the prescaler // Initialize Timer0 for using External clock input T0CKI
IPR1bits.TMR0IP=0; // Set Timer0 for Low Priority Interrupt
PIR1bits.TMR0IF=0; // Clear Interrupt flag of Timer 0

// options TMR0H = (0xFFFF-Timer_Count)/256;
// options TMR0L = (0xFFFF-Timer_Count)%256;
PIE1bits.TMR0IE=1; // Enable Timer0 Interrupt
}


或著

OpenTimer0(TIMER_INT_ON & T0_16BIT & T0_EDGE_FALL & T0_SOURCE_EXT & T0_PS 1_1 );

注意一下 不要把 Timer0 與 Timer1 的定義混著用,還有是否有將 timer.h include進來

發表於: 2005/2/17 9:57
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問:外部計數怎麼用?
#3
高級會員
高級會員


查看用戶資訊
謝謝版主,我試著改成OpenTimer(TIMER_INT_ON&T0_16BIT RW&T0 SOURCE_EXT & T0_PS 1_1&T0_OSC1EN_OFF& T0 SYNC EXT OFF),還是不行....
不知道有沒有另外的方法.....

發表於: 2005/2/16 18:26
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問:外部計數怎麼用?
#2
版主
版主


查看用戶資訊
請試著改為 OpenTimer0 ( )

RA4/T0CK 是接到 Timer0

發表於: 2005/2/16 14:47
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


請問:外部計數怎麼用?
#1
高級會員
高級會員


查看用戶資訊
想請問一下各位外部RA4/T0CKI的計數CLOCK要怎麼用?

我的方法:
1.開啟外部計數OpenTimer1(TIMER_INT_ON& T1_16BIT RW&T1 SOURCE_EXT & T1_PS 1_1&T1_OSC1EN_OFF& T1 SYNC EXT OFF)

2.在RA4接上SWITCH當作計數器
這個方法行不通,請各位幫忙解答

發表於: 2005/2/15 20:28
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... ]

教育訓練中心

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