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.


Topics - Guenther

Pages: [1]
1
TFTs / Testing Resistive Touch Panel
« on: December 22, 2016, 11:14:55 AM »
I have a NHD-2.4-240320CF-CSXN#-FT display with a resistive touch screen. I want to do a passive test of the touch screen by checking the resistance between YU,YL and XL,XR.

I connected my Ohm meter between YU and YL which shows no conductivity. Next I touch the screen and still no conductivity.

Is this the way to test a resistive touch panel?

Btw. I do have AR1021-I/SO and a TSC2003IPWR to test with as a next step.

/Guenther

2
TFTs / NHD-1.8-128160EF-CSXN#-F Programming
« on: February 03, 2016, 01:03:28 PM »
I recently purchased the above display together with the NHD-COG14-36 adapter, Molex connector and 2x12 pin header. I used the example 'NHD-1.8-128160EF with PIC32' and adapted it to my RC5600WM processor from digi.com. Besides any effort to verify my connection and coding the display plays dead - nothing whatsoever shows up on the display.

I am using 3.3V for VDD and IOVDD which should be the max according to specs. I verified every connection line that when I change it from my program that it reaches the Molex connector. My test program should fill the display with a single color but the display stays black. I turned on the backlight which showed all pixels white.

I would appreciate if someone could check for a mistake I made.

Thanks
Guenther

Code: [Select]
// Test NHD-1.8-128160EF-CSXN#-F display with RC5600WM processor
//
// Port A   - display DB0..DB7
// Port E.0 - !CS
// Port E.1 - !RST
// Port E.2 - D/C
// Port E.3 - !WR
// Port E.5 - !RD

#define TFT_18E_SET_NOT_CS   BitWrPortI(PEDR, &PEDRShadow, 1, 0)
#define TFT_18E_SET_CS       BitWrPortI(PEDR, &PEDRShadow, 0, 0)
#define TFT_18E_SET_NOT_RST  BitWrPortI(PEDR, &PEDRShadow, 1, 1)
#define TFT_18E_SET_RST      BitWrPortI(PEDR, &PEDRShadow, 0, 1)
#define TFT_18E_SET_D        BitWrPortI(PEDR, &PEDRShadow, 1, 2)
#define TFT_18E_SET_C        BitWrPortI(PEDR, &PEDRShadow, 0, 2)
#define TFT_18E_SET_NOT_WR   BitWrPortI(PEDR, &PEDRShadow, 1, 3)
#define TFT_18E_SET_WR       BitWrPortI(PEDR, &PEDRShadow, 0, 3)
#define TFT_18E_SET_NOT_RD   BitWrPortI(PEDR, &PEDRShadow, 1, 5)
#define TFT_18E_SET_RD       BitWrPortI(PEDR, &PEDRShadow, 0, 5)
#define TFT_18E_WRITE(data) WrPortI(PADR, &PADRShadow, data)
#define DELAY_10US(n) for (delay_10us = 0; delay_10us < 3*n; delay_10us++) {}

void TFT_18E_Initialize();
void TFT_18E_Write_Command(unsigned char command);
void TFT_18E_Write_Data(unsigned char data);

unsigned long delay_10us;

main()
{
   int i;
   unsigned long il;
   char data;

   // set port D bit 0 for high/low output for LED

   BitWrPortI(PDDCR, &PDDCRShadow, 0, 0);
   BitWrPortI(PDDDR, &PDDDRShadow, 1, 0);

   // set port A for high/low output

   WrPortI(SPCR, &SPCRShadow, 0x84);

   // set port E bits 0,1,2,3,5 for high/low output

   WrPortI(PEDDR, &PEDDRShadow, 0x2F);
   WrPortI(PEDCR, &PEDCRShadow, ~0x3F); // Keep output enabled for PE.4 which is
                                        // SMODE on the Interface Adapter

   // Hard reset TFT

   TFT_18E_SET_RST;
   DELAY_10US(15000);
   TFT_18E_SET_NOT_RST;
   DELAY_10US(15000);

   TFT_18E_Initialize();
   TFT_18E_SET_CS; // Chip select on for TFT
   TFT_18E_SET_NOT_RD; // TFT read off
   TFT_18E_SET_WR;

   // Fill screen with color

   TFT_18E_Write_Command(0x2A); // set column address 0 to 127
   TFT_18E_Write_Data(0x00);
   TFT_18E_Write_Data(0x00);
   TFT_18E_Write_Data(0x00);
   TFT_18E_Write_Data(0x7F);
   TFT_18E_Write_Command(0x2B); // set page address 0 to 159
   TFT_18E_Write_Data(0x00);
   TFT_18E_Write_Data(0x00);
   TFT_18E_Write_Data(0x00);
   TFT_18E_Write_Data(0x9F);
   TFT_18E_Write_Command(0x2C); // write memory start

   for (i = 0; i < 20480; i++)
   {
      // 18-bit pixel format

      TFT_18E_Write_Data(0x00);
      TFT_18E_Write_Data(0x00);
      TFT_18E_Write_Data(0xFF);
   }

   while (1)
   {
   }
}

void TFT_18E_Write_Command(unsigned char command)
{
   TFT_18E_SET_C;
   TFT_18E_WRITE(command);
   TFT_18E_SET_WR;
   DELAY_10US(15);
   TFT_18E_SET_NOT_WR;
}

void TFT_18E_Write_Data(unsigned char data)
{
   TFT_18E_SET_D;
   TFT_18E_WRITE(data);
   TFT_18E_SET_WR;
   TFT_18E_SET_NOT_WR;
}

void TFT_18E_Initialize()
{
   // Initialize TFT

   TFT_18E_Write_Command(0x11); // sleep out
   DELAY_10US(10000);
   TFT_18E_Write_Command(0x28); // display off
   TFT_18E_Write_Command(0x26);TFT_18E_Write_Data(0x04); // select gamma curve 4
   TFT_18E_Write_Command(0xF2);TFT_18E_Write_Data(0x00);
   TFT_18E_Write_Command(0xB1);TFT_18E_Write_Data(0x0A);TFT_18E_Write_Data(0x14);
   TFT_18E_Write_Command(0xC0);TFT_18E_Write_Data(0x0A);TFT_18E_Write_Data(0x00);
   DELAY_10US(1000);
   TFT_18E_Write_Command(0xC1);TFT_18E_Write_Data(0x02);
   DELAY_10US(1000);
   TFT_18E_Write_Command(0xC5);TFT_18E_Write_Data(0x2F);TFT_18E_Write_Data(0x3E);
   TFT_18E_Write_Command(0xC7);TFT_18E_Write_Data(0x40);
   TFT_18E_Write_Command(0x2A); // set column address 0 to 127
   TFT_18E_Write_Data(0x00);
   TFT_18E_Write_Data(0x00);
   TFT_18E_Write_Data(0x00);
   TFT_18E_Write_Data(0x7F);
   TFT_18E_Write_Command(0x2B); // set page address 0 to 159
   TFT_18E_Write_Data(0x00);
   TFT_18E_Write_Data(0x00);
   TFT_18E_Write_Data(0x00);
   TFT_18E_Write_Data(0x9F);
   TFT_18E_Write_Command(0x36);TFT_18E_Write_Data(0xC8); // set address mode
   TFT_18E_Write_Command(0x3A);TFT_18E_Write_Data(0x06); // set 18-bit pixel format
   TFT_18E_Write_Command(0x29); // set display on
   DELAY_10US(1000);
   TFT_18E_Write_Command(0x2C); // write memory start
}

Pages: [1]