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

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

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

Jump to solution
2,655 Views
kev1504
Contributor I

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

Labels (1)
0 Kudos
1 Solution
1,825 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

in KDS, NVIC related core registers are defined in core_cm4.h.

by default, it is under project\SDK\platform\CMSIS\Include

can you please take a look at it?


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
8 Replies
1,825 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

Nested Vectored Interrupt Controller( NVIC) is ARM register.

you can find the definition in attached document. search the doc with keyword "NVIC" you will know.

if you use KDS3.0, you can also view NVIC in debugger:

pastedImage_1.png

can this help?


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,825 Views
kev1504
Contributor I

Hi,

thanks for your answer! But that is the problem. Look at my embsys table:

embsys_MK53D10.PNG

Its missing and I dont know why :smileysad:

Regards,

Kevin

0 Kudos
1,825 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

hi

1. are you sure your KDS version is 3.0. please check

is your side the same as below?

pastedImage_0.png

please make sure you use the latest version

Kinetis Design Studio Integrated Development |Freescale

2. did you do the same setting as below?

pastedImage_1.png


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,825 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

In Eclipse, use the menu Help > Install New Software and use the following update site:

http://embsysregview.sourceforge.net/update

EmbSysRegView Update from Eclipse


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,825 Views
kev1504
Contributor I

Everything is the same except I have a newer Version of embsys (0.2.5). And that is not the problem.

The problem is not that I cannot see it in embsys but its missing in my header files (MK53D10.h etc.). They dont exist. Neither NCIVISER2 nor NVIC_ISER2 are declared, you know?

Maybe I have manipulated files but they are from KSDK...

Thanks for all your help.

Kevin

0 Kudos
1,826 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

in KDS, NVIC related core registers are defined in core_cm4.h.

by default, it is under project\SDK\platform\CMSIS\Include

can you please take a look at it?


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,825 Views
kev1504
Contributor I

Finally I solved the problem. You were right. I am just using the declared NVIC_IRQenable/disable functions from core_cm4.h now.

Thanks for all your support!

Have a nice weekend,

Kevin

0 Kudos
1,825 Views
kev1504
Contributor I

They are there but in a different way. I gonna try these functions. Anyway the whole thing is mysterious.

Thanks!

Kevin

0 Kudos