Problem with K60 MCU UART interrupt mode Typical Usage code

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

Problem with K60 MCU UART interrupt mode Typical Usage code

跳至解决方案
2,374 次查看
dkarthik
Contributor II

I'm trying to learn K60 MCU UART using Typical usage of Processor expert component. I added Serial_LDD component and set to UART5 for communication to PC via debugger in TWRK60D100M kit. I used the exact code as in Typical usage. UART for polling mode works but Interrupt mode doesn't work. (I enabled interrupt in Serial Component)
.

Is there any other interrupts in the processor that should be enabled or Should I be including something in the code to enable additional interrupts. Please help.

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
1,945 次查看
dkarthik
Contributor II

Hi,

Problem Solved. It is because of OS. I don't know how to use interrupts when OS is included in the project. Without any OS the interrupt mode works.

Thank you,

Karthikeyan

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,945 次查看
BlackNight
NXP Employee
NXP Employee

I recommend that you use the AsynchroSerial component instead: it uses the Serial_LDD internally, but is much easier to use.

1,946 次查看
dkarthik
Contributor II

Hi,

Problem Solved. It is because of OS. I don't know how to use interrupts when OS is included in the project. Without any OS the interrupt mode works.

Thank you,

Karthikeyan

0 项奖励
回复
1,945 次查看
mjbcswitzerland
Specialist V

Hi


You can get UART code for all 6 UARTs in parallel in interrupt driven or DMA driven mode: http://www.utasker.com/forum/index.php?topic=1721.0

If you need to use PE you may need to enable global interrupts for it to work (?) [eg. with asm("cpsie   i")]

Regards

Mark

http://www.utasker.com/kinetis.html

1,945 次查看
dkarthik
Contributor II

Hi Mark,

Thanks for the utasker link.

The global interrupts of FreeRTOS are disabled before receiving the character and enabled after the reception so that the ISR is given control. (Similarly for sending a character). It is taken care by ENTER_CRITICAL() and EXIT_CRITICAL() tasks.

UART interrupts are enabled in the initialization code.

Thank you,

Karthik

0 项奖励
回复