Timer Interrupt, Interrupt Priority, I2C implementation

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

Timer Interrupt, Interrupt Priority, I2C implementation

1,882 次查看
karthikpoojary
Contributor III

Hi,

I am using Keil IDE for  MK64FN11M0VLLl12. I have few questions related this issue

1.How to set up timer interrupt continously for a specified interval of time?

2.How to set  Interrupt Priority?

3.Can you please provide example codes for I2C(Master) and UART(Interrupt Based) implementation?

标签 (1)
0 项奖励
回复
5 回复数

1,272 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Karthik,

The FTM, PIT,LPTMR even PDB can all generate interrupt continously for a specified interval of time, which one do you uses?

Regarding the interrupt priority, there is IPR register in core, pls refer to  3.2.2 Nested Vectored Interrupt Controller (NVIC) Configuration in RM of K64, the lower the IRQx bits are, the Higher the interrupt priority is, for example IRQx=0 is the highest priority.

Regarding how to write register of K64, it is dependent on the tools especially the registers.h file, which define the register.

This is the code in KDS tools for KEA64 instaed of K64:

void kbi1_interruptInit(void)
{
     NVIC_SetPriority(25,0x3);
//    NVIC->IPR6=0xC000; //set KBI1 interrupt priority
     NVIC_EnableIRQ(25);
//    NVIC->ICPR|=1<<25;   //clear the pending register of interrupt source 25(KBI1)
    NVIC_ClearPendingIRQ(25);
//    NVIC->ISER|=1<<25;  //set the interrupt source of KBI1
     NVIC_EnableIRQ(25);
}

Regarding the I2C and UART code, I suggest you use SDK2.0, you can download the SDK2.0 from the website based on K64.

There are example.

http://www.nxp.com/ksdk

Hope it can help you

BR

Xiangjun rong

0 项奖励
回复

1,272 次查看
karthikpoojary
Contributor III

Hi Xiangjun 

I have tried KSDK example programs but whenever I have tried to open the .uvmpw file I get the following error 

"The Project file has newer major version which is not compatible with this Program Version"

I have tried using both Keil Uvision 4 and Keil Uvision 5 but  I am getting the same results

0 项奖励
回复

1,272 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, kathik,

Regarding your issue to open project based on Keil tools, pls refer to the doc "Getting Started with Kinetis SDK(KSDK)v.2.0.pdf" located at:

C:\Freescale\SDK2.0_K64F\docs

it tells you how to open a project with Keil.

Hope it can help you.

BR

XiangJun Rong

0 项奖励
回复

1,272 次查看
karthikpoojary
Contributor III

Hi,

Issue was that Multi Project file is not comaptible with Uvision4 its only working with Uvision5

By default it was trying to open  in Uvision4. 

0 项奖励
回复

1,272 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Karthik

Can you use KDS tools? I have not the license of keil tools, I am familair with keil tools either.

BR

Xiangjun Rong

0 项奖励
回复