LCD16x2 and GCC compiler

cancel
Showing results for 
Search instead for 
Did you mean: 

LCD16x2 and GCC compiler

Jump to solution
393 Views
nguyennhatminh
Contributor IV

Hi Pro,

I'm going to build a driver that control the LCD 16x2 so I have a question about

GCC compiler on Codewarrior IDE for FreedomKinetis KL05Z.

when I code :

For example: printf(" I love freescale")

does it call the function putch(char c) ?

Thank you.

Labels (1)
Tags (2)
0 Kudos
1 Solution
121 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello:

I think you already downloaded the "KL05_SC" package. The project is called "kl05_frdm_demo"

However I think you might find that example difficult to figure out how to use your LCD with prinft.

In this case you need to create your own level driver so that the last function called is your specific function for talking with the LCD. I recommend you to check the next tutorial by colleague Erich Styger:

printf() with the FRDM-KL25Z Board and without Processor Expert | MCU on Eclipse

You will see that in the file ConsoleIO.c, in the function __write_console() you have a call to UART0_PDD_PutChar8(). Here you would put instead your LCD function.

And also if you are willing to use Processor Expert, then there is a LCD component created also by Erich. Check this:

HD44780 2×16 Character Display for Kinetis and Freedom Board | MCU on Eclipse

Hope this helps!


Regards!
Jorge Gonzalez

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

View solution in original post

0 Kudos
4 Replies
121 Views
Paul_Tian
NXP Employee
NXP Employee

Hi, Minh

Function printf does not call such function putch(char C). I cannot find which MCU you used, but I think you can develop your project base on our "hello world" demo.Then you no need to care about printf function.

Hope my reply can help you.

Best Regards

Paul

0 Kudos
121 Views
nguyennhatminh
Contributor IV

HI Zhe Tian,

Thank you for your reply, would you like show me where is " Hello World" demo ?

Minh

0 Kudos
122 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello:

I think you already downloaded the "KL05_SC" package. The project is called "kl05_frdm_demo"

However I think you might find that example difficult to figure out how to use your LCD with prinft.

In this case you need to create your own level driver so that the last function called is your specific function for talking with the LCD. I recommend you to check the next tutorial by colleague Erich Styger:

printf() with the FRDM-KL25Z Board and without Processor Expert | MCU on Eclipse

You will see that in the file ConsoleIO.c, in the function __write_console() you have a call to UART0_PDD_PutChar8(). Here you would put instead your LCD function.

And also if you are willing to use Processor Expert, then there is a LCD component created also by Erich. Check this:

HD44780 2×16 Character Display for Kinetis and Freedom Board | MCU on Eclipse

Hope this helps!


Regards!
Jorge Gonzalez

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

View solution in original post

0 Kudos
121 Views
nguyennhatminh
Contributor IV

Thank you Jorge_Gonzalez

It's really useful links.

Minh.

0 Kudos