Distinguish interrupt sources of eMIOS

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Distinguish interrupt sources of eMIOS

ソリューションへジャンプ
1,665件の閲覧回数
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 件の賞賛
1 解決策
1,648件の閲覧回数
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 件の賞賛
4 返答(返信)
1,649件の閲覧回数
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 件の賞賛
1,628件の閲覧回数
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,611件の閲覧回数
thomasbao
Contributor II

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

0 件の賞賛
869件の閲覧回数
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 件の賞賛