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


Browsing this Thread:   1 Anonymous Users






Re: 請教兩個問題
#3
版主
版主


查看用戶資訊
使用 Capture時,Timer 不是可以產生中斷嗎? 在偵測到上緣時將Timer 歸零,如果再下降緣偵測到之前可以看Timer 發生了幾次的中斷。比如說三次中斷 + 現在的 Timer 值 =0x3E0=992

以 1uS Timer 輸入時間則為 : 1uS (65536 x3 + 992) = 197600uS = Hi 週期的時間,再乘二就是整個週期 = 2.53Hz

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


Re: 請教兩個問題
#2
版主
版主


查看用戶資訊
你那一段 config 的設定不是針對 Hi-Tech PICC 的語法。 Hi-Tech PICC 的 Configuration 定義在相關的 元件.h 檔裡,如下所示:
且正確的使用方式
__CONFIG ( HS & WDTDIS & PWRTEN & BORDIS & LVPDIS & UNPROTECT );

Configuration Mask Definitions
#define CONFIG_ADDR    0x2007
// Fail-Safe clock monitor 
#define FCMEN        0x3FFF
#define FCMDIS        0x37FF
// Internal External Switch Over 
#define IESOEN        0x3FFF
#define IESODIS        0x3BFF
// Brown-out detect modes 
#define BOREN        0x3FFF
#define BOREN_XSLP    0x3EFF
#define SBOREN        0x3DFF
#define BORDIS        0x3CFF
// Protection of data block 
#define UNPROTECT    0x3FFF
#define CPD        0x3F7F
// Protection of program code 
#define UNPROTECT    0x3FFF
#define PROTECT        0x3FBF
// Master clear reset pin function
#define MCLREN        0x3FFF
#define MCLRDIS        0x3FDF
// Power up timer enable 
#define PWRTDIS        0x3FFF
#define PWRTEN        0x3FEF
// Watchdog timer enable 
#define WDTEN        0x3FFF
#define WDTDIS        0x3FF7
// Oscillator configurations 
#define RCCLK        0x3FFF
#define RCIO        0x3FFE
#define INTCLK        0x3FFD
#define INTIO        0x3FFC
#define EC        0x3FFB
#define HS        0x3FFA
#define XT        0x3FF9
#define LP        0x3FF8

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


請教兩個問題
#1
中級會員
中級會員


查看用戶資訊
小弟我剛接觸pic16f690,想請教各位大大兩個問題:
1.程式開頭的configuration設定,如__CONFIG ( HS_OSC & BODEN_ON & WDT_OFF & CP_OFF & LVP_OFF & DEBUG_ON ) ( )內容的設定在哪可以查的到勒?
2.小弟要量測一週期性的訊號,用capture的Timer1 16位元量測,用內部chip的RC震盪,指令時間為1us,若用以下這種寫法:
if(timer_edge[1]>=timer_edge[0])
{period=timer_edge[1]-timer_edge[0];}
else
{period=65536+timer_edge[1]-timer_edge[0];}

最慢可以量測到1000000/65536=15.25Hz的頻率,若要量測更低的頻率,如量測到5Hz要如何修改程式勒?

以上兩個問題可否請有經驗的大大幫小弟解惑囉,阿哩阿都~~~

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

教育訓練中心

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