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


Browsing this Thread:   1 Anonymous Users






Re: Set 40MHz 失敗
#3
新會員
新會員


查看用戶資訊
原本的code是想先用FRC, 然後透過Clock switch 選 External Clokc (EC)+PLL. 我是直接把10MHz Oscillator 接上 OSC1 的. OSC2空置.

如果一開始便用EC+PLL, 可以這樣寫嗎? 但好像入不到Puls:

.include "p24hj64gp206.inc"
;configuration bits
config __CONFIG1,FNOSC_PRIPLL & POSCMD_EC & FCKSM_CSDCMD

;Global Declarations.
.global __reset
.global __oscillattorFail
.global __AddressError
.global __StackError
.global __MathError

;start of code
.org 0x000200 ;Void foo__atribut__(address 0x200)
.text

;for erased device default FNOSC=FRC/N, with N=1,FRC is clock source after reset
__reset: mov #__SP_init,w15 ;Initalize the Stack Pointer
mov #__SPLIM_init,w0
mov w0,SPLIM ;Initialize the Stack Pointer Limit Register
nop ;Add NOP to follow SPLIM initialization
mov #0x3000,w0 ;set PLL for 40 MIPS operation
mov w0,CLKDIV
mov #0x001E,w0
mov w0,PLLFBD

;wait PLL to lock
wait_for_lock:
btss OSCCON,#LOCK ;wait for PLL lock
goto wait_for_lock

puls: nop ;low 1
bset PORTB,#5 ;low 1
nop ;hi 1
nop ;hi 1
nop ;hi 1
bclr PORTB,#5 ;hi, 1
bra puls ;low,1 1
.end

發表於: 2009/7/30 14:43
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: Set 40MHz 失敗
#2
版主
版主


查看用戶資訊
你在程式裡使用 config __FNOSC_FRC 的設定所以使用的是內部高速 RC 震盪器,而不是使用外部震盪輸入+PLL。請參考一下 p24hj64gp206.inc 裡對 coonfiguration 的定義:
The following settings are available for FOSCSEL:
;
;   
Oscillator Source Selection:
;     
FNOSC_FRC            Fast RC oscillator
;     FNOSC_FRCPLL         Fast RC oscillator wdivide and PLL
;     FNOSC_PRI            Primary oscillator (XTHSEC)
;     
FNOSC_PRIPLL         Primary oscillator (XTHSECwPLL
;     FNOSC_SOSC           Secondary oscillator
;     FNOSC_LPRC           Low power RC oscillator
;     FNOSC_FRCDIV16       Fast RC oscillator wdivide by 16
;     FNOSC_LPRCDIVN        Low power Fast RC oscillator w/divide by N
;


改成 FNOSC_PRIPLL 的設定項

發表於: 2009/7/29 16:13
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Set 40MHz 失敗
#1
新會員
新會員


查看用戶資訊
本人用PIC24HJ64gp206, 想利用EC (10MHz) 經PLL,使MCU 運行40MHz.
跟據datasheet DS70175H-page 123 寫了附件的程式. 在puls 中希望在pin11 出一個5Mhz 的信號. 但現在只出了460kHz 的信號. 程式有誤嗎? 還是算法有誤?

Attach file:


Link only for registered users

發表於: 2009/7/27 12:22
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... ]

教育訓練中心

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