LCD16x2 and GCC compiler

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

LCD16x2 and GCC compiler

跳至解决方案
834 次查看
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.

标签 (1)
标记 (2)
0 项奖励
1 解答
562 次查看
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!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
4 回复数
562 次查看
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 项奖励
562 次查看
nguyennhatminh
Contributor IV

HI Zhe Tian,

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

Minh

0 项奖励
563 次查看
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!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
562 次查看
nguyennhatminh
Contributor IV

Thank you Jorge_Gonzalez

It's really useful links.

Minh.

0 项奖励