Author Topic: NHD-2.4-240320-CTCI#-T white screen only - grrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr  (Read 3931 times)

dfansler

  • Jr. Member
  • **
  • Posts: 26
  • Karma: 0
    • View Profile
Like others I have read about on the forum, I get nothing but a white screen.  I have tried several different init codes I have found with no luck.  I know the signals are getting to the display - I hooked an led to each line with a 1k resistor, so I can see the led change, but not drop the volatge on the line.  I am set up for 16bit writes.
Kind regards,
David
The wiring of the unit is
1-gnd       11-D/C select     21-D7          31-gnd
2-nc         12- nWR            22-D8          32-nc
3-nc         13-3.3v             23-D9          33-gnd
4-nc         14-D0               24-D10         34-gnd
5-nc         15-D1               25-D11         35-gnd
6-nc         16-D2               26-D12         36-gnd
7-3.3v      17-D3               27-D13         37-gnd
8-3.3v      18-D4               28-D14         38-3.3v
9-nc         19-D5               29-D15         39-gnd
10-gnd     20-D6               30-nRESET

Code is:
void TFT_24S_Write_Command(int command)
{
            gpio_set_pin_low(LCD_RS);           //set DC low
            AVR32_GPIO.port[0].ovr = command;   //send the command to the LCD
           delay_ms(1);                                  //1ms safety delay
           gpio_set_pin_low(LCD_nWR);          //lower write pin
           delay_ms(1);                                 //1ms safety delay
           gpio_set_pin_high(LCD_nWR);        //raise write pin
          delay_ms(1);                                 //1ms safety delay
}
void TFT_24S_Write_Data(int data)
{
            gpio_set_pin_high(LCD_RS);           //set DC high
            AVR32_GPIO.port[0].ovr = data;   //send the data to the LCD
           delay_ms(1);                                  //1ms safety delay
           gpio_set_pin_low(LCD_nWR);          //lower write pin
           delay_ms(1);                                 //1ms safety delay
           gpio_set_pin_high(LCD_nWR);        //raise write pin
          delay_ms(1);                                 //1ms safety delay
}
/**************************************************************/
void init_lcd(void)
{
        gpio_set_pin_low(LCD_nWR);         //lower the write line
        gpio_set_pin_low(LCD_nRESET);                //cycle the reset line
   delay_ms(250);                                        //delay 250ms
        gpio_set_pin_high(LCD_nRESET);              //cycle the reset line
   delay_ms(250);                                        //delay 250ms
        gpio_set_pin_high(LCD_nWR);                   //raise the write line
   TFT_24S_Write_Command(0x0028);         //display OFF
   TFT_24S_Write_Command(0x0011);         //exit SLEEP mode
   TFT_24S_Write_Data(0x0000);
   TFT_24S_Write_Command(0x00CB);        //Power Control A
   TFT_24S_Write_Data(0x0039);           //always 0x39
   TFT_24S_Write_Data(0x002C);           //always 0x2C
   TFT_24S_Write_Data(0x0000);          //always 0x00
   TFT_24S_Write_Data(0x0034);          //Vcore = 1.6V
   TFT_24S_Write_Data(0x0002);          //DDVDH = 5.6V
   TFT_24S_Write_Command(0x00CF);       //Power Control B
   TFT_24S_Write_Data(0x0000);         //always 0x00
   TFT_24S_Write_Data(0x0081);          //PCEQ off
   TFT_24S_Write_Data(0x0030);         //ESD protection
   TFT_24S_Write_Command(0x00C0);     //power control 1
   TFT_24S_Write_Data(0x0026);
   TFT_24S_Write_Data(0x0004);        //second parameter for ILI9340 (ignored by ILI9341)
   TFT_24S_Write_Command(0x00C1);     //power control 2
   TFT_24S_Write_Data(0x0011);
   TFT_24S_Write_Command(0x00C5);     //VCOM control 1
   TFT_24S_Write_Data(0x0035);
   TFT_24S_Write_Data(0x003E);
   TFT_24S_Write_Command(0x0036);     //memory access control = BGR
   TFT_24S_Write_Data(0x0088);
   TFT_24S_Write_Command(0x00B1);     //frame rate control
   TFT_24S_Write_Data(0x0000);
   TFT_24S_Write_Data(0x0010);             //***********************
   TFT_24S_Write_Command(0x00B6);     //display function control
   TFT_24S_Write_Data(0x000A);
   TFT_24S_Write_Data(0x00A2);
   TFT_24S_Write_Command(0x00C7);          //VCOM control 2
   TFT_24S_Write_Data(0x00BE);
   TFT_24S_Write_Command(0x003A);        //pixel format = 16 bit per pixel
   TFT_24S_Write_Data(0x0055);

   TFT_24S_Write_Command(0x00F2);        //3G Gamma control
   TFT_24S_Write_Data(0x0002);          //off
   TFT_24S_Write_Command(0x0026);       //Gamma curve 3
   TFT_24S_Write_Data(0x0001);
   TFT_24S_Write_Command(0x002A);      //column address set
   TFT_24S_Write_Data(0x0000);
   TFT_24S_Write_Data(0x0000);          //start 0x0000
   TFT_24S_Write_Data(0x0000);
   TFT_24S_Write_Data(0x00EF);         //end 0x00EF
   TFT_24S_Write_Command(0x002B);      //page address set
   TFT_24S_Write_Data(0x0000);
   TFT_24S_Write_Data(0x0000);         //start 0x0000
   TFT_24S_Write_Data(0x0001);
   TFT_24S_Write_Data(0x003F);          //end 0x013F
   TFT_24S_Write_Command(0x0029);      //display ON
        return;
}   

