Author Topic: TFT NHD-2.4-240320CF-CSXN#-FT  (Read 873 times)

ypkdani

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
TFT NHD-2.4-240320CF-CSXN#-FT
« on: January 13, 2017, 02:54:54 AM »
Hello,

i have a problem with the tft using the 8bit interface.  I have connect the pin with the pinout of pag5 :

http://www.newhavendisplay.com/specs/NHD-2.4-240320CF-CSXN-FT.pdf

and i use this code for init the lcd:

LCD_SendCMD(0x0028); //exit sleep
   WAIT_Waitms(200);
   LCD_SendCMD(0x0011); //exit sleep
   WAIT_Waitms(200);

   LCD_SendCMD(0x0036);
   LCD_SendData(0x0000);//MADCTL: memory data access control
   LCD_SendCMD(0x003A);
   LCD_SendData(0x0055);//COLMOD: setto 65k e 16bit di colori
   LCD_SendCMD(0x00B2);
   LCD_SendData(0x000C);
   LCD_SendData(0x000C);
   LCD_SendData(0x0000);
   LCD_SendData(0x0033);
   LCD_SendData(0x0033);//PORCTRK: Porch setting
   LCD_SendCMD(0x00B7);
   LCD_SendData(0x0035);//GCTRL: Gate Control
   LCD_SendCMD(0x00BB);
   LCD_SendData(0x002B);//VCOMS: VCOM setting
   LCD_SendCMD(0x00C0);
   LCD_SendData(0x002C);//LCMCTRL: LCM Control
   LCD_SendCMD(0x00C2);
   LCD_SendData(0x0001);
   LCD_SendData(0xFF);//VDVVRHEN: VDV and VRH Command Enable
   LCD_SendCMD(0x00C3);
   LCD_SendData(0x0011);//VRHS: VRH Set
   LCD_SendCMD(0x00C4);
   LCD_SendData(0x0020);//VDVS: VDV Set
   LCD_SendCMD(0x00C6);
   LCD_SendData(0x000F);//FRCTRL2: Frame Rate control in normal mode
   LCD_SendCMD(0x00D0);
   LCD_SendData(0x00A4);
   LCD_SendData(0x00A1);//PWCTRL1: Power Control 1
   LCD_SendCMD(0x00E0);
   LCD_SendData(0x00D0);
   LCD_SendData(0x0000);
   LCD_SendData(0x0005);
   LCD_SendData(0x000E);
   LCD_SendData(0x0015);
   LCD_SendData(0x000D);
   LCD_SendData(0x0037);
   LCD_SendData(0x0043);
   LCD_SendData(0x0047);
   LCD_SendData(0x0009);
   LCD_SendData(0x0015);
   LCD_SendData(0x0012);
   LCD_SendData(0x0016);
   LCD_SendData(0x0019);//PVGAMCTRL: Positive Voltage Gamma control
   LCD_SendCMD(0x00E1);
   LCD_SendData(0x00D0);
   LCD_SendData(0x0000);
   LCD_SendData(0x0005);
   LCD_SendData(0x000D);
   LCD_SendData(0x000C);
   LCD_SendData(0x0006);
   LCD_SendData(0x002D);
   LCD_SendData(0x0044);
   LCD_SendData(0x0040);
   LCD_SendData(0x000E);
   LCD_SendData(0x001C);
   LCD_SendData(0x0018);
   LCD_SendData(0x0016);
   LCD_SendData(0x0019);//NVGAMCTRL: Negative Voltage Gamma control
   LCD_SendCMD(0x002A);
   LCD_SendData(0x0000);
   LCD_SendData(0x0000);
   LCD_SendData(0x0000);
   LCD_SendData(0x00EF);//X address set
   LCD_SendCMD(0x002B);
   LCD_SendData(0x0000);
   LCD_SendData(0x0000);
   LCD_SendData(0x0001);
   LCD_SendData(0x003F);//Y address set
   WAIT_Waitms(100);

