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

Pages: 1 ... 16 17 [18] 19 20 ... 24
256
TFTs / Re: Getting started with NHD-2.4-240320SF-CTXI#-FT1
« on: July 02, 2014, 08:16:13 AM »
I'm not sure how fast your micro is running, but you may need to add more delay after the hard reset.  I have posted some Arduino code below that illustrates this, along with the rest of the initialization, and how to write to the display.  Please try to match this code as close as you can, as it is 100% working code:

Code: [Select]
//---------------------------------------------------------
/*
NHD_2_4_240320SF_CTXI_mega.ino
Program for writing to Newhaven Display 2.4 TFT with ILI9341 controller

(c)2014 Mike LaVine - Newhaven Display International, LLC.

        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
*/
//---------------------------------------------------------

// The 8 bit data bus is connected to PORTA of the Arduino Mega2560
// 5V voltage regulator on Arduino Mega has been replaced with a 3.3V regulator to

provide 3.3V logic

int RS = 30;      // RS signal connected to Arduino digital pin 30
int WR = 31;      // /WR signal connected to Arduino digital pin 31
int RD = 32;      // /RD signal connected to Arduino digital pin 32
int RES = 33;     // /RES signal connected to Arduino digital pin 33

// /CS signal tied to GND
// IM0 signal tied to VDD

void comm_out(unsigned char c)
{
  digitalWrite(RS, LOW);
  PORTA = c;
  digitalWrite(WR, LOW);
  digitalWrite(WR, HIGH);
}

void data_out(unsigned char d)
{
  digitalWrite(RS, HIGH);
  PORTA = d;
  digitalWrite(WR, LOW);
  digitalWrite(WR, HIGH);
}
void disp()
{
unsigned int i;
comm_out(0x2C);              //command to begin writing to frame memory
for(i=0;i<38400;i++)         //fill screen with blue pixels
{
    data_out(0x00);
            data_out(0x1F);
            data_out(0x00);
            data_out(0x1F);
}
        for(i=0;i<38400;i++)         //fill screen with green pixels
{
    data_out(0x07);
            data_out(0xE0);
            data_out(0x07);
            data_out(0xE0);
        }
}

void setup()
{
  DDRC = 0xFF;   
  PORTC = 0x00;
  DDRA = 0xFF;
  PORTA = 0x00;
  digitalWrite(RD, HIGH);
  digitalWrite(WR, LOW);
  digitalWrite(RES, LOW);
  delay(250);
  digitalWrite(RES, HIGH);
  delay(250);
 
  comm_out(0x28);                                  //display off
  comm_out(0x11);  //exit SLEEP mode
 
  comm_out(0xCB);  //power control A
  data_out(0x39);
  data_out(0x2C);
  data_out(0x00);
  data_out(0x34);
  data_out(0x02);
 
  comm_out(0xCF);  //power control B
  data_out(0x00);
  data_out(0x81);
  data_out(0x30);
 
  comm_out(0xC0);
  data_out(0x26);  //power control 1
  data_out(0x04);  //second parameter for ILI9340 (ignored by ILI9341)
 
  comm_out(0xC1);
  data_out(0x11);                  //power control 2
 
  comm_out(0xC5);
  data_out(0x35);
  data_out(0x3E);  //VCOM control 1
 
  comm_out(0x36);
  data_out(0x88);                  //memory access control = BGR
 
  comm_out(0xB1);
  data_out(0x00);
  data_out(0x18);  //frame rate control
 
  comm_out(0xB6);
  data_out(0x0A);
  data_out(0xA2);  //display function control
 
  comm_out(0xC7);
  data_out(0xBE);                  //VCOM control 2
 
  comm_out(0x3A);
  data_out(0x55);                  //pixel format = 16 bit per pixel
 
  /*comm_out(0xE0);
  data_out(0x1F);                  //positive gamma correction
  data_out(0x1B);
  data_out(0x18);
  data_out(0x0B);
  data_out(0x0F);
  data_out(0x09);
  data_out(0x46);
  data_out(0xB5);
  data_out(0x37);
  data_out(0x0A);
  data_out(0x0C);
  data_out(0x07);
  data_out(0x07);
  data_out(0x05);
  data_out(0x00);
 
  comm_out(0xE1);
  data_out(0x00);                  //negative gamma correction
  data_out(0x24);
  data_out(0x27);
  data_out(0x04);
  data_out(0x10);
  data_out(0x06);
  data_out(0x39);
  data_out(0x74);
  data_out(0x48);
  data_out(0x05);
  data_out(0x13);
  data_out(0x38);
  data_out(0x38);
  data_out(0x3A);
  data_out(0x1F);*/
 
  comm_out(0xF2);                  //3g damma control
  data_out(0x02);                  //off
 
  comm_out(0x26);                  //gamma curve 3
  data_out(0x01);
 
  comm_out(0x2A);
  data_out(0x00);                  //column address set
  data_out(0x00);                  //start 0x0000
  data_out(0x00);
  data_out(0xEF);                  //end 0x00EF
 
  comm_out(0x2B);
  data_out(0x00);                  //page address set
  data_out(0x00);                  //start 0x0000
  data_out(0x01);
  data_out(0x3F);                  //end 0x003F
 
  comm_out(0x29);                  //display ON

  delay(10);
}

