Author Topic: Problem in bringing up NHD‐2.4‐240320SF‐CTXL#‐FTN1 on Renesas RL78/G14  (Read 5811 times)


  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
I meet with a problem bringing up this LCD on RL78/G14 platform.
I am trying to use GPIO port 0, bit 1 to bit4 to transmit control signals, and use GPIO port 5, bit 0 to bit 7 to work as 8-bit data bus.
The following codes are port initialization, TFT initialization, testing code (draw a pixel on the screen). If anyone could think of any potential reasons why it can't be brought up, please let me know. Thanks.

1. Port Initialization Code:
P0 = _01_Pn0_OUTPUT_1 | _00_Pn1_OUTPUT_0 | _00_Pn2_OUTPUT_0 | _00_Pn3_OUTPUT_0 | _00_Pn4_OUTPUT_0 |
         _20_Pn5_OUTPUT_1 | _40_Pn6_OUTPUT_1;
P5 = _00_Pn0_OUTPUT_0 | _00_Pn1_OUTPUT_0 | _00_Pn2_OUTPUT_0 | _00_Pn3_OUTPUT_0 | _00_Pn4_OUTPUT_0 |
         _00_Pn5_OUTPUT_0 | _00_Pn6_OUTPUT_0 | _00_Pn7_OUTPUT_0;
          _00_PMn4_MODE_OUTPUT | _00_PMn5_MODE_OUTPUT | _00_PMn6_MODE_OUTPUT | _80_PM0_DEFAULT;
          _00_PMn4_MODE_OUTPUT | _00_PMn5_MODE_OUTPUT | _00_PMn6_MODE_OUTPUT | _00_PMn7_MODE_OUTPUT;

2. LCD initialization code:

/* Write one byte as a command to the TFT LCD controller. */
void TFT_24S_Write_Command(uint8_t command)

/* Write one byte as data to the TFT LCD Controller. */
void TFT_24S_Write_Data(uint8_t data)

/* Initialize the relevant peripherals (GPIO, TPM, ADC) and the display
components (TFT LCD controller, touch screen and backlight controller). */
void TFT_Init(void)
        TFT_24S_Write_Command(0x0028); //display OFF
   TFT_24S_Write_Command(0x0011); //exit SLEEP mode
   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(0x00E8); //Driver timing control A
   TFT_24S_Write_Data(0x0085); //non-overlap
   TFT_24S_Write_Data(0x0001); //EQ timing
   TFT_24S_Write_Data(0x0079); //Pre-charge timing
        TFT_24S_Write_Command(0x00EA); //Driver timing control B
   TFT_24S_Write_Data(0x0000); //Gate driver timing
   TFT_24S_Write_Data(0x0000); //always 0x00
   TFT_24S_Write_Command(0x00ED); //Power-On sequence control
   TFT_24S_Write_Data(0x0064); //soft start
   TFT_24S_Write_Data(0x0003); //power on sequence
   TFT_24S_Write_Data(0x0012); //power on sequence
   TFT_24S_Write_Data(0x0081); //DDVDH enhance on
        TFT_24S_Write_Command(0x00F7); //Pump ratio control
   TFT_24S_Write_Data(0x0020); //DDVDH=2xVCI
        TFT_24S_Write_Command(0x00C0); //power control 1
   TFT_24S_Write_Data(0x0004); //second parameter for ILI9340 (ignored by ILI9341)
        TFT_24S_Write_Command(0x00C1); //power control 2
        TFT_24S_Write_Command(0x00C5); //VCOM control 1
        TFT_24S_Write_Command(0x00C7); //VCOM control 2
   TFT_24S_Write_Command(0x0036); //memory access control = BGR
#if 1
   TFT_24S_Write_Data(0x0008); // Portrait mode
   TFT_24S_Write_Data(0x00A8); // Landscape mode
   TFT_24S_Write_Command(0x00B1); //frame rate control
   TFT_24S_Write_Command(0x00B6); //display function control
   TFT_24S_Write_Command(0x003A); //pixel format = 16 bit per pixel
   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_Command(0x002A); //column address set
   TFT_24S_Write_Data(0x0000); //start 0x0000
   TFT_24S_Write_Data(0x00EF); //end 0x00EF
   TFT_24S_Write_Command(0x002B); //page address set
   TFT_24S_Write_Data(0x0000); //start 0x0000
   TFT_24S_Write_Data(0x003F); //end 0x013F
   TFT_24S_Write_Command(0x0029); //Display ON

3. pixel drawing code:
/* Set the pixel at pos to the given color. */
void TFT_Plot_Pixel(PT_T * pos, COLOR_T * color) { //240*320 for the PT_T
   uint8_t b1, b2;

   // Column address set 0x2a
   TFT_24S_Write_Command(0x002A); //column address set
   TFT_24S_Write_Data(pos->X & 0xff); //start
   TFT_24S_Write_Data(0x00EF); //end 0x00EF
   // Page (row) address set 0x2b
   TFT_24S_Write_Command(0x002B); //page address set
   TFT_24S_Write_Data(pos->Y >> 8);
   TFT_24S_Write_Data(pos->Y & 0xff); //start
   TFT_24S_Write_Data(0x003F); //end 0x013F   
   // Memory Write 0x2c
   // 16 bpp, 5-6-5. Assume color channel data is left-aligned
   b1 = (color->R&0xf8) | ((color->G&0xe0)>>5);
   b2 = ((color->G&0x1c)<<3) | ((color->B&0xf8)>>3);

« Last Edit: May 24, 2015, 08:53:47 PM by sli25 »


  • Administrator
  • Hero Member
  • *****
  • Posts: 357
  • Karma: 34
    • View Profile
Your initialization looks ok, it doesn't look like you are toggling the /CS signal (chip select).  Do you have this pin tied to ground?


  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Hi Michael,
Thanks for reply.
Yes I have tied CS to GND. However it doesn't work.


Problem setting "function select c" register

Started by jonmon6691Board OLEDs

Replies: 3
Views: 3884
Last post May 04, 2016, 02:44:37 PM
by Saurabh_B
NHD-4.3-480800EF-CTXP#-T - HX8369 continious memory write problem

Started by Henning_SBoard TFTs

Replies: 3
Views: 5211
Last post September 17, 2014, 06:51:40 AM
by Henning_S
Problem with WHITE COLOR CHAR on NHD-0440WH-ATMI-JT with 2 lines

Started by Mic71Board Character LCDs

Replies: 0
Views: 86
Last post November 04, 2018, 06:41:35 PM
by Mic71
NHD-1.8-128160EF-CTXI# problem: becomes pale after using it for some time

Started by fvdhoefBoard TFTs

Replies: 1
Views: 4523
Last post July 31, 2014, 08:55:40 AM
by Michael_L
NHD-0420H1Z-FL-GBW-33V3 - 2 Lines Mode Problem

Started by gnyturanBoard Character LCDs

Replies: 6
Views: 5315
Last post October 29, 2015, 01:23:58 PM
by Saurabh_B