l want to set PTE16 as interrupt on rising-dege which use S32K144

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

l want to set PTE16 as interrupt on rising-dege which use S32K144

Jump to solution
1,087 Views
jinshuaixu
Contributor V

hello

My S32K144 compile software version is "S32 Design Studio for ARM Version: 2018.R1".

now l want to set PTE16 as interrupt on rising-dege,the next is my setting:

void main(void)

{

CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,
g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);

/* Output direction for LED0 & LED1 */
PINS_DRV_SetPinsDirection(GPIO_PORT, ((1 << LED1) | (1 << LED2)));

/* Set Output value LED0 & LED1 */
PINS_DRV_SetPins(GPIO_PORT, 1 << LED1);
PINS_DRV_ClearPins(GPIO_PORT, 1 << LED2);

PCC->PCCn[PCC_PORTE_INDEX] = PCC_PCCn_CGC_MASK; /* Enable clock to PORT E */
PTE->PDDR &= ~(1 << 16);
PORTE->PCR[16] = 0x00000110;//PTE16 set input GPIO mode
PORTE->PCR[16] |= 0x00009000;//ISF flag and Interrupt on rising-edge

INT_SYS_InstallHandler(PORTE_IRQn,&PORTE_IRQH, (isr_t *)0 );
INT_SYS_EnableIRQ(PORTE_IRQn);

}

void PORTE_IRQH(void)
{
PINS_DRV_TogglePins(GPIO_PORT, ((1 << LED1) | (1 << LED2)));
PINS_DRV_ClearPortIntFlagCmd(PORTE);

}

who can tell me how to setting PTE16 as interrupt on rising-dege which use register,my setting is untrue.
Attached is the project

0 Kudos
1 Solution
908 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello,

It seems like you missed the position of IRQC 

It should be: PORTE->PCR[16] |= 0x00090000;   //ISF flag and Interrupt on rising-edge

pastedImage_1.png

BR, Daniel

View solution in original post

0 Kudos
2 Replies
909 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello,

It seems like you missed the position of IRQC 

It should be: PORTE->PCR[16] |= 0x00090000;   //ISF flag and Interrupt on rising-edge

pastedImage_1.png

BR, Daniel

0 Kudos
908 Views
jinshuaixu
Contributor V

Thank you for you response.

0 Kudos