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


Browsing this Thread:   4 Anonymous Users






Re: 正邏輯/負邏輯設定
#4
版主
版主


查看用戶資訊
之前已經說是在燒錄時設定的,請參考一下 30f4011.h 後面的宣告,如下所示:

所以要設定 Active 的輸出是Hi 或是 Low 就要使用PWMH_ACT_HI .... 的定義,Default 是 Active High 的。

#define _FBORPOR(x) __attribute__((section("__FBORPOR.sec,code"))) int _FBORPOR = (x);

#define MCLR_EN 0xFFFF
#define MCLR_DIS 0x7FFF
#define RST_IOPIN 0xFFFF
#define RST_PWMPIN 0xFBFF
#define PWMxH_ACT_HI 0xFFFF
#define PWMxH_ACT_LO 0xFDFF
#define PWMxL_ACT_HI 0xFFFF
#define PWMxL_ACT_LO 0xFEFF
#define PBOR_ON 0xFFFF
#define PBOR_OFF 0xFF7F
#define BORV_20 0xFFFF
#define BORV_27 0xFFEF
#define BORV_42 0xFFDF
#define BORV_45 0xFFCF
#define PWRT_OFF 0xFFFC
#define PWRT_4 0xFFFD
#define PWRT_16 0xFFFE
#define PWRT_64 0xFFFF

發表於: 2009/7/1 15:53
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 正邏輯/負邏輯設定
#3
新會員
新會員


查看用戶資訊
我已經找到在哪裡做設定了!
_FOSC(CSW_FSCM_OFF & XT_PLL8); // XT with 8xPLL oscillator, Failsafe clock off
_FWDT(WDT_OFF); // Watchdog timer disabled
_FBORPOR(PBOR_OFF & MCLR_EN); //Brown-out reset disabled, MCLR reset enabled
_FGS(CODE_PROT_OFF); // Code protect disabled



謝謝了!

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


Re: 正邏輯/負邏輯設定
#2
版主
版主


查看用戶資訊
dsPIC30F4011 的 MCPWM 輸出是以 Active(做動)的方式來看,你可以將此 Active 當作是 Hi 動作或是 Low 動作,這個動作是在燒錄時做決定的。

FBORPOR Register in the Configuration Words
Set the Motor Control PWM Module High Side Polarity
HPOL bit 
=PWM Module high-side is active-high
HPOL bit 
=PWM Module low-side is active-low
Set the Motor Control PWM Module Low Side Polarity
LPOL bit 
=PWM Module high-side is active-high
LPOL bit 
=PWM Module low-side is active-low

OVDCON Register
POVD4H
~POVD1L
=PWMxx I/O pin is PWM output
=PWMxx I/O pin is corresponding POUTxx bit
POUT4H
~POUT1L
=PWMxx I/O pin is driven ACTVE
=PWMxx I/O pin is driven INACTIVE

發表於: 2009/6/23 10:30
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


正邏輯/負邏輯設定
#1
新會員
新會員


查看用戶資訊
在dsPIC30F4011MCU中一般的PWM範例程式PWM皆為正邏輯的PWM,要如何由程式中改成負邏輯呢?

發表於: 2009/6/19 18:10
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... ]

教育訓練中心

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