TC387 MCAL配置PWM
时间: 2023-08-25 11:09:15 浏览: 490
MC-ISAR-TC3xx-UM-Pwm-17-GtmCcu6
根据提供的引用内容,TC387 MCAL配置PWM的步骤如下:
1. 首先,需要初始化端口和PWM模块。通过调用Port_Init函数和Pwm_17_Gtm_Init函数来完成端口和PWM的初始化。
2. 在调度代码中,可以设置PWM的占空比和周期。通过设置PWM_00_9_DutyCycle和PWM_00_9_Perid来指定占空比和周期的数值。
3. 使用Pwm_17_Gtm_SetPeriodAndDuty函数来设置PWM的周期和占空比。通过传入Pwm_17_GtmConf_PwmChannel_PwmChannel_MCU_PWMOUT1_0作为通道参数,以及PWM_00_9_Perid和PWM_00_9_DutyCycleTicks作为周期和占空比的数值。
4. 配置触发ADC采集的PWM通道2。需要将ShiftValue配置为延迟的相位值,并将PwmReferenceChannel设置为PWM通道1。确保配置的时钟源相同,并选择相邻的GTM通道。关联通道的ChannelClass需要配置为PWM_FIXED_PERIOD_SHIFTED,并选择GTM_TOM0_7作为PWM通道的源定时器。
5. 最后,进行ADC相关的配置。
综上所述,以上是TC387 MCAL配置PWM的步骤。
#### 引用[.reference_title]
- *1* [基于EB工具的TC3xx_MCAL配置开发02_ICU模块配置](https://blog.csdn.net/initiallizer/article/details/129391852)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [MCAL知识点(八):PWM驱动配置详解](https://blog.csdn.net/weixin_43580890/article/details/129830934)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [基于EB工具的TC3xx_MCAL配置开发05_ADC模块硬件Pwm触发Demo配置](https://blog.csdn.net/initiallizer/article/details/129718915)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文