Help with MQX + MCF52235 and character LCD

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

Help with MQX + MCF52235 and character LCD

Jump to solution
577 Views
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 Kudos
1 Solution
368 Views
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

View solution in original post

0 Kudos
1 Reply
369 Views
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 Kudos