UART for communication

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

UART for communication

跳至解决方案
1,686 次查看
arbnorzeqiri
Contributor I

Hi all,

I'm new to Kinetis MCUs and I want to know how to work with UART, does it have any library for that ?

p.s. My MCU is MKL05Z

标签 (1)
标记 (2)
0 项奖励
1 解答
797 次查看
martynhunt
NXP Employee
NXP Employee

Hi Arbnor,

You can find some sample code for the KL05 on the following web page: KL05-SC

The download you are looking for is KL05-SC. Inside there should be an IAR project that uses UART and I2C.

Also, the reference manual has a description of all the UART registers. You can find it and other documentation here: KL0 Documentation

Let me know if you have any questions.

Regards,

Martyn

在原帖中查看解决方案

0 项奖励
4 回复数
797 次查看
pradyumnakammar
Contributor III

Thank you Martyn ... UART0 clock was not the problem i had not disabled one of the interrupts which was interfering. 

0 项奖励
798 次查看
martynhunt
NXP Employee
NXP Employee

Hi Arbnor,

You can find some sample code for the KL05 on the following web page: KL05-SC

The download you are looking for is KL05-SC. Inside there should be an IAR project that uses UART and I2C.

Also, the reference manual has a description of all the UART registers. You can find it and other documentation here: KL0 Documentation

Let me know if you have any questions.

Regards,

Martyn

0 项奖励
797 次查看
pradyumnakammar
Contributor III

hi

martynhunt

im new to Kinetis L 05 MCUs can you give me examles ti use UART intrrupt for communication serially ?? i have referred KL05-SC n used polling method

i want to use the interrupt method during wake up (MCU waking from LLWU pin) then reconfig to polling type


when i tried to do the above at the later part when its waiting in a while loop   @ while(!(UART_S1_REG(channel) & UART0_S1_RDRF_MASK));it goes to hard fault


i dont know how to solve ... need assistance


regards

Pradyumna


0 项奖励
797 次查看
martynhunt
NXP Employee
NXP Employee

Hi Pradyumna,

Have you made sure that the UART0 clock is enabled by setting SIM_SCGC4[UART0] = 1. Also, what clock source are you using for UART0? (SIM_SOPT2[UART0SRC]).

Best regards,

Martyn

0 项奖励