• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::

論壇索引


Board index » All Posts (hello074)




dsPIC30F4011如何輸出SPWM?
#1
初級會員
初級會員


如題

請問各位大大

dsPIC30F4011如何輸出SPWM?

程式該如何寫呢?

有可參考的程式嗎?

發表於: 2009/5/30 21:38
頂部


Re: 使用OC模組
#2
初級會員
初級會員


意思是說,除了FRC外

其餘LP、XT、XTL、HS都可以用就對了

是嗎?

發表於: 2009/4/14 9:37
頂部


使用OC模組
#3
初級會員
初級會員


在OC模組,輸出PWM訊號

我設定頻率為20khz,Duty cycle為50.0%

發現到Duty cycle並不是一直都在50.0%

而是49.8%~50.2%晃動

這是什麼原因?timer or .....

另外,馬達的PWM模組也是一樣

難道就不能固定一個值嗎

我想要PWM有0.1%的變化精度

這樣一來就都失真了

有什麼方法可以解決的嗎?

謝謝

發表於: 2009/4/13 11:33
頂部


Re: 使用OC模組
#4
初級會員
初級會員


謝謝,您的建言!!

發表於: 2009/4/13 11:32
頂部


Re: 使用OC模組
#5
初級會員
初級會員


我是使用dsPIC30F4011

這顆PIC不是16bit的嗎?

您說的8bit的解析度

是要去哪裡設定

另外OSC震盪器的選擇

XT,EC,FRC(w/PLLxx)

哪個比較穩定

可以教我嗎?

發表於: 2009/4/13 10:34

Edited by hello074 on 2009年04月13日 11:03:14
頂部


使用OC模組
#6
初級會員
初級會員


在OC模組,輸出PWM訊號

我設定頻率為20khz,Duty cycle為50.0%

發現到Duty cycle並不是一直都在50.0%

而是49.8%~50.2%晃動

這是什麼原因?timer or .....

另外,馬達的PWM模組也是一樣

難道就不能固定一個值嗎

我想要PWM有0.1%的變化精度

這樣一來就都失真了

有什麼方法可以解決的嗎?

謝謝

發表於: 2009/4/13 9:50
頂部


Re: ICD2
#7
初級會員
初級會員


參照:

nicecookie 寫道:
APP020板子的power有接上了嗎


已解決了,謝謝

發表於: 2009/4/12 1:07
頂部


ICD2
#8
初級會員
初級會員


我在連結ICD2時產生了以下字串

Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to target
ICDWarn0020: Invalid target device id (expected=0x101, read=0x0)
...Reading ICD Product ID
Running ICD Self Test
... Failed Self Test. See ICD2 Settings (status tab) for details.
MPLAB ICD 2 Ready

後來我找了一下說明

ICDWarn0020: Invalid target device id (expected=ExpectedID, read=ReadID) (OK)

MPLAB ICD 2 has read the device ID of the target device and found it different than expected for the device type selected within MPLAB IDE. If ReadID is 0 then it is likely that the target device is not powered, not connected, or simply missing. In any case, this is just a warning that MPLAB ICD 2 has not found the expected target device. Click OK to proceed.

請問這是什麼原因

我是使用APP020的板子

我以前安裝時都不會這樣

怎麼解決

發表於: 2009/4/11 14:24

Edited by hello074 on 2009年04月11日 14:54:14
頂部


Re: 輸入捕捉
#9
初級會員
初級會員


[quote]
Ryang 寫道:

如果待量測的 Period 為 10KHz,那 Capture 的計數頻率就要 10MHz,這樣才可以準到 0.1% 的精度。

Capture 的計數頻率是指FCY 還是timer,

如果是timer要設定哪個暫存器?

可以舉例嗎?

發表於: 2009/4/10 16:27
頂部


PIC能處理嗎?
#10
初級會員
初級會員


void main(void)
{
int a=2,c;
int b=0;
int i;


i=b-a;
if(i>0)
c=1;
else if (i<0)
c=3;
while(1);
}

以上是我簡單的程式測試

結果應該為b-a=-2

但是我看了 i 的變數其值為65534

這樣是對的嗎?

雖然可以執行程式

但心裡總是怪怪的

不知以後碰到大程式該怎麼處理

有什麼方法可以顯示負號嗎?

發表於: 2009/4/9 16:41
頂部



(1) 2 3 »



:::

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... ]

教育訓練中心

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