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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
2,731 次查看
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

标签 (1)
0 项奖励
1 解答
1,901 次查看
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 项奖励
8 回复数
1,901 次查看
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 项奖励
1,901 次查看
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 项奖励
1,901 次查看
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 项奖励
1,901 次查看
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 项奖励
1,901 次查看
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 项奖励
1,902 次查看
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 项奖励
1,901 次查看
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 项奖励
1,901 次查看
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 项奖励