Re: PIC24FJ128GB106 PWM頻率問題
|
||||
---|---|---|---|---|
新會員
|
您好,感謝回覆
我使用的是mcc的程式生成,以下是相關code oc1的設定。 參照:
timer2的設定。 參照:
原本想放上截圖但圖片無法插入,以上是mcc生成的code 謝謝。
發表於: 2020/11/30 11:07
|
|||
|
Re: PIC24FJ128GB106 PWM頻率問題
|
||||
---|---|---|---|---|
管理員
|
OCxRS/OCxR 在PWM模式下,是Dual Buffer的架構,主要是避免突然改變數值造成當前周期的PWM工作週期異常的狀態。
以上是多說了。 簡單的說,OCxRS/OCxR就是改變周期的,PRx則是改變頻率的。 如果動作不正常就是操作上有錯誤,是否可以把你的程式碼上傳來看看,或許能找到問題點。
發表於: 2020/11/30 9:45
|
|||
|
PIC24FJ128GB106 PWM頻率問題
|
||||
---|---|---|---|---|
新會員
|
各位前輩好,小弟目前剛碰PIC24的晶片,以前也沒有過相關經驗,還請各位前輩多多賜教
我目前正在製作PWM,用的是PIC24FJ128GB106這塊晶片,使用MPLAB X IDE內的MCC撰寫程式 我上網查資料以及看了datasheet後有些地方一直不了解。 根據datasheet中pwm的頻率公式是:PWM Period = [(PRy) + 1] • TCY • (Timer Prescale Value) 裡面說明與PRy有關係。 但是測試後發現幾個問題: 1、我在調整PWM的DUTY時更動OCxRS OCxR 這兩個暫存器時竟然會連帶影響到PWM的頻率 2、根據原理,我調整PR2(我使用TIMER2)時並不會改變PWM的頻率 3、根據理論,當我的PR2+1 感謝
發表於: 2020/11/29 20:56
|
|||
|
Re: ATWINC3400
|
||||
---|---|---|---|---|
初級會員
|
if I use XIN32/XOUT32 of ATSAME51N19A to connect a 32.768khz crystal, can I connect the XOUT32 to RTC_CLK of ATWINC3400 to save the component count?
do I need to add a buffer like 74lvc04 to reshape the waveform? or I can configure one GPIO to output the 32.768khz? If the MCU is put into sleep mode, is the output still running? PS. suppose the ATWINC need a free running 32.768khz in power down mode(CHIP_EN=LOW) Anthony
發表於: 2020/11/28 12:01
|
|||
best regards,
Anthony |
||||
|
Re: dspic33ch PGXCAP問題
|
||||
---|---|---|---|---|
新會員
|
你好,我是用PWM模組裡面,有一個PCI功能,有外部訊上升緣RESET我PWM的timer,
是即時運作開關訊號,偵測開關頻率需使用PGXCAP功能, 不用SCCP模組Capture功能是因為會有兩個中斷, PWM中斷和Capture中斷互搶可能性,所以沒用SCCP的Capture功能
發表於: 2020/11/27 17:15
|
|||
|
Re: dspic33ch PGXCAP問題
|
||||
---|---|---|---|---|
版主
|
有點困惑? 為什這要抓外部頻率不是用 Capture Module 來量測頻率 (10.0 CAPTURE/COMPARE/PWM/
TIMER MODULES (SCCP) )。 我也不懂為何 PWM 可以量測頻率?
發表於: 2020/11/27 13:55
|
|||
|
Re: PIC16F18855的CIP功能,可由軟體來觸發嗎?
|
||||
---|---|---|---|---|
高級會員
|
了解,謝謝版主
發表於: 2020/11/27 11:03
|
|||
|
Re: PIC16F18855的CIP功能,可由軟體來觸發嗎?
|
||||
---|---|---|---|---|
版主
|
這些都是透過暫存器的設定依外界電壓啟動 ZCD 的。所以也可以用軟體方式變更或修改暫存器來控制硬體的出發輸出。
發表於: 2020/11/27 9:42
|
|||
|
Re: PIC16F18855的CIP功能,可由軟體來觸發嗎?
|
||||
---|---|---|---|---|
版主
|
這些都是透過暫存器的設定依外界電壓啟動 ZCD 的。所以也可以用軟體方式變更或修改暫存器來控制硬體的出發輸出。
發表於: 2020/11/27 9:42
|
|||
|