dfansler

  • Jr. Member
  • **
  • Posts: 26
  • Karma: 0
    • View Profile
BTW I have tried 3 different displays with no luck.
David

dfansler

  • Jr. Member
  • **
  • Posts: 26
  • Karma: 0
    • View Profile
And the display is a NHD-2.4-240320SF

Saurabh_B

  • Administrator
  • Hero Member
  • *****
  • Posts: 355
  • Karma: 10
    • View Profile
Hi David,

Would you be able to confirm the full part number of the display, along with the date code printed on it.

The controller has changed on the display in the past, I would like to confirm the controller used on the display.

dfansler

  • Jr. Member
  • **
  • Posts: 26
  • Karma: 0
    • View Profile
Will do when I get home this afternoon
Thanks
David

dfansler

  • Jr. Member
  • **
  • Posts: 26
  • Karma: 0
    • View Profile
Saurabh_B: here is a list of the displays I have - Thanks, David

NHD-2.4-240320SF-CTXI#-T  2610   8631N00704T
NHD-2.4-240320SF-CTXI#     2610  8631Q100719W
NHD-2.4-240320SF-CTXI#     2610  8631Q100719W
NHD-2.4-240320SF-CTXI#-T  2610  8631N10074T
NHD-2.4-240320SF-CTXI#     2610  8631Q100719W
NHD-2.4-240320SF-CTXI#-T  2610  8631N10074T
NHD-2.4-240320SF-CTXI#     2610  8631Q100719W
NHD-2.4-240320SF-CTXI#-T  2610  8634N100704T

NHD-LGC128128BZ-FSW-GBW   100810-07-03-23
NHD-C128128BZ-FSW-GBW   0033-000-1001  107940-09-3-31

Saurabh_B

  • Administrator
  • Hero Member
  • *****
  • Posts: 355
  • Karma: 10
    • View Profile
These displays do use the older ILI9340 controller, I would recommend trying the values in the code below:

http://www.newhavendisplay.com/app_notes/2-4TFT_ILI9340.txt

After initialization are you sending any data to the display?

dfansler

  • Jr. Member
  • **
  • Posts: 26
  • Karma: 0
    • View Profile
Hi Saurabh_B - thinking you were probably off for Good Friday, so I looked at the data on the different examples of code for the 2.4 display, and tried the 3 that seemed post probable.

The ILI9340 was the easiest code to port since I had used the same function names for writing commands and data as the posted code.

Unfortunately, I still have had no luck.  I am turning on the display and I think I am sending valid data to display

My main.c looks like:
int main(void)
{
   flashc_set_wait_state(1);
   board_init();
//   IO_TEST();
   init_lcd();
        TFT_24S_Write_Command(0x0029);            //display ON
   write_green();
        while(1)
          {}
}
void write_green(void)
{
      unsigned int i;
   TFT_24S_Write_Command(0x002C);              //command to begin writing to frame memory
   for(i=0;i<38400;i++)         //fill screen with blue pixels
   {
            TFT_24S_Write_Data(0x0f10); //random color
   }
        for(i=0;i<38400;i++)         //fill screen with green pixels
   {
            TFT_24S_Write_Data(0xE05f);  //random color
        }
return;
}

