Help with MQX + MCF52235 and character LCD

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

Help with MQX + MCF52235 and character LCD

跳至解决方案
956 次查看
Macias
Contributor I

Hello,

I connect an character (2x16) lcd to my MCF52235 to PORTAN. I want to use it with mqx so, I wrote a additionale device driver for my lcd (attached file) but I've same problems with my driver. I'm using ioctl function to control my lcd like return to home, clear display, etc. Data to display is writing via write(..) function, please see below:

 

void Main_task(uint_32 initial_data){    if(IO_OK != _textlcd_install("lcd:"))           printf("Error opening lcd\n");             if(NULL==(lcd_file = fopen("lcd:", NULL)))           printf("Opening LCD device faild\n");   for (;;)    {           ioctl(lcd_file, TEXT_LCD_HOME, NULL);  <= this line provide problem, break curent task           write(lcd_file, "TEST", 0);              _time_delay(10);   }}

 

 

Instal and open and write function works great but I've problem with ioctl function. when I call this function the task was exited, and I don't know why.

Please help me with this.

 

Regards,

Maciek

0 项奖励
回复
1 解答
747 次查看
DavidS
NXP Employee
NXP Employee

Hi Maciek,

Your code and process look good to me.

Can you set a breakpoint in the switch statement to validate your IOCTL call is getting that far?

 switch(cmd)
 {
  case TEXT_LCD_HOME:
   LcdWriteCmd(0x02);          <-- SET BREAKPOINT HERE

 

Lastly make sure the BSP and PSP have been recently cleaned and compiled.

Regards,

David

在原帖中查看解决方案

0 项奖励
回复
1 回复
748 次查看
DavidS
NXP Employee
NXP Employee

Hi Maciek,

Your code and process look good to me.

Can you set a breakpoint in the switch statement to validate your IOCTL call is getting that far?

 switch(cmd)
 {
  case TEXT_LCD_HOME:
   LcdWriteCmd(0x02);          <-- SET BREAKPOINT HERE

 

Lastly make sure the BSP and PSP have been recently cleaned and compiled.

Regards,

David

0 项奖励
回复