GPIO interrupt rising/falling edge

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

GPIO interrupt rising/falling edge

ソリューションへジャンプ
6,685件の閲覧回数
fasihahmed
Contributor IV

How to set GPIO (input) interrupt to be triggered based on rising/falling edge or steady state signal?
Im using GCT, code warrior 10.6, DSC MC56F82748

ラベル(1)
1 解決策
6,533件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Fasih,

As you know that all the GPIO pins of MC56F827xx can be used to trigger interrupt, for the detailed inf, pls refer to the section:

34.2.6 GPIO Interrupt Enable Register (GPIOx_IENR)

pastedImage_25.png

34.2.7 GPIO Interrupt Polarity Register (GPIOx_IPOLR)

The register GPIOx_IPOLR can set up falling/rising edge to trigger interrupt of GPIO pins.

This is the interrupt vector table for MC56F827xx:

pastedImage_26.png

There is only one interrupt vector table for 16 GPIO pins, so in the ISR, you have to check which GPIO pin leads to the interrupt by checking the GPIO Interrupt Pending Register.

I will try to develop an example code based on GCT tools.

BR

XiangJun Rong

元の投稿で解決策を見る

2 返答(返信)
6,534件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Fasih,

As you know that all the GPIO pins of MC56F827xx can be used to trigger interrupt, for the detailed inf, pls refer to the section:

34.2.6 GPIO Interrupt Enable Register (GPIOx_IENR)

pastedImage_25.png

34.2.7 GPIO Interrupt Polarity Register (GPIOx_IPOLR)

The register GPIOx_IPOLR can set up falling/rising edge to trigger interrupt of GPIO pins.

This is the interrupt vector table for MC56F827xx:

pastedImage_26.png

There is only one interrupt vector table for 16 GPIO pins, so in the ISR, you have to check which GPIO pin leads to the interrupt by checking the GPIO Interrupt Pending Register.

I will try to develop an example code based on GCT tools.

BR

XiangJun Rong

6,533件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

pastedImage_1.png

GPIOC4 pin interrupt fonfiguration:

pastedImage_2.png

unsigned int flag=0x01;
#pragma interrupt on
void GPIOC4_ISR(void)
{

    //clear the GPIOC4 pending register
    ioctlGPIO_CLEAR_EDGE_SENSITIVE_INT_FLAG(GPIO_C,0x10);  
    //toggle GPIOE0
    if(flag)
    {
    ioctlGPIO_SET_PIN(GPIO_E,0x01);  
    }
    else
    {
        ioctlGPIO_CLEAR_PIN(GPIO_E,0x01);  
    }
    flag^=0x01;
}
#pragma interrupt off