• slider image 442
  • slider image 477
  • slider image 479
  • slider image 480
  • slider image 481
  • slider image 482
:::


Browsing this Thread:   1 Anonymous Users






Re: enable clock switch會卡在迴圈中
#6
版主
版主


查看用戶資訊
=0 是指定運算,要用==0 的判斷式才對。

發表於: 2020/12/10 9:25
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: enable clock switch會卡在迴圈中
#5
管理員
管理員


查看用戶資訊
CLKDIV = 0x3000;
OSCTUN = 0x00;
REFOCON = 0x00;
PLLFBD = 0x26;
ACLKCON3 = 0xA4C1;
ACLKDIV3 = 0x07;
PMD1 = 0x00;
PMD2 = 0x00;
PMD3 = 0x00;
PMD4 = 0x00;
PMD5 = 0x00;
PMD6 = 0x00;
PMD7 = 0x00;
__builtin_write_OSCCONH((uint8_t) (0x03));
__builtin_write_OSCCONL((uint8_t) (0x01));
while (OSCCONbits.OSWEN != 0);
while (OSCCONbits.LOCK != 1);

這是我用de33EP256MU806的clock設定
透過MCC 設定 Generate ,讓你交互比對看看
如果方便,你可以貼上你的程式碼,這樣比較好找出問題

發表於: 2020/12/9 14:35
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: enable clock switch會卡在迴圈中
#4
管理員
管理員


查看用戶資訊
while (oscconbits.oswen = 0)
修正成
while (OSCCONbits.OSWEN != 0);
在測試一次程式。

發表於: 2020/12/9 14:18
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: enable clock switch會卡在迴圈中
#3
中級會員
中級會員


查看用戶資訊
Ryang大好

我是用dspic33EP64GS502
是用ICD3 搭配硬體跑debug mode
振盪器是8MHz 所以想用PLL提高到40MHz
若沒開PLL 觀察IO腳的output訊號是正常的(代表程式正常作動)
若開PLL 和clock switch 觀察output沒輸出訊號
停止時顯示卡在while (oscconbits.oswen = 0) 迴圈中

發表於: 2020/12/8 13:39
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: enable clock switch會卡在迴圈中
#2
版主
版主


查看用戶資訊
1. 請問是使用哪一顆 PIC ?

2. 是使用軟體模擬嗎? 在模擬下這些震盪穩定位元是不會變成 1 的,必須使用硬體的開發工具來驗證。

發表於: 2020/12/7 14:33
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


enable clock switch會卡在迴圈中
#1
中級會員
中級會員


查看用戶資訊
各位先進好
我在MCC中設定系統參數時 使用primary clock
若enable PLL 但沒設定clock switch的話 會顯示warning
但若enable clock switch 執行程式時則會卡在while (oscconbits.oswen = 0)
請問是哪裡沒設定到嗎
感謝

發表於: 2020/12/5 22:44
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... ]

教育訓練中心

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