Any ideas?
Thanks,
David
 

dfansler

  • Jr. Member
  • **
  • Posts: 26
  • Karma: 0
    • View Profile
Got it running - Turns out that it works with the ILI9328 code.  In addition I found that the reset line was continually being reset by the AT32UC processor - it was part of PORT 0 which is used to write the 16 bits of data to the display.
David

dfansler

  • Jr. Member
  • **
  • Posts: 26
  • Karma: 0
    • View Profile
Now that  I have the display running - and it will only run using the ILI9328 code, I have started to try to fine tune the timing to the display.  The values I am having to use are MUCH larger than what the spec sheet says.  For example, doing a simple repetitive write of a single color to the screen, I have to put a 10ms delay between the output of the data and the first write strobe.  Between the write strobe low and high, I have to add a 1us delay.  Anything less and the colors are wrong.

I have looked at the at the rise time of the lines with my 500MHz 2GS/s scope and it consistantly shows a 3.6ns rise time.  I took the LED's off the lines to eliminate any extra load.

I have put a video of the display running with different timings on my website at www.dv-fansler.com/hidden.htm  .  The colors are suppose to be blue, green, red, white, black for both the full screen and the window.  The rectangale in the upper left corner is the tab to pull off the display protector.

Any ideas on the speed issue?
Kind regards,
David

Saurabh_B

  • Administrator
  • Hero Member
  • *****
  • Posts: 355
  • Karma: 10
    • View Profile
Thanks for the video.

I will get back to you shortly with the delays issue.

dfansler

  • Jr. Member
  • **
  • Posts: 26
  • Karma: 0
    • View Profile
ok - thanks
David

Saurabh_B

  • Administrator
  • Hero Member
  • *****
  • Posts: 355
  • Karma: 10
    • View Profile
What changes have been made to the initialization?


dfansler

  • Jr. Member
  • **
  • Posts: 26
  • Karma: 0
    • View Profile
Very small - only 2 changes, one to go from 18 bit to 16 bit and one to raise the refresh rate.
The unit will only show true colors if I delay at least 4ms between sending each data word. 
This is really starting to become frustrating.

