Re: (PIC16F1769) PRG的LR bit 無法設定
|
||||
---|---|---|---|---|
版主
|
貼圖只要是 jpg 檔其大小不可超過 1M Bytes 即可加在底下的“選擇檔案”後用 upload 送出。
發表於: 2021/8/20 11:08
|
|||
|
Re: (PIC16F1769) PRG的LR bit 無法設定
|
||||
---|---|---|---|---|
初級會員
|
版主您好,
抱歉,我試很久都不知道怎麼附加圖片,用ZIP檔。 圖一是開啟您給的檔案,裡面是 沒將LR打開。 圖二是我的MCC設定。 圖三與圖四是示波器顯示結果,但長得一模一樣。 謝謝。 Attach file: Link only for registered users
發表於: 2021/8/20 10:47
|
|||
|
Re: (PIC16F1769) PRG的LR bit 無法設定
|
||||
---|---|---|---|---|
版主
|
這斜率補償的設定我要問一下專職在 Hybrid Power 的工程師,請稍待。
發表於: 2021/8/19 13:37
|
|||
|
(PIC16F1769) PRG的LR bit 無法設定
|
||||
---|---|---|---|---|
初級會員
|
各位先進前輩您好,
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
|
|||
|