void loop()
{
  disp();
  delay(1000);
}

257
Thank you for letting us know, this needs to be corrected.  For electrical characteristics of the blue 2.8" OLED, please refer to the non-multi font version, here:
http://www.newhavendisplay.com/specs/NHD-2.8-25664UCB2.pdf

258
TFTs / Re: TFT Mounting Options
« on: June 25, 2014, 08:38:51 AM »
If you would like to explore options for various films that can be put over the front of the display, you may take a look at www.viewthru.net, as they have several different types of these films.  As for adhesive, you may use any kind you wish.  I would recommend a very strong, double-sided adhesive for this.

259
TFTs / Re: NHD-7.0-800480EF-ATXV#-CTP touch screen details
« on: June 24, 2014, 10:33:38 AM »
If looking at the touch panel from the front (where you would touch the screen), the contact side is on the bottom and pin 1 is on the left side.  The FFC cable is marked with this as well.

I have also replied to your email with this information.

260
VDD and IOVDD can be tied together and both powered by 3.3V.  If you are trying to simply the interface I would recommend using this method instead.
Although doing what you have described may work, I cannot guarantee reliable operation.

261
OLEDs / Re: NHD-0420DZW-AG5 - Display "sometimes" shows only 2 lines
« on: June 18, 2014, 10:09:49 AM »
Glad you got it working, thank you for sharing!

262
OLEDs / Re: OLED Display Off Command
« on: June 16, 2014, 05:45:42 PM »
Correct.  If the display is powered down, you would need to re-initialize it.

263
OLEDs / Re: OLED Display Off Command
« on: June 13, 2014, 12:05:53 PM »
You can expect to save approximately 20mA of current drawn by the display.

264
OLEDs / Re: NHD-0420DZW-AG5 - Display "sometimes" shows only 2 lines
« on: June 13, 2014, 11:53:59 AM »
I'm not sure of the cause of your problem, as I have just tested this with an Arduino using your initialization and have not seen the same results as you have described.
I've powered it on/off several times, and have manually reset the processor as well and in all cases all 4 lines would work.
I have copied my code below if that helps with any other areas of code that you have not shared in your last post:

Code: [Select]
//---------------------------------------------------------
/*
NHD_0420DZW_mega.ino
Program for writing to Newhaven Display 4 x 20 Character OLED (8-bit, 6800 mode)

(c)2014 Mike LaVine - Newhaven Display International, LLC.

        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
*/
//---------------------------------------------------------

// The 8 bit data bus is connected to PORTA[7..0] of the Arduino Mega2560

int RS =  30;    // RS signal connected to digital pin 30 of Arduino Mega2560
int RW =  31;    // R/W signal connected to digital pin 31 of Arduino Mega2560
int  E =  32;    // E signal connected to digital pin 32 of Arduino Mega2560

