Menu

#5 Qbox mini LCD not working (Shows white) after reboot

open
nobody
5
2014-08-21
2011-04-03
Anonymous
No

After restart of QBox mini , during restart the front panel LCD goes totally white and then remains this way, nothing is displayed.
I got two Putty logs (attached) (after reboot) , one without the white LCD, one without (LCD working).
Searc the logs from strange "XJMCYX" , thats where you'll see the different bahviour, the LCD ID is different, Its invalid when the LCD goes white !

I had look through the source code file lcd_drv.c (\trunk\src\drivers\lcd\lcd_drv.c),

Apologies for the technical details, maybe it could be fowarded to Duolabs
Call path is....

__init lcd_init
to
device_init
to
read_DA_id_reg

In that function, the LCD is identified.
Actually the LCD driver chip (assuming the correct chip is the ILi9163 and looking at that chips tech spec, this function appears to be reading ID1 (DAh), ID2 (DAb)and ID2 (DAc) registers for the chip.

For varaiable lcd_id_m would be safer to reset this to zero on call to function read_DA_id_reg

Looking the Putty logs...
in one case (LCD OK) read_DA_id_reg has LCD ID as 0x00000000
other case (LCD is white) read_DA_id_reg has LCD ID as 0x00548026

this causes the code in device_init() to behave differently

unsigned short id=0;
id=read_DA_id_reg();
if( (id>>8) == 0x54)
init_lcd_ili9163();
else //0x5Cxxxx
init_lcd_fdg177();

in one case it calls init_lcd_ili9163() (which is correct)
in the other it calls init_lcd_fdg177() which is wrong and causes the white LCD
the code tries to init the wrong type of LCD (actually I think its the LCD driver chip)

I'd suggest the following code as more robust:

unsigned short id=0;
id=read_DA_id_reg();
if( (id>>8) == 0x54)
init_lcd_ili9163();
else if (id>>8) == 0x5C //0x5Cxxxx
init_lcd_fdg177();
else // error case
{
printk("Invalid DA_id_reg value: 0x%08X\n", id);
}

Interestingly there is very similar code in
trunk\src\uboot\lib_sh4\lcd_drv.c
which I assume is the bootloader code (I'm not which file is actually linked into the final image ?)

That file has same code for read_DA_id_reg but some is commented out with a strange comment

/* I don't known why the following read it isn't work */
#if 0
/* DB */
WriteCOM(0xDB);
res_m=0;
res_m=ctrl_inw(lcd_cb.base_address_emi);
lcd_id_m|=((res_m>>8)&0xFF);
printf("Value of DB register: 0x%04X\n",res_m);
lcd_id_m=(lcd_id_m<<8);

/* DC */
WriteCOM(0xDC);
res_m=0;
res_m=ctrl_inw(lcd_cb.base_address_emi);
lcd_id_m|=((res_m>>8)&0xFF);
printf("Value of DC register: 0x%04X\n",res_m);
printf("Value of LCD id: 0x%08X\n", lcd_id_m);
#endif

return res_da;

Makes me wonder does the DA read code... (below)

/* DA */
WriteCOM(0xDA); //manufacturer ID
res_da=res_m=ctrl_inw(lcd_cb.base_address_emi);
lcd_id_m|=((res_m>>8)&0xFF);
printf("Value of DA register (manufacturer ID): 0x%04X\n",(res_m>>8));
lcd_id_m=(lcd_id_m<<8);

work reliably ?, this is most likely where the LCD is being wrongly identified.

In any case there is a problem in the way the code interacts with the hardware.
In my case it could be a HW fault ? (although the SW could be more robust to handle such faults)

Discussion

  • Anonymous

    Anonymous - 2011-04-03

    If you need more data, let me know, I will be returning this box to the shop for a swap, as it could be faulty HW.

     
  • Anonymous

    Anonymous - 2011-04-03
    • summary: 5 Qbox mini LCD not working (Shows white) after reboot --> Qbox mini LCD not working (Shows white) after reboot
     
  • Nobody/Anonymous

    Looking at the Putty logs...

    Correction:
    in one case (LCD OK) read_DA_id_reg has LCD ID as 0x00000000
    other case (LCD is white) read_DA_id_reg has LCD ID as 0x00548026

    should be :

    in one case (LCD OK) read_DA_id_reg has LCD ID as 0x00548026
    other case (LCD is white) read_DA_id_reg has LCD ID as 0x00000000

     

Log in to post a comment.