对于 HSPDM 部分,我将其配置为由 CCU6 触发:
IfxHspdm_setHwRunActiveEdge(g_hspdm,
IfxHspdm_HwRunActiveEdge_rising);
IfxHspdm_setHwRunTriggerSource(g_hspdm, IfxHspdm_HwTriggerSource_CCU6);
IfxHspdm_enableHwRun(g_hspdm);
对于 CCU6 而言,看起来 CCU61 的 T13 是通往 HWRUN 的路线:
所以我在这里配置了 CCU6:
IfxCcu6_Timer_Config timerConfig; IfxCcu6_Timer_initModuleConfig(
timerConfig, MODULE_CCU61); /* Configure the T12 timer
frequency/period (trigger for T13 timer) and T13 timer frequency/period
(trigger * for ADC). Timer T13 starts counting in single shot mode
triggered by a period-match event of the T12 timer. * The period of
the timer T13 represents a delay (from the period-match event of the T12
timer) of the ADC * trigger event. */
timerConfig.base.t12Frequency = CCU6_T12_TIMER_FREQ; /*
Timer T12 frequency */
timerConfig.base.waitingTime = CCU6_T12_TIMER_PERIOD; /*
waitingTime is the period of T12 timer */
timerConfig.base.t13Frequency = CCU6_T13_TIMER_FREQ; /*
Timer T13 frequency */
timerConfig.base.t13Period = CCU6_T13_TIMER_PERIOD; /*
Timer T13 period */ timerConfig.timer =
IfxCcu6_TimerId_t13; /* Select the timer, T13
is the master */ timerConfig.synchronousOperation = FALSE;
/* Disable synchronous start of the timers */
timerConfig.trigger.t13InSyncWithT12 = TRUE; /*
T12 timer starts the T13 timer */ /* Configure the T13
timer start event */ timerConfig.timer13.t12SyncEvent =
IfxCcu6_T13TriggerEvent_onT12Period;
timerConfig.timer13.t12SyncDirection =
IfxCcu6_T13TriggerDirection_onT12CountingUp; /* Apply the
configuration to the CCU6 module */ IfxCcu6_Timer_initModule(
g_timer, timerConfig); //CCU61:COUT63 to HSPDM:HWRUN(0) T13 PWM
channel 63 /* Activate the line ServiceRequest_3 to route the T13
period match event trigger to the HSPDM module */
IfxCcu6_enableInterrupt( MODULE_CCU61,
IfxCcu6_InterruptSource_t13PeriodMatch); /* Configure the T13 timer
for single shot mode */ IfxCcu6_enableSingleShotMode( MODULE_CCU61,
IfxCcu6_TimerId_t13); IfxCcu6_Timer_start( g_timer);
但是 HSPDM 输出未触发。
我做错了什么? 请帮忙。
如何在TC357TA中配置CCU6以触发HSPDM?

关键词: TC357TA HSPDM 微控制器

在TC357TA中配置CCU6以触发HSPDM,您可以使用以下代码:
```
#include "IfxHspdm.h"
#include "IfxCcu6_Timer.h"
Ifx_HSPDM* g_hspdm;
Ifx_CCU6_Timer_Config timerConfig;
Ifx_CCU6_Timer timer;
int main(void)
{
// Initialize HSPDM
IfxHspdm_enableModule(g_hspdm);
IfxHspdm_setHwRunActiveEdge(g_hspdm, IfxHspdm_HwRunActiveEdge_rising);
IfxHspdm_setHwRunTriggerSource(g_hspdm, IfxHspdm_HwTriggerSource_CCU6);
IfxHspdm_enableHwRun(g_hspdm);
// Initialize CCU6
IfxCcu6_Timer_initModuleConfig(&timerConfig, &MODULE_CCU61);
IfxCcu6_Timer_initModule(&timer, &timerConfig);
// Configure CCU61
IfxCcu6_Timer_configureCount(&timer, IfxCcu6_Timer_CountMode_edgeAligned);
IfxCcu6_Timer_enableModule(&timer);
IfxCcu6_Timer_runAsHwSteadyCounter(&timer);
// Wait for the CCU6 to trigger the HSPDM
while (1)
{
// Do something
}
return 0;
}
```
得拥有正确的库和驱动程序,并且已经对TC357TA进行了正确的初始化。
需要将`g_hspdm`和`MODULE_CCU61`替换为实际的HSPDM和CCU6模块的指针或变量。
回复
有奖活动 | |
---|---|
【EEPW电子工程师创研计划】技术变现通道已开启~ | |
发原创文章 【每月瓜分千元赏金 凭实力攒钱买好礼~】 | |
【EEPW在线】E起听工程师的声音! | |
“我踩过的那些坑”主题活动——第001期 | |
高校联络员开始招募啦!有惊喜!! | |
【工程师专属福利】每天30秒,积分轻松拿!EEPW宠粉打卡计划启动! | |
送您一块开发板,2025年“我要开发板活动”又开始了! | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
【我踩过的那些坑】接线错误导致测试数据异常被打赏40分 | |
stm32f103驱动舵机被打赏20分 | |
汽车+汽车电子电阻解释与分析被打赏5分 | |
STM32F103的I2C驱动OLED动态显示被打赏30分 | |
分享汽车通信和多媒体总线结构被打赏20分 | |
【我踩过的那些坑】结构堵孔导致的喇叭无声问题被打赏50分 | |
NUCLEO-U083RC学习历程38+串口通过队列的方式输出两个字符串被打赏20分 | |
【我踩过的那些坑】分享一下调试一款AD芯片的遇到的“坑”被打赏50分 | |
电流检测模块MAX4080S被打赏10分 | |
【我踩过的那些坑】calloc和malloc错误使用导致跑飞问题排查被打赏50分 |