Distinguish interrupt sources of eMIOS

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

Distinguish interrupt sources of eMIOS

Jump to solution
1,666 Views
thomasbao
Contributor II

hello, everyone:

    I want to use eMIOS_0[13] generate PWM, and to use eMIOS_0[12] as input capture in interrupt mode. However, eMIOS_0[13] is always triggers an interrupt even though used function EMIOS_DRV_ChannelDisableIsrRequest(0U, 13U);.

     So, I wonder how to distinguish interrupt source?

0 Kudos
1 Solution
1,649 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

it looks like you use MPC5748G, right? On this device, two EMIOS channels share the same interrupt vector. So, it's necessary to use function EMIOS_DRV_ReadFlagState at the beginning of interrupt handler to know which channel will be serviced by this interrupt.

Regards,

Lukas

View solution in original post

0 Kudos
4 Replies
1,650 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

it looks like you use MPC5748G, right? On this device, two EMIOS channels share the same interrupt vector. So, it's necessary to use function EMIOS_DRV_ReadFlagState at the beginning of interrupt handler to know which channel will be serviced by this interrupt.

Regards,

Lukas

0 Kudos
1,629 Views
thomasbao
Contributor II

Hi, lukaszadrapa,

    Thanks, it is perfect to use function EMIOS_DRV_ReadFlagState to distinguish interrupt sources.

    And another question:  I want to use eMIOS_0[13] generate PWM, and to use eMIOS_0[12] as input capture in interrupt mode,however, eMIOS_0[12] always capture the PWM gengrated by eMIOS_0[13], and cannot capture external input. How to avoid this ?

    My configuration is as follows:

  •     pin settings

      thomasbao_5-1628663126738.png

  •     channel list

    thomasbao_1-1628662164258.png

    My relevant code:

  •     IRQHandler

    thomasbao_2-1628662763188.png

  • EMIOS init
  • thomasbao_3-1628662861606.png    
1,612 Views
thomasbao
Contributor II

I have solve this, it's my hardware problem.

0 Kudos
870 Views
Achraf
Contributor I

Hi Thomas,
I want to use emios 1 channel 6 as input capture with counter bus A to capture the pwm generetad by emios 0 ch 23 mode opwfmb . I visualize my pwm generetad by emios 0 channel 23 with oscilloscope. The problem that i receive 0 when i want to measure this signal with ipm mode. I attached thé external pin together with jumper. Can you help me with your code? . I use the function get-last measurement but the retvalue is always 0.

0 Kudos