AnsweredAssumed Answered

Interrupt Port Code Generation in KDS2.0 for KL25

Question asked by youngcheol song on Apr 28, 2015

Hello,

i designed USB device using MKL25Z128VLK4 with KDS 2.0 .

i want to use the PTA4/NMI port(pin 30) to GPIO Interrupt input.
However the generated code is not correct to use for GPIO interrupt input.

it is different from the generated code by the CodeWarrior 10.4.

below is the different part between KDS2.0 and CW10.4.

<CW10.4>

  /* Clear interrupt status flag - w1c */

  PORTA_ISFR = PORT_ISFR_ISF(0x10);                                  

  /* Initialization of Port Control registers */

  /* PORTA_PCR4: ISF=0,IRQC=0x0B,MUX=1 */

  PORTA_PCR4 = (uint32_t)((PORTA_PCR4 & (uint32_t)~(uint32_t)(

                PORT_PCR_ISF_MASK |

                PORT_PCR_IRQC(0x04) |

                PORT_PCR_MUX(0x06)

               )) | (uint32_t)(

                PORT_PCR_IRQC(0x0B) |

                PORT_PCR_MUX(0x01)

               ));                                

 

<KDS2.0>

  /* PORTA_PCR4: ISF=0,MUX=7 */

  PORTA_PCR4 = (uint32_t)((PORTA_PCR4 & (uint32_t)~(uint32_t)(

                PORT_PCR_ISF_MASK

               )) | (uint32_t)(

                PORT_PCR_MUX(0x07)

               ));

 

Could you help me to use KDS2.0 ?

Original Attachment has been moved to: KDS20_ExtIntLdd9.c.txt.zip

Original Attachment has been moved to: CW104_ExtIntLdd9.c.txt.zip

Outcomes