KL82 UART Code Example

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

KL82 UART Code Example

2,231 Views
us1
Contributor III

Hello,

is there some Examplecode for the KL82 Board to get the UART working?

Is there a direct example from someone which used the ESP8266 with it?

Would appreceate any help,

thank you very much

Labels (1)
0 Kudos
Reply
9 Replies

1,860 Views
us1
Contributor III

I created now two things:

I send a AT Command to UART via: LPUART_WriteBlocking(DEMO_LPUART, "AT\r\n", sizeof("AT\r\n")-1);

when I do the same with a function like this:

   void uart_esp12_send_command (char* esp_command)
            {
                LPUART_WriteBlocking(DEMO_LPUART, esp_command, sizeof(esp_command)-1);

            }

and then

uart_esp12_send_command ("AT-Command");

I only get with the function three letters displayed on the Serial Consol, but the normal Command ( LPUART_WriteBlocking(DEMO_LPUART, "AT\r\n", sizeof("AT\r\n")-1)) gives back the full entered string.

How can I change this? I need to change the data type.

How could I receive data strings with: LPUART_ReadBlocking(LPUART_Type *base, uint8_t *data, size_t length);??

0 Kudos
Reply

1,860 Views
us1
Contributor III

Hi,

thank you.

I downloaded the SDK for the kl82 but what do I do with the *.zip! file? Extract or add in the Kinetis design studio, tried but it does somehow not work both ways...

0 Kudos
Reply

1,860 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ulrich,

Thanks for your reply.

Firstly, you should extract it, then get start with the KSDK V2.0 by referring to the attachment.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,860 Views
us1
Contributor III

HI,

thank you. where Can I find the uart example?

thank you

0 Kudos
Reply

1,860 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ulrich,

Thanks for your reply.

The LPUART demo resides in the \SDK_2.0_MKL82Z128xxx7\boards\frdmkl82z\driver_examples which as the Fig 1 shows.

2016-09-29_20-34-45.jpg

Fig 1


Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,860 Views
us1
Contributor III

Thank you very much,

but I can't really understand this example, it's to hard to understand.

Is there some code for receiving strings?

Thank you a lot

0 Kudos
Reply

1,860 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ulrich,

Thanks for your reply.

The SDK development kit is the first option for the customer to get start with the Kinetis MCU.

And I'd like to know what the codes confuse you, you can share them with the screenshot.

I'm looking forward to your reply.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,860 Views
us1
Contributor III

Hi,

thank you for your kind help.

Well, I need to write and read string to/from the uart.

code.png

I can't see how I can write to the uart register. this would be interessting to know and which configurations are needed to get it working barebone. Or could you explain how I could use the functions from the libs?

thank you

0 Kudos
Reply

1,860 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ulrich Steinlehner,

I'd highly recommend you to refer to the KSDK v2.0 which includes the some demos of the UART module.

Software Development Kit for Kinetis MCUs|NXP
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply