Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - dfansler

Pages: [1] 2
TFTs / NHD 5.0 800480 resistive touch screen non-linearity
« on: September 06, 2017, 10:45:28 AM »
I have a problem with the resistive touch display on the above display.  On the right end of the display, if I am measuring the resistance from top to bottom, it changes by 300 ohms (increasing from top to bottom).  Reading the horizontal position on the right edge should give the same value from top to bottom - instead the value increases.  This means that if I scale the value to be 800 on the right side, it will go from say 800 at the top to 850 at the bottom.

Is there a problem with the touch screen, or my logic?
Kind regards,

TFTs / NHD 5.0 800480 startup woes - SOLVED
« on: June 16, 2017, 10:25:48 AM »
I built a board with LED's for all the signals going to the display, that sits between the processor board and the NHD controller board.  Watching the display init routine run, I noticed that bits 6 & 7 were not behaving.  Turns out that those two pins had a solder bridge between them at the processor.  My display now works.

I wish to thank my parents for having me, my wife for having me, my 2 dogs and 1 cat for having me and finally myself - for without myself I would be . . . . . . not be?

Kind regards,

Seems like everytime I try a new display, I have a battle getting it to respond.  On my current project I had to switch from the 7.0 TFT to the 5.0 TFT, both 800x480 and both using the SSD1963 controller board.

Attached is a video of the display going thru the init code.  I am using Curt's eval code for the 5.0 800x480 with the SSD1963.  Oh well, the video is too big - what it shows is the display goes black, then when the init occurs, the screen turns white and you can see a horizontal line of pixels as it moved down the display.  When it reaches the bottom, the screen stays mostly white, except for the upper third has darkend - looks a lot like a thunderstorm cloud.  Ok, so I could include a reduced version photo of the screen as the line scans down the display.

I have single stepped through the TFT_5_Write_Data and the TFT_5_Write_Command functions and verified the signals to the controller board - on the controller board.

I have included the code below.

Any suggestions?
Kind regards,

void TFT_5_Write_Data (unsigned char data1)  //no joy with delays
   AVR32_GPIO.port[1].ovr = data1;

void TFT_5_Write_Command (unsigned char command)
   int x;
   AVR32_GPIO.port[1].ovr = command;

void TFT_5_WindowSet(int s_x, int e_x, int s_y, int e_y)
   int s_x_c;  //Start_X_Corrected
   s_x_c = e_x - s_x;
   TFT_5_Write_Command(0x2a);      //set page address
   TFT_5_Write_Data((s_x)>>8);      //set start page address = 0
   TFT_5_Write_Data((e_x)>>8);      //set end page address 639
   TFT_5_Write_Command(0x2b);      //set column address
   TFT_5_Write_Data((s_y)>>8);      //set start column address = 0
   TFT_5_Write_Data((e_y)>>8);      //set end column address = 459
void TFT_5_Init(void)
   //new setup as of 06-15-17
   TFT_5_Write_Command(0x01);     //Software Reset
   TFT_5_Write_Command(0x01);     //Software Reset

   TFT_5_Write_Command(0xe0);    //START PLL
   TFT_5_Write_Command(0xe0);    //LOCK PLL
   TFT_5_Write_Command(0xb0);      //SET LCD MODE (7 parameters)
   TFT_5_Write_Data(0x08);         //18-bit, TFT FRC enable, dithering off
   TFT_5_Write_Data(0x80);         //LCD panel mode
   TFT_5_Write_Data(0x03);         //SET horizontal size=800-1 HightByte
   TFT_5_Write_Data(0x1f);          //SET horizontal size=800-1 LowByte
   TFT_5_Write_Data(0x01);         //SET vertical size=480-1 HightByte
   TFT_5_Write_Data(0xdf);         //SET vertical size=480-1 LowByte
   TFT_5_Write_Data(0x00);         //SET even/odd line RGB seq.=RGB
   TFT_5_Write_Command(0xf0);      //SET pixel data I/F format=8bit
   TFT_5_Write_Command(0x36);   //SET address mode=flip vertical
   TFT_5_Write_Command(0x3a);   // SET R G B format = 6 6 6
   TFT_5_Write_Command(0xe2);         //SET PCLK freq=9.5MHz  ; pixel clock frequency
   TFT_5_Write_Command(0xe6);         //SET PCLK freq=9.5MHz  ; pixel clock frequency
   TFT_5_Write_Command(0xb4);      //SET Horizontal Period (8 parameters)
   TFT_5_Write_Data(0x04);         //SET HSYNC Total=1056
   TFT_5_Write_Data(0x00);         //SET HSYNC Start Position=88
   TFT_5_Write_Data(0x80);         //SET HSYNC Pulse Width=128=127pixels+1
   TFT_5_Write_Data(0x00);         //SET HSYNC pulse start position=0
   TFT_5_Write_Data(0x00);         //SET HSYNC pulse subpixel start position
   TFT_5_Write_Command(0xb6);       //SET Vertical Period (7 parameters),
   TFT_5_Write_Data(0x02);         //SET Vsync total=525
   TFT_5_Write_Data(0x00);         //SET VSYNC Pulse Start Position=32
   TFT_5_Write_Data(0x01);         //SET VSYNC Pulse Width= 0=0lines+1
   TFT_5_Write_Data(0x00);         //SET VSYNC Pulse Start Position=0
   TFT_5_Write_Command(0x2a);      //SET column address
   TFT_5_Write_Data(0x00);         //SET start column address=0
   TFT_5_Write_Data(0x03);         //SET end column address=799
   TFT_5_Write_Command(0x2b);      //SET page address
   TFT_5_Write_Data(0x00);         //SET start page address=0
   TFT_5_Write_Data(0x01);         //SET end page address=479
   TFT_5_Write_Command(0x13);      //SET normal mode
   TFT_5_Write_Command(0x38);      //SET normal mode
   TFT_5_Write_Command(0x29);      //SET display on

