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 2 3 [4] 5 6 ... 24
46
I'm sorry to hear you are having troubles getting the display to work, however I can assure you this code does work, as it has been confirmed with our testing, along with customers that have used it.  I can only assume the MCU you are using is not being configured correctly, or there is a timing issue.  Can you verify the communication and timing with an oscilloscope (timing specifications are given in the datasheet)?  Are you using 3.3V for both VDD and logic? Also, do you have any other displays to try on the off chance you have a defective unit?

47
How fast are you running your I2C communcation?  Can you try slowing it down and testing it again just for troubleshooting?  Do you have any other displays to test?

48
I've not heard of this before.  Are you sure you are reading the bits correctly?  Do you have another one of these displays to test?

49
Correct, you would need to be able to change that pin to be able to send the command to change the page.  Why are you unable to change it?

50
Have you used our example code for your program?  The initialization there is good, as well as the write command/data routines.
See below:

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

(c)2013 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);
}

51
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?

52
The execution time applies to each type of data transfer as indicated in the datasheet's command table on page 6.  After each transfer, the execution shown should be allowed for before sending another byte of data.

The timing for the RS is shown in the timing diagram / table in the datasheet.  These timing requirements are what need to be met for the display's proper use.  Therefore, anything you are trying to do that violates these requirements will not guarantee reliable operation.

53
You can send multiple bytes of data following a command to set the DDRAM address, as the address counter will increment automatically.  The RS line doesn't need to be pulsed, it is an indicator for the display's controller to interpret the byte being sent as either a command or data (Command: RS = Low | Data: RS = High).  So, if you were to send 8 bytes of data for example, you would only need to bring RS high before the first data write, and proceed to write the 7 remaining bytes while RS is still high.

54
TFTs / Re: ILI9341 Reading Display RAM
« on: May 04, 2015, 01:36:09 PM »
We unfortunately don't have any code examples to read from the display's RAM, however all relevant information pertaining to the read cycle is available in the ILI9341 controller datasheet.  (See pages 30 - 32, 116)  Please also take note of the attached image below (from page 10).

55
TFTs / Re: Writing to display is slow
« on: May 04, 2015, 12:58:21 PM »
You are correct, that is way too slow!  You should be able to fill the display in much under 1 second.  Have you verified your delay routine to be the correct amount of time?
What else is going on in these routines (before and after each write)?  Also, a tip to increase write speed of the full screen is to drive D/C high only once at the beginning of a screen write, rather than toggling it each byte transfer.  This tip is not intended to be the solution to your issues, but just a way to further decrease write times.

56
Character LCDs / Re: NHD-0108BZ-RN-YBW-33W -- NO display!!
« on: May 01, 2015, 04:49:02 PM »
Yes, you may connect 0.1V to V0 without it being adjustable, it is just easy to troubleshoot with an adjustable supply, so you can absolutely rule out not being able to see any characters due to improper contrast voltage.
From what you have said, it seems the 4-bit communication is ok.  Have you tried switching the order of how you send each nibble? (Worth a try)
Otherwise, since the interface seems to be ok, are you able to write to a particular DDRAM location and then read that same location and obtain the character value you wrote?

57
Character LCDs / Re: NHD-0108BZ-RN-YBW-33W -- NO display!!
« on: May 01, 2015, 07:46:35 AM »
You mention 4-bit interface works, but you also mention there is nothing on the display; can you please clarify this?
V0 pin should have approx. 0.1V applied to it, but you should wire it as shown in the wiring diagram so it is adjustable.
I am not familiar with using an FPGA to drive it, however our example code is correct, at least when used with CPU software.  Yes, the ascii code for a 1 is 0x31, but you also need to initialize the display, and set the address location of where you want to write to, as shown in the example.

58
Character LCDs / Re: NHD-C0216CZ-NSW-BBW-3V3 LCD initialization
« on: May 01, 2015, 07:40:15 AM »
It might be worth a try to give those write routines in the datasheet a try, just as a means of troubleshooting.  That code should work regardless of what mcu you are using, therefore it will make for a good test.

60
Character LCDs / Re: NHD-C0220Biz and Arduino/Teensy3.1
« on: April 25, 2015, 08:19:42 PM »
I'm sorry but unfortunately we do not have a library for the display with the teensy mcu.  What we do have is the example code provided on our website, here: http://www.newhavendisplay.com/app_notes/NHD-C0220BiZ.txt.
If you come across any libraries for the teensy that are designed to drive an ST7036 display controller, they should work for our display.
As for your other question, is the display the only device present on the i2c bus when it is locking up?  Have you tried using 10kOhm pull-ups?

Pages: 1 2 3 [4] 5 6 ... 24