[S32K3][eMIOS] UC channel can't report interrupt when set it's mode to OPWFMB

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

[S32K3][eMIOS] UC channel can't report interrupt when set it's mode to OPWFMB

1,165 Views
bai2022
Contributor I

I need set all TypeX and TypeG channels of eMIOS0/1/2 of S32K344 to OPWFMB mode, and also need these channels report interrupt to arm core when set Sn[Flag].
But actually I found that there is not any interrupt happened after Sn[Flag] has been set to 1.
Why?

And I found the following description of Cn[FEN], Does it mean that Sn[Flag] only can generate the interrupt when the mode of UC is "input capture", and can't generate it in the "output compare" mode?

"Page 1988 in S32K3XXRM V3

17 FEN

Flag Enable
Enables the input capture flag (Sn[FLAG]) to generate an interrupt request or a DMA request, as selected
in DMA.
0b - Disable
1b - Enable

"

 

eg.

#define EMIOS1 (1u)
#define EMIOS_ch0 (0u) //PWFM


void EMIOS1_5_IRQn_customized(void)
{
volatile test1 = 0;

test1++;

/*invoke IRQ handler of RTD*/
Emios_Icu_Ip_IrqHandler(EMIOS1, EMIOS_ch0);

}


void EmiosChIrqCallback_Emios1Ch0(void * callbackParameter)
{
volatile test2 = 0;

test2++;
}

static void SvECUM_InitEmios1(void)
{
/* Initialize interrupts */
IntCtrl_Ip_InstallHandler(EMIOS1_5_IRQn, &EMIOS1_5_IRQn_customized, NULL_PTR);
IntCtrl_Ip_EnableIrq(EMIOS1_5_IRQn);


Emios_Mcl_Ip_Init(EMIOS1, &Emios_Mcl_Ip_1_Config_BOARD_INITPERIPHERALS);

/* Initializa the EMIOS PWM driver
* EMIOS1_ch0 OPWFMB mode
* */
Emios_Pwm_Ip_InitChannel(EMIOS1, &Emios_Pwm_Ip_BOARD_InitPeripherals_I1_Ch0);

/* Update PWM duty-cycle and period
* Period 20ms
* Duty-cycle 10ms
* */
Emios_Pwm_Ip_SetPeriod(EMIOS1, EMIOS_ch0, 10000);
Emios_Pwm_Ip_SetDutyCycle(EMIOS1, EMIOS_ch0, 1000);
}

0 Kudos
Reply
2 Replies

409 Views
ESAKKI_MBD
Contributor II
Hello @bai2022
Have you gotten the required variable period and variable duty cycle pwm pulses in OPWFMB mode?
If gotten kindly share the pics of the mode.
0 Kudos
Reply

1,133 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

FEN bit need to be set so FLAG can then generate interrupt, does not matter of used mode.
Most probably ISR is not properly assigned or/and enabled.
What RTD driver do you use?

BR, Petr 

0 Kudos
Reply