EMIOS PWM configuration in S32K312

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

EMIOS PWM configuration in S32K312

Jump to solution
758 Views
SasiKumar_Vengam
Contributor II

i Team,

We are using S32k312 MCU and we tried to configure Emios PWM using S32 Design Studio 3.5. We were not able to generate PWM signals. Please find the configuration in the below attachment and kindly correct if necessary. We are working on Non-Autosar Mode and we are using 6 PWM channels and the channels are given below.

SasiKumar_Vengam_0-1731946197107.pngSasiKumar_Vengam_1-1731946240011.pngSasiKumar_Vengam_2-1731946281847.pngSasiKumar_Vengam_3-1731946299112.png

Emios_Mcl_Ip_Init (EMIOS_1,&Emios_Mcl_Ip_1_Config_BOARD_INITPERIPHERALS);
Emios_Pwm_Ip_InitChannel(EMIOS_PWM_IP_I0_CH0_CFG,&Emios_Pwm_Ip_I0_Ch0);
Emios_Pwm_Ip_InitChannel(EMIOS_0,&Emios_Pwm_Ip_I0_Ch1);
Emios_Pwm_Ip_InitChannel(EMIOS_0,&Emios_Pwm_Ip_I0_Ch2);
Emios_Pwm_Ip_InitChannel(EMIOS_0,&Emios_Pwm_Ip_I0_Ch3);
Emios_Pwm_Ip_InitChannel(EMIOS_0,&Emios_Pwm_Ip_I0_Ch4);
// Emios_Pwm_Ip_InitChannel(EMIOS_1,&Emios_Pwm_Ip_I1_Ch0);
 
Note :- Emios_Pwm_Ip_I1_Ch0 channel  can't be able to init successfully. In below function code is getting terminate due to Base->CH.UC[Channel].C  value is zero but we have initalized
Emios_Mcl_Ip_Init() fn below and find the config attached image MCL_IP;
 Emios_Pwm_Ip_MasterBusModeType Emios_Pwm_Ip_GetChannelPwmMode( const Emios_Pwm_Ip_HwAddrType *const Base,
uint8 Channel)
while(1)
{
//Emios_Mcl_Ip_SetCounterBusPeriod(0,23,32768);
Status = Emios_Pwm_Ip_SetDutyCycle(EMIOS_PWM_IP_I0_CH0_CFG,EMIOS_PWM_IP_I0_CH0_CFG,3268);
sprintf( (char*)message, "Status_0  = %d   \n",Status);
Uart_logs_transmit(message);
TestDelay(DELAY_TIMER);
DutyCycle = Emios_Pwm_Ip_GetDutyCycle(EMIOS_0,EMIOS_PWM_IP_I0_CH0_CFG);
sprintf( (char*)message, "DutyCycle  = %d   \n",DutyCycle);
Uart_logs_transmit(message);
 
Status = Emios_Pwm_Ip_SetDutyCycle(EMIOS_0,EMIOS_PWM_IP_I0_CH1_CFG,32768);
 
TestDelay(DELAY_TIMER);
Status = Emios_Pwm_Ip_SetDutyCycle(EMIOS_0,EMIOS_PWM_IP_I0_CH2_CFG,32768);
 
TestDelay(DELAY_TIMER);
Status = Emios_Pwm_Ip_SetDutyCycle(EMIOS_0,EMIOS_PWM_IP_I0_CH3_CFG,32768);
 
TestDelay(DELAY_TIMER);
Status = Emios_Pwm_Ip_SetDutyCycle(EMIOS_0,EMIOS_PWM_IP_I0_CH4_CFG,32768);
 
TestDelay(DELAY_TIMER);
Status = Emios_Pwm_Ip_SetDutyCycle(EMIOS_0,EMIOS_PWM_IP_I1_CH0_CFG,32768);
 
}
 
If we have missed anything, Let us know.
0 Kudos
Reply
1 Solution
3 Replies
727 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

If it is convenient, please send me the simple test project for a quick test.

0 Kudos
Reply
721 Views
SasiKumar_Vengam
Contributor II
Hi @robin,
We have configured the PWM correctly using an example uploaded in the Community. We need to configure a GPIO pin as an Interrupt, could you please share any examples on this along with the ISR function implementation.
For your reference, we are using PTB1, PTC8 and PTC9 as GPIO input of the S32K312 MCU.
Thanks.
0 Kudos
Reply