but the lcd don't work, nothing happen. I send the data in 16bit 5-6-5rgb

I send the data with:

/*
 * Autore: WT
 * Data: 17/06/2013
 *
 * Funzione che invia allo schermo LCD un comando a 8bit
 * passato alla funzione mediante "data"
 * 
 */
void __attribute__((optimize("-O0"))) LCD_SendCMD(unsigned int data){

   GPIO_DRV_ClearPinOutput(LCD_CS);//chip select low
   GPIO_DRV_SetPinOutput(LCD_RD);//read strobe high
   GPIO_DRV_ClearPinOutput(LCD_DATA);//command
   GPIO_DRV_ClearPinOutput(LCD_WR);//WR low
   GPIOC_PDOR = data & 0xFF;
   GPIO_DRV_SetPinOutput(LCD_WR);//WR high
}

/*
 * Autore: WT
 * Data: 17/06/2013
 *
 * Funzione che invia allo schermo LCD un dato a 8bit
 * passato alla funzione mediante "data"
 * 
 */
void __attribute__((optimize("-O0"))) LCD_SendData(unsigned int data){

   GPIO_DRV_ClearPinOutput(LCD_CS);//chip select low
   GPIO_DRV_SetPinOutput(LCD_RD);//read strobe high
   GPIO_DRV_SetPinOutput(LCD_DATA);//command
   GPIO_DRV_ClearPinOutput(LCD_WR);//WR low
   GPIOC_PDOR = (data>>8) & 0xFF;
   GPIO_DRV_SetPinOutput(LCD_WR);//WR low
   GPIO_DRV_ClearPinOutput(LCD_WR);//WR low
   GPIOC_PDOR = data & 0xFF;
   GPIO_DRV_SetPinOutput(LCD_WR);//WR low
}

if i comment the :

GPIOC_PDOR = (data>>8) & 0xFF;
//GPIO_DRV_SetPinOutput(LCD_WR);//WR low
//GPIO_DRV_ClearPinOutput(LCD_WR);//WR low
GPIOC_PDOR = data & 0xFF;

something work but only 1/2 display with an image distorted

Thanks
« Last Edit: January 13, 2017, 03:00:41 AM by ypkdani »

ypkdani

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: TFT NHD-2.4-240320CF-CSXN#-FT
« Reply #1 on: January 17, 2017, 02:24:19 AM »
Hello,

some one use the 8 bit interface? i don't understand why it not work. Thanks

Saurabh_B

  • Administrator
  • Hero Member
  • *****
  • Posts: 341
  • Karma: 10
    • View Profile
Re: TFT NHD-2.4-240320CF-CSXN#-FT
« Reply #2 on: January 17, 2017, 12:10:55 PM »
Would you be able to provide your Schematic for this as well?

 

NHD-2.4-240320CF-CTXI#-FT (ST7789S controller) and STM32F4 FSMC LCD Interface

Started by deshayesBoard TFTs

Replies: 1
Views: 2553
Last post March 17, 2016, 06:25:18 PM
by fahad
NHDEV firmware to support NHD-2.4-240320CF-CTXI#-FT (ST7889S controller)

Started by deshayesBoard Evaluation Tools

Replies: 1
Views: 2507
Last post December 17, 2015, 09:52:29 AM
by Saurabh_B
NHD-2.4-240320CF-CSXI#-F minimal wiring for power

Started by enjaianBoard TFTs

Replies: 4
Views: 2685
Last post July 25, 2015, 04:32:22 PM
by enjaian
NHD-2.4-240320CF-CTXI#-FT ribbon cable question

Started by tom66888Board TFTs

Replies: 1
Views: 2069
Last post October 02, 2015, 08:29:03 AM
by Saurabh_B
ATSAM4E -NHD-2.4-240320CF-CTXI#-F - White Screen

Started by gentlemannBoard TFTs

Replies: 2
Views: 1974
Last post February 18, 2016, 01:08:35 PM
by Paul_B