主题中讨论的其他器件:HALCOGEN
您好、TI 支持
我想配置两个 PWM 信号。
pwm1:周期10'000us
pwm2:周期2'000us
然后、我想为两个信号启用 PWM 通知、但是到目前为止、只接收 pwm1通知、而 pwm2则不接收任何通知。
以下是我的代码:
int main(void)
{
_enable_IRQ();
_pmuInit_();
_pmuEnableCountersGlobal_();
GlobalTestCounter1 = 0;
GlobalTestCounter2 = 0;
hetSIGNAL_t PWMSignal;
/*Initialise the HET1 timer signal pwm1 */
PWMSignal.duty = 50; //Set PWM duty cycle in %
PWMSignal.period = 10000; //Set PWM period in us
pwmSetSignal(hetRAM1, pwm1, PWMSignal); //set the PWM duty-cylce and period
/*Initialise the HET1 timer signal pwm2 */
PWMSignal.duty = 50; //Set PWM duty cycle in %
PWMSignal.period = 2000; //Set PWM period in us
pwmSetSignal(hetRAM1, pwm2, PWMSignal); //set the PWM duty-cylce and period
/*initialise the HET1 timer module */
hetInit();
pwmStart(hetRAM1,pwm1);//enable the pwm signal, which triggers the adc conversion
pwmEnableNotification(hetREG1,pwm1, pwmEND_OF_PERIOD); /* enable the pwm1 end of period notification */
pwmStart(hetRAM1,pwm2);//enable the pwm signal, which triggers the adc conversion
pwmEnableNotification(hetREG1,pwm2, pwmEND_OF_PERIOD); /* enable the pwm1 end of period notification */
while(1)
{
}
}
void pwmNotification(hetBASE_t * hetREG,uint32 pwm, uint32 notification)
{
/*verify notification source */
if(pwm == pwm1)
{
GlobalTestCounter1++;
}
/*verify notification source */
if(pwm == pwm2)
{
GlobalTestCounter2++;
}
return;
}
在 HalCoGen 中、I 以相同的方式配置 pwm1和 pwm2。 由于我确实获得了 pwm1的 PWM 通知、我猜 HalCoGen 配置是可以的。
我在这里出了什么问题?


