Tip / 登入 to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Translation_Bot
Community Manager
Community Manager
Community Manager

您好,最近再測試互補PWM輸出的時候發現TCPWM的優化馬達通道輸出的互補PWM不太準確,我本來打算使用P6_2和P6_3輸出互補波形,對應資料手冊中的以下通道:

xxwyxj_0-1703758016282.png

並使用HAL庫的函數進行PWM配置,程式段如下:

xxwyxj_1-1703758088729.png

理論上應該輸出10Khz,佔空比為20 %的互补波形,然而实际输出波形却是1.5Khz,50%佔空比:

xxwyxj_2-1703758151256.png

我嘗試過去查閱暫存器值,發現CC0的值是PERIOD的80%,count也正常的在計數,所以一時間不知道問題出在哪裡

 

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/TRAVEO-T2G/CYT4BB%E7%9A%84HAL%E5%BA%93%E5%88%9D%E5%A7%8B%E5%8C%96%E4%BA%92%E8%A1%A5pwm%E8%BE%93%E5%87%BA%E6%B3%A2%E5%BD%A2%E4%B8%8D%E6%AD%A3%E7%A1%AE/td-p/668231

1 解決方案
Translation_Bot
Community Manager
Community Manager
Community Manager

你好,

懷疑還是HAL函式庫函數的問題,因為目前HAL函式庫和PDL函式庫只是用於Modus平台的開發,而Modus目前只支援CYT4BF和CYT2BL兩款lite板。我們主要還是用SDL來針對T2G的開發,您可以先測試下SDL的demo code。

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/TRAVEO-T2G/CYT4BB%E7%9A%84HAL%E5%BA%93%E5%88%9D%E5%A7%8B%E5%8C%96%E4%BA%92%E8%A1%A5pwm%E8%BE%93%E5%87%BA%E6%B3%A2%E5%BD%A2%E4%B8%8D%E6%AD%A3%E7%A1%AE/m-p/668512

在原始文章中檢視解決方案

0
4 回應
Translation_Bot
Community Manager
Community Manager
Community Manager

你好,

懷疑還是HAL函式庫函數的問題,因為目前HAL函式庫和PDL函式庫只是用於Modus平台的開發,而Modus目前只支援CYT4BF和CYT2BL兩款lite板。我們主要還是用SDL來針對T2G的開發,您可以先測試下SDL的demo code。

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/TRAVEO-T2G/CYT4BB%E7%9A%84HAL%E5%BA%93%E5%88%9D%E5%A7%8B%E5%8C%96%E4%BA%92%E8%A1%A5pwm%E8%BE%93%E5%87%BA%E6%B3%A2%E5%BD%A2%E4%B8%8D%E6%AD%A3%E7%A1%AE/m-p/668512

0
Translation_Bot
Community Manager
Community Manager
Community Manager

您好,有SDL函式庫的demo下載連結嘛?

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/TRAVEO-T2G/CYT4BB%E7%9A%84HAL%E5%BA%93%E5%88%9D%E5%A7%8B%E5%8C%96%E4%BA%92%E8%A1%A5pwm%E8%BE%93%E5%87%BA%E6%B3%A2%E5%BD%A2%E4%B8%8D%E6%AD%A3%E7%A1%AE/m-p/668517

0
Translation_Bot
Community Manager
Community Manager
Community Manager

你好,

SDL的連結位址https://myicp.infineon.com/sites/TRAVEODocumentation/Lists/defaultdoclib/Traveo %20II/Traveo% 20II%2...

如果您無法存取MyICP,請參考以下連結註冊帳號申請存取權限

https://www.infineon.com/cms/en/product/microcontroller/#!details

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/TRAVEO-T2G/CYT4BB%E7%9A%84HAL%E5%BA%93%E5%88%9D%E5%A7%8B%E5%8C%96%E4%BA%92%E8%A1%A5pwm%E8%BE%93%E5%87%BA%E6%B3%A2%E5%BD%A2%E4%B8%8D%E6%AD%A3%E7%A1%AE/m-p/668523

0
Translation_Bot
Community Manager
Community Manager
Community Manager

好的,非常感謝

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/TRAVEO-T2G/CYT4BB%E7%9A%84HAL%E5%BA%93%E5%88%9D%E5%A7%8B%E5%8C%96%E4%BA%92%E8%A1%A5pwm%E8%BE%93%E5%87%BA%E6%B3%A2%E5%BD%A2%E4%B8%8D%E6%AD%A3%E7%A1%AE/m-p/668534

0