NHD-2.4-240320-CTCI#-T white screen only
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;
}
-
BTW I have tried 3 different displays with no luck.
David0 -
And the display is a NHD-2.4-240320SF
0 -
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.0 -
Will do when I get home this afternoon
Thanks
David0 -
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-310 -
These displays do use the older ILI9340 controller, I would recommend trying the values in the code below:
https://newhavendisplay.com/content/app_notes/2-4TFT_ILI9340.txt
After initialization are you sending any data to the display?0 -
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,
David0 -
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,
David0 -
Thanks for the video.
I will get back to you shortly with the delays issue.0 -
ok - thanks
David0 -
What changes have been made to the initialization?
0 -
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;
}0
Please sign in to leave a comment.
Comments
12 comments