const char text1[] = {"  Newhaven Display  "};
const char text2[] = {"   Character OLED   "};
const char text3[] = {"  4 Line x 20 Char  "};
const char text4[] = {"0123456789!@#$%^&*()"};

void toggle()
{
   digitalWrite(E, HIGH);
   delay(1);
   digitalWrite(E, LOW);
}

void command(char c)

   PORTA = c;
   digitalWrite(RS, LOW);
   toggle();
}

void data(char d)
{
   PORTA = d;
   digitalWrite(RS, HIGH);
   toggle();
}

void disp()
{
   int i;
   command(0x02);  //Home Command  [Set DDRAM address to Line 1 position 1]
   delay(5);
   for (i=0;i<20;i++)
   {
      data(text1[i]);
   }
   command(0xC0);  //Second Line  [Set DDRAM address to Line 2 position 1]
   for (i=0;i<20;i++)
   {
      data(text2[i]);
   }
   command(0x94);  //Third Line  [Set DDRAM address to Line 3 position 1]
   for (i=0;i<20;i++)
   {
      data(text3[i]);
   }
   command(0xD4);  //Fourth Line  [Set DDRAM address to Line 4 position 1]
   for (i=0;i<20;i++)
   {
      data(text4[i]);
   }
}

void setup()

   DDRA = 0xFF;    //set PORTA (dat bus) as output
   PORTA = 0x00;   //initialize PORTA to 0x00
   DDRC = 0xFF;    //set PORTC (control lines) as output
   PORTC = 0x00;   //initialize PORTC to 0x00

   command(0x3B);  //Function Set  [8-bit mode, Font Table: English/Japanese (FT[1:0] = 00)]
   command(0x08);  //Display OFF
   command(0x01);  //Display Clear
   command(0x06);  //Entry Mode Set  [Auto increment address when a character is written]
   command(0x02);  //Home Command  [Set DDRAM address to Line 1 position 1]
   command(0x0C);  //Display ON
}

void loop()

  disp();
  delay(3000);
}

265
OLEDs / Re: NHD-0420DZW-AG5 - Display "sometimes" shows only 2 lines
« on: June 12, 2014, 09:39:07 AM »
This issue only happens when power cycling the display and not when being powered on for the first time?  Can you share you initialization code?

266
Character LCDs / Re: I2C Controller (PIC16F960) more detail needed
« on: June 11, 2014, 09:42:28 AM »
The PIC controller datasheet we provide a link to in our spec is the actual datasheet for that PIC.  Have you looked at pages 184-186?  Also included in our datasheet is also a link to example code for our serial LCDs.  You may access this to help see how the interface works with our display.  In addition to that example code, you may also refer to the below Arduino code I have for this display:

Code: [Select]
//---------------------------------------------------------
/*
NHD_0216K3Z_mega.ino
Program for writing to Newhaven Display 2 x 16 (K3Z) Character LCD with PIC16F690 controller

(c)2014 Mike LaVine - Newhaven Display International, LLC.

        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
*/
//---------------------------------------------------------

#include <Wire.h>

int ASDA = 20;      // SDA signal connected to pin 20 (SDA) of Arduino Mega 2560
int ASCL = 21;      // SCL signal connected to pin 21 (SCL) of Arduino Mega 2560

unsigned char text1[]={"Newhaven Display"};
unsigned char text2[]={" International  "};

unsigned char tx_packet[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);

const char slave2w = 0x28;   //0x50 shifted over 1 bit

void send_packet(unsigned char x)
{
  unsigned char ix;
  Wire.beginTransmission(slave2w);
  for(ix=0;ix<x;ix++)
  {
    Wire.write(tx_packet[ix]);
  }
  Wire.endTransmission();
}

void lcd_cursor(unsigned int x)
{
  tx_packet[0] = 0xFE;
  tx_packet[1] = 0x45;
  tx_packet[2] = x;
  send_packet(3);
}