Here is my current initialization:
void init_lcd(void)
{

//II9328

gpio_set_pin_low(LCD_nRESET);       //cycle the reset line
delay_ms(250);
gpio_set_pin_high(LCD_nRESET);   //cycle the reset line
delay_ms(250);
   
TFT_24S_Write_Command(0x0000); TFT_24S_Write_Data(0x0001);//same as NHD code
TFT_24S_Write_Command(0x0001); TFT_24S_Write_Data(0x0100);//same as NHD code
TFT_24S_Write_Command(0x0002); TFT_24S_Write_Data(0x0700);//same as NHD code
TFT_24S_Write_Command(0x0003); TFT_24S_Write_Data(0x1030);//same as NHD code
TFT_24S_Write_Command(0x0004); TFT_24S_Write_Data(0x0000);//same as NHD code
TFT_24S_Write_Command(0x0008); TFT_24S_Write_Data(0x0202);//same as NHD code
TFT_24S_Write_Command(0x0009); TFT_24S_Write_Data(0x0000);//same as NHD code
TFT_24S_Write_Command(0x000A); TFT_24S_Write_Data(0x0000);//same as NHD code
TFT_24S_Write_Command(0x000C); TFT_24S_Write_Data(0x0001);//changed from 0x0000
TFT_24S_Write_Command(0x000D); TFT_24S_Write_Data(0x0000);//same as NHD code
TFT_24S_Write_Command(0x000F); TFT_24S_Write_Data(0x0000);//same as NHD code

TFT_24S_Write_Command(0x0010); TFT_24S_Write_Data(0x0000);//same as NHD code
TFT_24S_Write_Command(0x0011); TFT_24S_Write_Data(0x0000);//same as NHD code
TFT_24S_Write_Command(0x0012); TFT_24S_Write_Data(0x0000);//same as NHD code
TFT_24S_Write_Command(0x0013); TFT_24S_Write_Data(0x0000);//same as NHD code
delay_ms(200);                                                                           //same as NHD code
TFT_24S_Write_Command(0x0010); TFT_24S_Write_Data(0x17B0);//same as NHD code
TFT_24S_Write_Command(0x0011); TFT_24S_Write_Data(0x0137)
delay_ms(50);                                                                           //same as NHD code
TFT_24S_Write_Command(0x0012); TFT_24S_Write_Data(0x013B);
delay_ms(50);                                                                           //same as NHD code
TFT_24S_Write_Command(0x0013); TFT_24S_Write_Data(0x1900);//same as NHD code
TFT_24S_Write_Command(0x0029); TFT_24S_Write_Data(0x0007);//same as NHD code
TFT_24S_Write_Command(0x002B); TFT_24S_Write_Data(0x0009);//was 0x0020 which did nothing my value gives a 60Hz refresh rate
delay_ms(50);                                                                           //same as NHD code
TFT_24S_Write_Command(0x0020); TFT_24S_Write_Data(0x0000);//same as NHD code
TFT_24S_Write_Command(0x0021); TFT_24S_Write_Data(0x0000);//same as NHD code

TFT_24S_Write_Command(0x0030); TFT_24S_Write_Data(0x0007);//same as NHD code
TFT_24S_Write_Command(0x0031); TFT_24S_Write_Data(0x0504);//same as NHD code
TFT_24S_Write_Command(0x0032); TFT_24S_Write_Data(0x0703);//same as NHD code
TFT_24S_Write_Command(0x0035); TFT_24S_Write_Data(0x0002);//same as NHD code
TFT_24S_Write_Command(0x0036); TFT_24S_Write_Data(0x0707);//same as NHD code
TFT_24S_Write_Command(0x0037); TFT_24S_Write_Data(0x0406);//same as NHD code
TFT_24S_Write_Command(0x0038); TFT_24S_Write_Data(0x0006);//same as NHD code
TFT_24S_Write_Command(0x0039); TFT_24S_Write_Data(0x0404);//same as NHD code
TFT_24S_Write_Command(0x003C); TFT_24S_Write_Data(0x0700);//same as NHD code
TFT_24S_Write_Command(0x003D); TFT_24S_Write_Data(0x0A08);//same as NHD code

TFT_24S_Write_Command(0x0050); TFT_24S_Write_Data(0x0000);//same as NHD code
TFT_24S_Write_Command(0x0051); TFT_24S_Write_Data(0x00EF);//same as NHD code
TFT_24S_Write_Command(0x0052); TFT_24S_Write_Data(0x0000);//same as NHD code
TFT_24S_Write_Command(0x0053); TFT_24S_Write_Data(0x013F);//same as NHD code
TFT_24S_Write_Command(0x0060); TFT_24S_Write_Data(0x2700);//same as NHD code
TFT_24S_Write_Command(0x0061); TFT_24S_Write_Data(0x0001);//same as NHD code
TFT_24S_Write_Command(0x006A); TFT_24S_Write_Data(0x0000);//same as NHD code
TFT_24S_Write_Command(0x0090); TFT_24S_Write_Data(0x0010);//same as NHD code
TFT_24S_Write_Command(0x0092); TFT_24S_Write_Data(0x0000);//same as NHD code
TFT_24S_Write_Command(0x0095); TFT_24S_Write_Data(0x0110);//same as NHD code
TFT_24S_Write_Command(0x0097); TFT_24S_Write_Data(0x0000);//same as NHD code
TFT_24S_Write_Command(0x0007); TFT_24S_Write_Data(0x0173);//same as NHD code
delay_ms(10);                                                                           //same as NHD code
return;
}
« Last Edit: April 04, 2016, 07:46:17 PM by dfansler »

 

NHD‐2.4‐240320SF‐CTXL#‐FTN1 touch-screen problem

Started by hbcelebiBoard TFTs

Replies: 5
Views: 4179
Last post December 10, 2014, 11:19:05 AM
by Michael_L
Shift position after "clear screen" instruction

Started by dreissBoard OLEDs

Replies: 5
Views: 3067
Last post September 18, 2015, 03:50:30 PM
by Saurabh_B
Resistive/Capacitive Touch Screen - Sample Code

Started by daotaBoard TFTs

Replies: 1
Views: 1236
Last post July 14, 2016, 07:57:46 AM
by Saurabh_B
NHD-7.0-800480EF-ATXV#-CTP touch screen details

Started by lakshminarayananBoard TFTs

Replies: 1
Views: 2792
Last post June 24, 2014, 10:33:38 AM
by Michael_L
Touch Screen - NHD-2.4-240320SF-CTXL#-FTN1

Started by marcelocrrBoard TFTs

Replies: 2
Views: 2353
Last post November 23, 2014, 10:07:16 AM
by PeterT