• 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: (PIC16F1769) PRG的LR bit 無法設定
#5
版主
版主


查看用戶資訊
貼圖只要是 jpg 檔其大小不可超過 1M Bytes 即可加在底下的“選擇檔案”後用 upload 送出。

發表於: 2021/8/20 11:08
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: (PIC16F1769) PRG的LR bit 無法設定
#4
初級會員
初級會員


查看用戶資訊
版主您好,

抱歉,我試很久都不知道怎麼附加圖片,用ZIP檔。

圖一是開啟您給的檔案,裡面是 沒將LR打開。
圖二是我的MCC設定。
圖三與圖四是示波器顯示結果,但長得一模一樣。

謝謝。

Attach file:


Link only for registered users

發表於: 2021/8/20 10:47
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: (PIC16F1769) PRG的LR bit 無法設定
#3
版主
版主


查看用戶資訊
以下是 Edward Lee 的回覆,全文照貼:

從他的貼文,看不出他怎麼驗證斜率。
若他有買我的書,可以參考p.281,使用MCC產生基本PRG設定,並使用OPA接到PRG,就可以直接用示波器看PRG的輸出結果。
這個Bit我經常使用,MCC產生的程式沒問題,可用來先驗證客戶的環境是否正確。
並可以直接比對程式,比對不太對的地方。

看PRG1CON0 = 0x88; 這是上升Ramp,客戶要用在電壓控制模式?
可參考書中p.254的設定,會自動計算上升Ramp,測試結果在p.256。
附件是範例可以給客戶參考,用MCC產生的,原本是給買書的客戶^^

Attach file:


Link only for registered users

發表於: 2021/8/19 14:09
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: (PIC16F1769) PRG的LR bit 無法設定
#2
版主
版主


查看用戶資訊
這斜率補償的設定我要問一下專職在 Hybrid Power 的工程師,請稍待。

發表於: 2021/8/19 13:37
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


(PIC16F1769) PRG的LR bit 無法設定
#1
初級會員
初級會員


查看用戶資訊
各位先進前輩您好,

Datasheet顯示在PIC16F1769與PIC16F1768 時可使用(PRG1CON2)LR bit 調整Ramp的斜率,

但是 經過測試,LR bit 無法設定進去,斜率與 該Bit是0的時候一樣,
且 利用變數讀出設定值時,LR一樣是0。
想請問是否遺漏了甚麼嗎?
Cpde 如下:

void PRG1_Initialize(void)
{
// RG1GO not operating; RG1EN enabled; RG1MODE rising ramp generator; RG1OS disabled; RG1REDG level_sensitive; RG1FEDG level_sensitive;
PRG1CON0 = 0x88;
// RG1FPOL active_low; RG1RPOL active_high;
PRG1CON1 = 0x02;
// INS DAC3_output;
PRG1INS = 0x05;
// RG1ISET 0.04 V/us; LR enabled;
PRG1CON2 = 0x80;
// RTSS PWM3_output;
PRG1RTSS = 0x05;
// FTSS PWM3_output;
PRG1FTSS = 0x05;

}

void main(void)
{
// initialize the device
SYSTEM_Initialize();

// When using interrupts, you need to set the Global and Peripheral Interrupt Enable bits
// Use the following macros to:


// Enable the Global Interrupts
INTERRUPT_GlobalInterruptEnable();

// Enable the Peripheral Interrupts
INTERRUPT_PeripheralInterruptEnable();

// Disable the Global Interrupts
//INTERRUPT_GlobalInterruptDisable();

//Disable the Peripheral Interrupts
//INTERRUPT_PeripheralInterruptDisable();

PRG1_StartRampGeneration();
while (1)
{
// Add your application code
a = PRG1CON2;
}
}

謝謝。

發表於: 2021/8/18 20:13
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... ]

教育訓練中心

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