Opps - I read the .5mm as the pitch rather tha the trace width - I see the pitch is 1mm.

What connector is used with the NHD-5.0-800480TF-22 Controller Board?  It appears to be a 22pin .5mm pitch.  I do not see one listed in the connectors.  Top or bottom feed?

Ok, so I see that the -22 board has the touch screen outputs.  A suggestion - don't have the website display the -20 controller on the same page as a suggestion for the 5" resistive touch display.

I recently purchased 3 each of the above units.  The X+,X-,Y+,Y- signals from the display are carried on the 40 pin conductor between the display and the NHD-5.0-800480TF-20 Controller Board.  There is no output of the  X+,X-,Y+,Y- signals on the NHD-5.0-800480TF-20 Controller Board.  How does one access those signals?
Kind regards,

TFTs / NHD-2.4-240320sf-ctxi#t1 reveresed colors
« on: December 21, 2016, 09:49:01 AM »
just got the above 2.4" LCD working, but have a strange problem - at least I think it is a problem.  When I send 0xffff to the display it is black, but sending 0x0000 it goes white!  Other NHD TFTs I have used go black with 0x0000 and white with 0xffff. 

Is this normal, or do I have something set wrong?

void LCD_INIT(void)
   gpio_set_pin_low(LCD_nRESET);//        gpio_local_clr_gpio_pin(LCD_nRESET);         //cycle the reset line
   gpio_set_pin_high(LCD_nRESET);//   gpio_local_set_gpio_pin(LCD_nRESET);         //cycle the reset line
   TFT_24S_Write_Command(0x0028);//display OFF
   TFT_24S_Write_Command(0x0011);TFT_24S_Write_Data(0x0000);            //exit SLEEP mode
   TFT_24S_Write_Command(0x00C0);TFT_24S_Write_Data(0x0026);TFT_24S_Write_Data(0x0004);   //power control 1
   TFT_24S_Write_Command(0x00C1);TFT_24S_Write_Data(0x0004);            //power control 2
   TFT_24S_Write_Command(0x00C5);TFT_24S_Write_Data(0x0034);TFT_24S_Write_Data(0x0040);   //VCOM control 1
   TFT_24S_Write_Command(0x0036);TFT_24S_Write_Data(0x0088);            //memory access control = BGR
   TFT_24S_Write_Command(0x00B1);TFT_24S_Write_Data(0x0000);TFT_24S_Write_Data(0x0018);   //frame rate control
   TFT_24S_Write_Command(0x00B6);TFT_24S_Write_Data(0x000A);TFT_24S_Write_Data(0x00A2);   //display function control
   TFT_24S_Write_Command(0x00C7);TFT_24S_Write_Data(0x00C0);            //VCOM control 2
   TFT_24S_Write_Command(0x003A);TFT_24S_Write_Data(0x0055);            //pixel format = 16 bit per pixel
   TFT_24S_Write_Command(0x002A);TFT_24S_Write_Data(0x0000);            //column address set
   TFT_24S_Write_Data(0x0000);            //start 0x0000
   TFT_24S_Write_Data(0x00EF);            //end 0x00EF
TFT_24S_Write_Command(0x002B);TFT_24S_Write_Data(0x0000);            //page address set
      TFT_24S_Write_Data(0x0000);            //start 0x0000
   TFT_24S_Write_Command(0x0029);//display ON

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)


gpio_set_pin_low(LCD_nRESET);       //cycle the reset line
gpio_set_pin_high(LCD_nRESET);   //cycle the reset line
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

TFTs / 16 bit color with an ILI9328?
« on: March 31, 2016, 04:53:04 PM »
The ILI9328 is controlling a 2.4" 240x320 LCD TFT display.  While I am still having timing issues, that is a separate issue in a different thread.

The design I choose to use is a 16 bit interface.  The problem - why else would I be writing to the forum - is that the display is not showing the full red color. 

Cycling through the color bits:
0x0000 gives black
0x0001 gives a very dim blue
0x0002 gives a slightly brighter blue
0x0004 gives a slightly brighter blue that 0x0002
0x0008 gives a brighter blue than 0x0004
0x0010 gives a brighter blue than 0x0008
0x0020 gives the brightest single bit blue.
0x0040 gives a very dim green
0x0080 gives a slightly brighter green
0x0100 gives a slightly brighter green than 0x0080
0x0200 gives a slightly brighter green than 0x0100
0x0400 gives a brighter green than 0x0200
0x0800 gives the brightest green
0x1000 gives a very dim red
0x2000 gives a slightly brighter red
0x4000 gives a slightly brighter red than 0x2000
0x8000 gives black

I have checked the signal on the lcd for the 16th bit, and it is cycling up and down.

It appears that the unit is in an 18 bit mode.

Attached is the 16bit i80 interface picture form the ILI9328 manual - I don't understand the 6th bit pointing to the 1st bit in the red and blue . . . . . . .

I set the RGB Display Interface Control 1 (0x0C) to 0x0001  That was the only place I could find to set the interface to 16 bit (other than the IMO pin which is set low)

I want 65k colors - not 256k.


ok - thanks

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  .  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,

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.

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)
//   IO_TEST();
        TFT_24S_Write_Command(0x0029);            //display ON
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

Any ideas?

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

Will do when I get home this afternoon

Pages: [1] 2