void lcd_clear(void)
{
  tx_packet[0] = 0xFE;
  tx_packet[1] = 0x51;
  send_packet(2);
}

void setup()       //runs first when powered on
{
  pinMode(ASCL, OUTPUT);      //set Arduino I2C lines as outputs
  pinMode(ASDA, OUTPUT);      //
  digitalWrite(ASCL, LOW);    //
  digitalWrite(ASDA, LOW);    //
  delay(100);    //100ms delay
}

void loop()
{
  Wire.begin();             //initialize Arduino I2C
  TWBR = 152;               //change Arduino Mega 2560 I2C clock frequency from 100kHz to 50kHz
  lcd_clear();
 
  tx_packet[0] = 0xFE;
  tx_packet[1] = 0x52;
  tx_packet[2] = 40;        //contrast 1 - 50
  send_packet(3);
 
  tx_packet[1] = 0x53;     
  tx_packet[2] = 15;        //backlight 1 - 15
  send_packet(3);
 
  tx_packet[1] = 0x48;      //underline cursor off
  send_packet(2);
 
  tx_packet[1] = 0x46;      //cursor home
  send_packet(2);
 
  delay(250);
 
  while(1)
  {
  for(unsigned char i=0;i<16;i++)
  {
    tx_packet[i] = text1[i];
  }
  send_packet(16);
 
  lcd_cursor(0x40);
  delay(100);  //100ms delay
 
  for(unsigned char i=0;i<16;i++)
  {
    tx_packet[i] = text2[i];
  }
  send_packet(16);
  delay(1000);
  }
}


Any other detailed information regarding that PIC controller can be found in the datasheet for it, accessible by clicking the link to it in our spec.

267
TFTs / Re: NHD-4.3-480800EF-CTXP-T display video?
« on: June 10, 2014, 08:57:49 AM »
The NHD-4.3-480800EF-CTXP-T has a built-in controller, and therefore using the digital RGB interface with HSYNC and VSYNC is not available.  All MCU communication is done through the built-in TFT controller.  You may refer to page 6 of the display's datasheet for write cycle timing information.  You will see that the timing requirements are very short, allowing for very fast writing to the controller.  Also, the display uses a 16-bit interface, which is double the speed of the 8-bit interfaces.

268
Character LCDs / Re: Map of test points on the back of a display?
« on: June 09, 2014, 08:45:57 AM »
I assume you are referring to the vias on the PCB.  In any case, schematics for the display are unfortunately unavailable.  If traces were lifted on the PCB, I would recommend purchasing another one and using the designated thru-hole connections available.

269
TFTs / Re: NHD-4.3-480800EF-CTXP-T display video?
« on: June 06, 2014, 11:58:47 AM »
The display can handle 50Hz video (you can see this from the timing requirements in the datasheet for the display and for the controller it uses).
As you said, the bottleneck is the MPU being too slow.
If you can send the videostream to the parallel interface and are within the timing specifications given, your video should work fine.  I'm sorry but we do not have any application notes or recommended components to use to accomplish this.

270
OLEDs / Re: NHD-2.7-12864UMY3
« on: June 05, 2014, 08:15:59 AM »
The display will not show anything unless it's initialized and has data written to it.  You will not see anything turn on with only VDD and GND connected.

From looking at your code, it seems you are using some sort of library for the display's functions.  I don't know if that library works with our displays, as I do not know what controller it was written for, nor can I see any of the low level functions.  I would suggest using our available example code for the 2.7" OLED.  The code uses a parallel interface, but if you must use serial, you can still use the same initialization but you would have to follow the serial interface timing requirements and protocol as shown in the datasheet.

Link to example code: http://www.newhavendisplay.com/app_notes/OLED_2_7_12864.txt

Link to display's datasheet: http://www.newhavendisplay.com/specs/NHD-2.7-12864UMY3.pdf

Link to controller's datasheet (for more details): http://www.newhavendisplay.com/app_notes/SSD1325.pdf

Pages: 1 ... 16 17 [18] 19 20 ... 24