Problem in producing Complimentary PWM using RTDs

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Problem in producing Complimentary PWM using RTDs

跳至解决方案
2,534 次查看
abdul_rahman
Contributor IV

Hi NXP team,

I'm trying to prepare a project to make S32K344 controller to produce complimentary PWM outputs with a single eMIOS instance. I've tried using the presentation example, which was attached in one of the questions in the forum, which I've attached it for your reference. I've also gone through the application notes of the 3-phase sensorless PMSM controller from NXP. The main.c file of my code is,

 

int main(void)
{
/* Initialize clock () */
Clock_Ip_Init(&Clock_Ip_aClockConfig[0]);
 
/* Initialize all pins using the Port driver */
Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);
 
/* Initialize Emios_Mcl driver */
Emios_Mcl_Ip_Init(INSTANCE_0, &Emios_Mcl_Ip_0_Config_BOARD_INITPERIPHERALS);
 
/* Initialize Emios_Pwm_Ip driver */
Emios_Pwm_Ip_InitChannel(EMIOS_PWM_IP_I0_CH1_CFG, &Emios_Pwm_Ip_I0_Ch1);
 
/* Set new period for the channels that used external counter bus */
Emios_Mcl_Ip_SetCounterBusPeriod(INSTANCE_0, CHANNEL_0, 0x8000);
 
/* Duty cycle = 50% */
    Emios_Pwm_Ip_SetDutyCycle(INSTANCE_0, CHANNEL_0, 0x4000);
 
    /* De-Initialize Emios_Pwm_Ip driver */
    //Emios_Pwm_Ip_DeInitChannel(INSTANCE_0, CHANNEL_0);
 
    Trgmux_Ip_Init(&Trgmux_Ip_xTrgmuxInitPB);
 
    //Lcu_Ip_SetSyncInputMuxSelect (LCU_IP_SYNC_SEL_INPUT0, 1U);
    Lcu_Ip_Init(&Lcu_Ip_xLcuInitPB);
    Comp_PWMList[0U].Value = LCU_IP_OUTPUT_ENABLE;
    Comp_PWMList[1U].Value = LCU_IP_OUTPUT_ENABLE;
    Lcu_Ip_SetSyncOutputEnable (&Comp_PWMList[0U], 2);
 
    return 0U;
}
 
I have attached the entire project file for your reference. I've been on this code for over a week and I'm able to find out the bugs in my program. Please look into the errors I've made in preparing the code and also suggest me the solution to it. It would be really helpful.
 
#S32K344 #emios #LCU #TRGMUX #PWM
标记 (4)
0 项奖励
回复
1 解答
2,497 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@abdul_rahman

please refer to the link below 

https://community.nxp.com/t5/S32K/LCU-out-PWM/td-p/1759686

there is a demo project in the link and you can refer to it.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
2,498 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@abdul_rahman

please refer to the link below 

https://community.nxp.com/t5/S32K/LCU-out-PWM/td-p/1759686

there is a demo project in the link and you can refer to it.

0 项奖励
回复
2,491 次查看
abdul_rahman
Contributor IV

Hi @Senlent 

Thanks for the help. The code works fine.

 

 

0 项奖励
回复