LPC1313 NVIC_EnableIRQ function

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

LPC1313 NVIC_EnableIRQ function

ソリューションへジャンプ
2,350件の閲覧回数
prachipanse
Contributor III

Hi,

I have enabled external interrupts on the pin 6 of Port0 of LPC1313 using the following steps-

(I am using the LPCOpen library for this.)

Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, 0, 6);
Chip_GPIO_SetPinModeEdge(LPC_GPIO_PORT, 0, 64);
Chip_GPIO_SetEdgeModeSingle(LPC_GPIO_PORT, 0, 64);
Chip_GPIO_SetupPinInt(LPC_GPIO_PORT, 0, 6, GPIO_INT_RISING_EDGE);
Chip_GPIO_EnableInt(LPC_GPIO_PORT, 0, 64);
NVIC_ClearPendingIRQ(EINT0_IRQn);
NVIC_EnableIRQ(EINT0_IRQn);

There is no activity on the specified GPIO pin during this time (also verified in the DATA register for that port). However, as soon as the NVIC_EnableIRQ(EINT0_IRQn); command is executed, an interrupt seems to have occurred and the program goes to the PIOINT0_IRQHandler.

 

Please tell me why an interrupt is getting registered on enabling and if there is a workaround to avoid this case.

Thanks and Regards,

Prachi

ラベル(3)
0 件の賞賛
返信
1 解決策
1,798件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hello prachi panse,

   Please call clear peinding interrupts for selected pins before you enable the IRQ:

STATIC INLINE void Chip_GPIO_ClearInts(LPC_GPIO_T *pGPIO, uint8_t port, uint32_t pinmask)
{
    pGPIO[port].IC = pinmask;
}

Please try it on your side at first.

If you still have problem, please let me know!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,799件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hello prachi panse,

   Please call clear peinding interrupts for selected pins before you enable the IRQ:

STATIC INLINE void Chip_GPIO_ClearInts(LPC_GPIO_T *pGPIO, uint8_t port, uint32_t pinmask)
{
    pGPIO[port].IC = pinmask;
}

Please try it on your side at first.

If you still have problem, please let me know!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信
1,798件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hello prachi panse,

   Please call clear peinding interrupts for selected pins before you enable the IRQ:

STATIC INLINE void Chip_GPIO_ClearInts(LPC_GPIO_T *pGPIO, uint8_t port, uint32_t pinmask)
{
    pGPIO[port].IC = pinmask;
}

Please try it on your side at first.

If you still have problem, please let me know!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信