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 - sli25

Pages: [1]
1
Hi Michael,
Yes, I confirmed it from the Logical Analyzer on the oscilloscope.

2
Hi Michael,
I have figured it out.
The reason I couldn't make it work was because the reset time for the WR signal is too short, which is 100ns. When I increased it into 1us, it works.
However, when I read the manual for reference, it says the minimum time for Write Control Pulse L Duration is 15ns. My previous code which didn't work definitely meet with this requirement. Did I misunderstand it?

Thanks!

3
Hi Michael,
Thanks for the reply.
I followed this sample code. However it doesn't work.
Do you have any more suggestions for it?

Thanks.

4
Hi Michael,
Thanks for reply.
Yes I have tied CS to GND. However it doesn't work.

5
Hi,

I am working on NHD‐2.4‐240320SF‐CTXL#‐FTN1, and it doesn't show anything I want it to show.
I don't know the problem comes from the initialization or the display function.
I would like to ask how to tell this LED has been initialized successfully?

Thanks!

6
Hi,
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;
...
 PM0 = _00_PMn0_MODE_OUTPUT | _00_PMn1_MODE_OUTPUT | _00_PMn2_MODE_OUTPUT | _00_PMn3_MODE_OUTPUT |
          _00_PMn4_MODE_OUTPUT | _00_PMn5_MODE_OUTPUT | _00_PMn6_MODE_OUTPUT | _80_PM0_DEFAULT;
PM5 = _00_PMn0_MODE_OUTPUT | _00_PMn1_MODE_OUTPUT | _00_PMn2_MODE_OUTPUT | _00_PMn3_MODE_OUTPUT |
          _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)
{
   /*
        GPIO_ResetBit(TFT_D_NC_POS);
   GPIO_Write(command);
   GPIO_ResetBit(TFT_NWR_POS);
   GPIO_SetBit(TFT_NWR_POS);
        */
        GPIO0_ResetBit(TFT_D_NC_POS);
       
        GPIO0_ResetBit(TFT_NWR_POS);
        GPIO5_Write(command);
        GPIO0_SetBit(TFT_NWR_POS);
       
}

/* Write one byte as data to the TFT LCD Controller. */
void TFT_24S_Write_Data(uint8_t data)
{
  /*
   GPIO_SetBit(TFT_D_NC_POS);
   GPIO_Write(data);
   GPIO_ResetBit(TFT_NWR_POS);
   GPIO_SetBit(TFT_NWR_POS);
  */
        GPIO0_SetBit(TFT_D_NC_POS);
        GPIO5_Write(data);
        GPIO0_ResetBit(TFT_NWR_POS);
        GPIO0_SetBit(TFT_NWR_POS);
 
}


/* Initialize the relevant peripherals (GPIO, TPM, ADC) and the display
components (TFT LCD controller, touch screen and backlight controller). */
void TFT_Init(void)
{
   TFT_GPIO_Init();
   //TFT_TS_Init();
   //TFT_Init_Backlight();
   
        GPIO0_SetBit(TFT_NRD_POS);
   GPIO0_ResetBit(TFT_NWR_POS);
   GPIO0_ResetBit(TFT_NRST_POS);
       
   Delay(120);
   GPIO0_SetBit(TFT_NRST_POS);
   Delay(120);
   
        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(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(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(0x00C7); //VCOM control 2
   TFT_24S_Write_Data(0x00BE);
   TFT_24S_Write_Command(0x0036); //memory access control = BGR
        TFT_24S_Write_Command(0x0088);
#if 1
   TFT_24S_Write_Data(0x0008); // Portrait mode
#else
   TFT_24S_Write_Data(0x00A8); // Landscape mode
#endif
   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(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
        Delay(10);
}

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(0);
   TFT_24S_Write_Data(pos->X & 0xff); //start
   TFT_24S_Write_Data(0x0000);
   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(0x0001);
   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);

   TFT_24S_Write_Command(0x002c);
   TFT_24S_Write_Data(b1);
   TFT_24S_Write_Data(b2);
}

Pages: [1]