AnsweredAssumed Answered

Where can I find the NVIC registers to use interrupts with the MK53DN512xxx10?

Question asked by Kevin Lehzen on Aug 6, 2015
Latest reply on Aug 7, 2015 by Kevin Lehzen

Hi there,

 

I am currently developing a little program to toggle GPIO pins. I am using KDS 3.0 and KSDK 1.2 with the TWR-K53N512 board. I am quite new in working with Freescale's MCUs. To toggle a GPIO pin is no problem but to time it with an interrupt is more complex. I want to use the LPTMR0 for this purpose.

My colleague gave me some code he used with another Freescale MCU and CW. Here is the part that makes problems:

 

static void IRQ_enable(uint32_t irq)

{

uint32_t div;

 

// Enable IRQ in NVIC

div = irq / 32u;

 

switch(div)

{

  case 0u:

      NVIC_ICPR0 |= 1 << (irq % 32u);

      NVIC_ISER0 |= 1 << (irq % 32u);

      break;

 

  case 1u:

      NVIC_ICPR1 |= 1 << (irq % 32u);

      NVIC_ISER1 |= 1 << (irq % 32u);

      break;

 

  case 2u:

      NVIC_ICPR2 |= 1 << (irq % 32u);

      NVIC_ISER2 |= 1 << (irq % 32u);

      break;

}

}

 

The problem is I do not find the NVIC registers. I know they are there according to the ARM website but they are not in the MK53D10.h file and there is no sysinit.h. The compiler, of coarse, says NVIC_ISER0 etc. are not declared. Anyone can help me? I guess its a simple solution. Thanks in advance!

 

Regards,

Kevin

Outcomes