• 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: PIC16F18877的PWM 如何做出互補波型?
#2
版主
版主


查看用戶資訊
剛檢視了PIC16F18877 他是PIC16F877A 的進階版,裡面的 Timer2 PWM 仍屬於傳統的架構,他無法有互補的輸出。但是可以在MCC 下使用 CLC 將 PWM 的內部輸出在 CLC 做反向輸出這樣就有互補的輸出。 但是此互補輸出沒有 Dead-Time Delay 功能,在做推挽輸出時要注意。 標準的 推挽式或橋式輸出 是 PIC16F684,他內部的模組是: ENHANCED CAPTURE /COMPARE/PWM (WITH AUTO-SHUTDOWN AND DEAD BAND) MODULE。可以參考看看。 另外,與 PIC16F18877 腳位相容的元件 PIC18F45K22 它內建 Ehanced PWM Module (如附圖)。可以直接互補輸出 PWM.

Attach file:



jpg  擷取.JPG (108.51 KB)
16_60f8f0222496d.jpg 944X537 px

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


PIC16F18877的PWM 如何做出互補波型?
#1
新會員
新會員


查看用戶資訊
#include
#include
#include

#pragma config FEXTOSC = HS // External Oscillator mode selection bits (HS (crystal oscillator) above 4MHz; PFM set to high power)
#pragma config RSTOSC = EXT1X // Power-up default value for COSC bits->EXTOSC operating per FEXTOSC bits
#pragma config BOREN = ON // Brown-out reset enable bits (Brown-out Reset Enabled, SBOREN bit is ignored)
#pragma config WDTE = OFF // WDT operating mode (WDT Disabled, SWDTEN is ignored)
#pragma config CP = OFF // UserNVM Program memory code protection bit (Program Memory code protection disabled)
#pragma config CPD = OFF // DataNVM code protection bit (Data EEPROM code protection disabled)
void Initialize(void);

void main(void) {
Initialize();

while (1) {

}

return;
}

void Initialize(void) {
OSCCON1 = 0x70;
OSCFRQ = 0x04;
TRISE = 0x07;
ANSELE = 0x06;
TRISC = 0xFB;
RC2PPS = 0x09;
T2CLKCON = 0x01;
T2HLT = 0x00;
T2RST = 0x00;
T2PR = 0x72;
T2TMR = 0x00;
PIR4bits.TMR2IF = 0;
T2CON = 0x8F;
CCP1CON = 0x8F;
CCPR1H = 0x00;
CCPR1L = 0x90;
CCPTMRS0bits.C1TSEL = 0x1;
}

已經摸出如何輸出波行了 但想知道如何一次輸出兩個波型

發表於: 2021/7/21 17:33
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... ]

教育訓練中心

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