AnsweredAssumed Answered

GPIO pin as interrupt source

Question asked by Hui Shao on Nov 5, 2014
Latest reply on Nov 5, 2014 by Hui Shao

Hi-

 

The mode i am using is MK20DX256VMX7. I have a GPIO pin PTC8 initially set as input and interrupt source. If I change the pin later in code to toggling as code below, will it trigger interrupt?

 

   /* testing on PTC8: turn off the GPIO */
   PORT_PCR_REG(PORTC_BASE_PTR, 8) = PORT_PCR_MUX(0x01);
   GPIO_PDDR_REG(PTC_BASE_PTR) |= 1 << 8; // PTC8 as output
   GPIO_PDOR_REG(PTC_BASE_PTR) |= (1 << 8); // PTC8 in high level
   _time_delay(10);
   /* testing on PTC8: turn off the GPIO */
   PORT_PCR_REG(PORTC_BASE_PTR, 8) = PORT_PCR_MUX(0x01);
   GPIO_PDDR_REG(PTC_BASE_PTR) |= 1 << 8; // PTC8 as output
   GPIO_PDOR_REG(PTC_BASE_PTR) &= ~(1 << 8); // PTC8 in low level
   _time_delay(10)

 

thanks!

 

Hui

Outcomes