UART for communication

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

UART for communication

Jump to solution
1,614 Views
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

Labels (1)
Tags (2)
0 Kudos
1 Solution
725 Views
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

View solution in original post

0 Kudos
4 Replies
725 Views
pradyumnakammar
Contributor III

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

0 Kudos
726 Views
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 Kudos
725 Views
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 Kudos
725 Views
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 Kudos