Recent Posts

Pages: 1 [2] 3 4 ... 10
11
TFTs / NHD-2.8-240320AF-CSXP-FCTP and ARDUINO UNO
« Last post by rrubiocastil on November 03, 2019, 12:47:52 PM »
I use 262K-colors in 18bit/pixel format (8 bit interface) and it does not work. All I see is a random white line. The screen goes to black when I disable the Display ON command. Here is my code:

void setup() {

DDRD = 0xff;  // output (port D)

//set pins as outputs
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);

//control pin definitions
#define CS2HIGH()  digitalWrite(8, HIGH);
#define CS2LOW()  digitalWrite(8, LOW);
#define WR2HIGH()  digitalWrite(9, HIGH);
#define WR2LOW()  digitalWrite(9, LOW);
#define DCX2HIGH()  digitalWrite(10, HIGH);
#define DCX2LOW()  digitalWrite(10, LOW);
#define RD2HIGH()  digitalWrite(11, HIGH);
#define RD2LOW()  digitalWrite(11, LOW);
#define RESET2HIGH()   digitalWrite(12, HIGH);
#define RESET2LOW()   digitalWrite(12, LOW);

/////////////////////// prototypes ////////////////////////////
void TFT_28_7789_Write_Command(unsigned int command);
void TFT_28_7789_Write_Data(unsigned int data);
void TFT_28_7789_Init(void);


   
    TFT_28_7789_Init();
   
   

}

void loop() {

   
 
}


void TFT_28_7789_Write_Command(unsigned int command)
{
CS2LOW(); //GPIO_ResetBits(GPIOC, CS1);
DCX2LOW(); //GPIO_ResetBits(GPIOC, RS);
RD2HIGH(); //GPIO_SetBits(GPIOC, nRD);
WR2LOW(); //GPIO_ResetBits(GPIOC, nWR);
PORTD = command; //GPIO_Write(GPIOB, command); 8-bit interface (DB17:10)
delay(10);
WR2HIGH(); //GPIO_SetBits(GPIOC, nWR);
delay(10);
}

void TFT_28_7789_Write_Data(unsigned int data1)
{
PORTD = data1; //GPIO_Write(GPIOB, data1);//when using 16-bit interface (DB17:10,DB8:1)//when using 8-bit interface (DB17:10)
DCX2HIGH(); //GPIO_SetBits(GPIOC, RS);
WR2LOW(); //GPIO_ResetBits(GPIOC, nWR);
delay(1);
WR2HIGH(); //GPIO_SetBits(GPIOC, nWR);
}


void TFT_28_7789_Init(void)
{
CS2LOW(); //GPIO_ResetBits(GPIOC, CS1);
RD2HIGH(); //GPIO_SetBits(GPIOC, nRD);
WR2LOW(); //GPIO_ResetBits(GPIOC, nWR);
RESET2LOW(); //GPIO_WriteBit(GPIOC, RES, Bit_RESET); //reset por HW
delay(250);
RESET2HIGH(); //GPIO_WriteBit(GPIOC, RES, Bit_SET); (influye)
delay(250);

//exit SLEEP mode (SLEEP OUT))
TFT_28_7789_Write_Command(0x0011); //influye
delay(100);

//MADCTL: memory data access control
TFT_28_7789_Write_Command(0x0036);
TFT_28_7789_Write_Data(0x0080); 

//Pixel format set
TFT_28_7789_Write_Command(0x003A);
TFT_28_7789_Write_Data(0x0055);

//INVON: Display Inversion ON (setting for IPS)
TFT_28_7789_Write_Command(0x0021);

//PORCTRK: Porch setting
TFT_28_7789_Write_Command(0x00B2);
TFT_28_7789_Write_Data(0x000C);
TFT_28_7789_Write_Data(0x0C);
TFT_28_7789_Write_Data(0x00);
TFT_28_7789_Write_Data(0x33);
TFT_28_7789_Write_Data(0x33);

//GCTRL: Gate Control
TFT_28_7789_Write_Command(0x00B7);
TFT_28_7789_Write_Data(0x0035);

//VCOMS: VCOM setting
TFT_28_7789_Write_Command(0x00BB);
TFT_28_7789_Write_Data(0x002B);

//LCMCTRL: LCM Control
TFT_28_7789_Write_Command(0x00C0);
TFT_28_7789_Write_Data(0x002C);

//VDVVRHEN: VDV and VRH Command Enable
TFT_28_7789_Write_Command(0x00C2);
TFT_28_7789_Write_Data(0x0001);
TFT_28_7789_Write_Data(0xFF);

//VRHS: VRH Set
TFT_28_7789_Write_Command(0x00C3);
TFT_28_7789_Write_Data(0x0011);

//VDVS: VDV Set
TFT_28_7789_Write_Command(0x00C4);
TFT_28_7789_Write_Data(0x0020);

//FRCTRL2: Frame Rate control in normal mode
TFT_28_7789_Write_Command(0x00C6);
TFT_28_7789_Write_Data(0x000F);

//PWCTRL1: Power Control 1 (6.8, -4.8, 2.3)
TFT_28_7789_Write_Command(0x00D0);
TFT_28_7789_Write_Data(0x00A4);
TFT_28_7789_Write_Data(0xA1);

//PVGAMCTRL: Positive Voltage Gamma control
TFT_28_7789_Write_Command(0x00E0);
                  TFT_28_7789_Write_Data(0x00D0);
                  TFT_28_7789_Write_Data(0x0000);
                  TFT_28_7789_Write_Data(0x0005);
                  TFT_28_7789_Write_Data(0x000E);
                  TFT_28_7789_Write_Data(0x0015);
                  TFT_28_7789_Write_Data(0x000D);
                  TFT_28_7789_Write_Data(0x0037);
                  TFT_28_7789_Write_Data(0x0043);
                  TFT_28_7789_Write_Data(0x0047);
                  TFT_28_7789_Write_Data(0x0009);
                  TFT_28_7789_Write_Data(0x0015);
                  TFT_28_7789_Write_Data(0x0012);
                  TFT_28_7789_Write_Data(0x0016);
                  TFT_28_7789_Write_Data(0x0019);

//NVGAMCTRL: Negative Voltage Gamma control
TFT_28_7789_Write_Command(0x00E1);
                  TFT_28_7789_Write_Data(0x00D0);
                  TFT_28_7789_Write_Data(0x0000);
                  TFT_28_7789_Write_Data(0x0005);
                  TFT_28_7789_Write_Data(0x000D);
                  TFT_28_7789_Write_Data(0x000C);
                  TFT_28_7789_Write_Data(0x0006);
                  TFT_28_7789_Write_Data(0x002D);
                  TFT_28_7789_Write_Data(0x0044);
                  TFT_28_7789_Write_Data(0x0040);
                  TFT_28_7789_Write_Data(0x000E);
                  TFT_28_7789_Write_Data(0x001C);
                  TFT_28_7789_Write_Data(0x0018);
                  TFT_28_7789_Write_Data(0x0016);
                  TFT_28_7789_Write_Data(0x0019);


//X address set (CASET) de 0 a 239
TFT_28_7789_Write_Command(0x002A);
TFT_28_7789_Write_Data(0x0000);
TFT_28_7789_Write_Data(0x0000);
TFT_28_7789_Write_Data(0x0000);
TFT_28_7789_Write_Data(0x00EF);

//Y address set (PASET) de 0 a 319
TFT_28_7789_Write_Command(0x002B);
TFT_28_7789_Write_Data(0x0000);
TFT_28_7789_Write_Data(0x0000);
TFT_28_7789_Write_Data(0x0001);
TFT_28_7789_Write_Data(0x003F);

delay(10);

//Display ON
TFT_28_7789_Write_Command(0x0029);


  //RGB definition
    unsigned int Rcolor;
    unsigned int Gcolor;
    unsigned int Bcolor;
   
    Rcolor = 0b11110100;
    Gcolor = 0b10000100;
    Bcolor = 0b00110100;
     
TFT_28_7789_Write_Command(0x002C); 
    TFT_28_7789_Write_Data(0x0a);
    TFT_28_7789_Write_Data(0x0c);
    TFT_28_7789_Write_Data(0x0b);

}


************

All I get is this: https://ibb.co/QbmKxNv

Any suggestions?



12
TFTs / Re: Help needed to configure NHD-4.3RTP-SHIELD-N with Ardunio Due
« Last post by Ted_M on November 01, 2019, 08:33:45 AM »
Hi,

The Hello World example code was written to be used with the Arduino UNO and therefore will not compile on the DUE without software changes.

We recommend running the NHD-4.3RTP-SHIELD-N with a 5v version Arduino such as the UNO, Mega 2560 or other 5V compatible versions as the SHIELD requires to be driven with a 5V source as listed in our user guide.  http://www.newhavendisplay.com/userguides/NHD-4.3CTP-SHIELD_User_Guide.pdf

Unfortunately the Arduino Due is not compatible with the SHIELD as it would supply it with only 3.3v volts.


Best Regards,
13
TFTs / Help needed to configure NHD-4.3RTP-SHIELD-N with Ardunio Due
« Last post by InstantHomeRV on October 31, 2019, 10:28:40 PM »
Hi,

I have just purchased the NHD-4.3RTP-SHIELD-N for a project that will require the Arduino Due. The Arduino Due is needed in order to drive a couple Hall Effect actuators. I have just installed the Arduino Due with the NHD-4.3RTP-SHIELD-N and downloaded the recommended FTDI_FT800 library. I proceeded to load the "Hello World" example sketch to verify the operation. However, I could not even able to compile due to numerous errors:

"Arduino: 1.8.10 (Windows 10), Board: "Arduino Due (Programming Port)"

In file included from C:\Users\IH Non-Admin\Documents\Arduino\libraries\FTDI_FT800\examples\FT_NHD_43RTP_SHIELD\Basic\HelloWorld\HelloWorld.ino:30:0:

C:\Users\IH Non-Admin\Documents\Arduino\libraries\FTDI_FT800/FT_NHD_43RTP_SHIELD.h:44:37: error: conflicting declaration 'typedef const unsigned char prog_uchar'

 typedef PROGMEM const unsigned char prog_uchar;

                                     ^

In file included from C:\Users\IH Non-Admin\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/Arduino.h:31:0,

                 from sketch\HelloWorld.ino.cpp:1:

C:\Users\IH Non-Admin\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/avr/pgmspace.h:40:23: error: 'prog_uchar' has a previous declaration as 'typedef unsigned char prog_uchar'

 typedef unsigned char prog_uchar;

                       ^

In file included from C:\Users\IH Non-Admin\Documents\Arduino\libraries\FTDI_FT800\examples\FT_NHD_43RTP_SHIELD\Basic\HelloWorld\HelloWorld.ino:30:0:

C:\Users\IH Non-Admin\Documents\Arduino\libraries\FTDI_FT800/FT_NHD_43RTP_SHIELD.h:45:28: error: conflicting declaration 'typedef const char prog_char'

 typedef PROGMEM const char prog_char;

….
Multiple libraries were found for "SPI.h"
 Used: C:\Users\Tuan
Multiple libraries were found for "Wire.h"
 Used: C:\Users\Tuan
Multiple libraries were found for "FT_NHD_43RTP_SHIELD.h"
 Used: C:\Users\Tuan
exit status 1
Error compiling for board Arduino Due (Programming Port).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Sorry for the long error snipet. Could you please tell me why the code won't compile? I thought this is a simple test file that have been thoroughly vetted.

Thank you for any assistance that you can provide.

 
14
Graphic LCDs / Re: Trying to get NHD-C160100DiZ-FSW-FBW to work
« Last post by Alee_S on October 30, 2019, 10:49:32 AM »
Hi NaxNir,

Please contact us at nhtech@newhavendisplay.com and we can e-mail you some sample code written for this display using an Arduino Mega for reference  :)

Best,

Alee_S
15
OLEDs / Re: NHD-2.7-12864WDW3-M Graphic OLED Display
« Last post by Alee_S on October 28, 2019, 01:50:49 PM »
Hi sporubcan,

Please ensure that the BS0 and BS1 pins are configured for the appropriate serial interface for this display:
http://www.newhavendisplay.com/specs/NHD-2.7-12864WDW3-M.pdf

Best,

16
Graphic LCDs / Re: Display NHD-C12864WO-B1TFH#-M contrast options.
« Last post by Alee_S on October 28, 2019, 01:43:00 PM »
Hi Craig,

The main mechanism for controlling and adjusting the contrast is through the external resistor network as labeled on the wiring diagram.
The internal contrast control can be used to tune the contrast such as the electronic volume command, but this may not yield significant change in the contrast levels when compared to utilizing a potentiometer in the circuit for this particular display.
As you pointed out, the ‘IRS’ pin for selecting the voltage level adjustment is not brought out to the user, however it may still be possible to apply the necessary voltage externally to VR while excluding adding the external resistor network, and it may be beneficial to test this in your design.

Best,



17
TFTs / Re: NHD-2.4-240320CF-CSXN#-F with ESP32 Devkit V1
« Last post by Gerdchen03 on October 25, 2019, 07:39:35 AM »
Newhaven Display has published a demo code, but it is not be written for Arduino.

Code: [Select]
//---------------------------------------------------------
/*
(c)2014 Curt Lagerstam - 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.
*/
//---------------------------------------------------------

/*******************************************************************************
* Function Name  : TFT_24_7789_Init
* Description    : Initializes LCD with built-in ST7789S controller.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void TFT_24_7789_Init(void)
{
int n;
GPIO_ResetBits(GPIOC, CS1);
GPIO_SetBits(GPIOC, nRD);
GPIO_ResetBits(GPIOC, nWR);
GPIO_WriteBit(GPIOC, RES, Bit_RESET);
TFT_delay(100);
GPIO_WriteBit(GPIOC, RES, Bit_SET);
TFT_delay(100);
TFT_24_7789_Write_Command(0x0011);//exit SLEEP mode
TFT_delay(100);

TFT_24_7789_Write_Command(0x0036);TFT_24_7789_Write_Data(0x0080);//MADCTL: memory data access control
TFT_24_7789_Write_Command(0x003A);TFT_24_7789_Write_Data(0x0066);//COLMOD: Interface Pixel format *** I use 262K-colors in 18bit/pixel format when using 8-bit interface to allow 3-bytes per pixel
//TFT_24_7789_Write_Command(0x003A);TFT_24_7789_Write_Data(0x0055);//COLMOD: Interface Pixel format  *** I use 65K-colors in 16bit/pixel (5-6-5) format when using 16-bit interface to allow 1-byte per pixel
TFT_24_7789_Write_Command(0x00B2);TFT_24_7789_Write_Data(0x000C);TFT_24_7789_Wri​te_Data(0x0C);TFT_24_7789_Write_Data(0x00);TFT_24_7789_Write_Data(0x33);TFT_24_7​789_Write_Data(0x33);//PORCTRK: Porch setting
TFT_24_7789_Write_Command(0x00B7);TFT_24_7789_Write_Data(0x0035);//GCTRL: Gate Control
TFT_24_7789_Write_Command(0x00BB);TFT_24_7789_Write_Data(0x002B);//VCOMS: VCOM setting
TFT_24_7789_Write_Command(0x00C0);TFT_24_7789_Write_Data(0x002C);//LCMCTRL: LCM Control
TFT_24_7789_Write_Command(0x00C2);TFT_24_7789_Write_Data(0x0001);TFT_24_7789_Wri​te_Data(0xFF);//VDVVRHEN: VDV and VRH Command Enable
TFT_24_7789_Write_Command(0x00C3);TFT_24_7789_Write_Data(0x0011);//VRHS: VRH Set
TFT_24_7789_Write_Command(0x00C4);TFT_24_7789_Write_Data(0x0020);//VDVS: VDV Set
TFT_24_7789_Write_Command(0x00C6);TFT_24_7789_Write_Data(0x000F);//FRCTRL2: Frame Rate control in normal mode
TFT_24_7789_Write_Command(0x00D0);TFT_24_7789_Write_Data(0x00A4);TFT_24_7789_Wri​te_Data(0xA1);//PWCTRL1: Power Control 1
TFT_24_7789_Write_Command(0x00E0);TFT_24_7789_Write_Data(0x00D0);
                                  TFT_24_7789_Write_Data(0x0000);
                                  TFT_24_7789_Write_Data(0x0005);
                                  TFT_24_7789_Write_Data(0x000E);
                                  TFT_24_7789_Write_Data(0x0015);
                                  TFT_24_7789_Write_Data(0x000D);
                                  TFT_24_7789_Write_Data(0x0037);
                                  TFT_24_7789_Write_Data(0x0043);
                                  TFT_24_7789_Write_Data(0x0047);
                                  TFT_24_7789_Write_Data(0x0009);
                                  TFT_24_7789_Write_Data(0x0015);
                                  TFT_24_7789_Write_Data(0x0012);
                                  TFT_24_7789_Write_Data(0x0016);
                                  TFT_24_7789_Write_Data(0x0019);//PVGAMCTRL: Positive Voltage Gamma control   
TFT_24_7789_Write_Command(0x00E1);TFT_24_7789_Write_Data(0x00D0);
                                  TFT_24_7789_Write_Data(0x0000);
                                  TFT_24_7789_Write_Data(0x0005);
                                  TFT_24_7789_Write_Data(0x000D);
                                  TFT_24_7789_Write_Data(0x000C);
                                  TFT_24_7789_Write_Data(0x0006);
                                  TFT_24_7789_Write_Data(0x002D);
                                  TFT_24_7789_Write_Data(0x0044);
                                  TFT_24_7789_Write_Data(0x0040);
                                  TFT_24_7789_Write_Data(0x000E);
                                  TFT_24_7789_Write_Data(0x001C);
                                  TFT_24_7789_Write_Data(0x0018);
                                  TFT_24_7789_Write_Data(0x0016);
                                  TFT_24_7789_Write_Data(0x0019);//NVGAMCTRL: Negative Voltage Gamma control
TFT_24_7789_Write_Command(0x002A);TFT_24_7789_Write_Data(0x0000);TFT_24_7789_Wri​te_Data(0x0000);TFT_24_7789_Write_Data(0x0000);TFT_24_7789_Write_Data(0x00EF);//X address set
TFT_24_7789_Write_Command(0x002B);TFT_24_7789_Write_Data(0x0000);TFT_24_7789_Wri​te_Data(0x0000);TFT_24_7789_Write_Data(0x0001);TFT_24_7789_Write_Data(0x003F);//Y address set

TFT_delay(10);
}




/*******************************************************************************
* Function Name  : TFT_24_7789_Write_Command
* Description    : writes a 1 byte command to 2.4" TFT.
* Input          : command = one byte command (register address)
* Output         : None
* Return         : None
*******************************************************************************/
void TFT_24_7789_Write_Command(unsigned int command)
{
GPIO_ResetBits(GPIOC, CS1);
GPIO_ResetBits(GPIOC, RS);
GPIO_SetBits(GPIOC, nRD);
GPIO_ResetBits(GPIOC, nWR);
GPIO_Write(GPIOB, command);//when using 16-bit interface (DB17:10,DB8:1)//when using 8-bit interface (DB17:10)
TFT_delay(10);
GPIO_SetBits(GPIOC, nWR);
TFT_delay(1);
}

/*******************************************************************************
* Function Name  : TFT_24_7789_Write_Data
* Description    : writes 1 byte of data to 2.4" TFT.
* Input          : data1 = one byte of display data or command parameter
* Output         : None
* Return         : None
*******************************************************************************/
void TFT_24_7789_Write_Data(unsigned int data1)
{
GPIO_Write(GPIOB, data1);//when using 16-bit interface (DB17:10,DB8:1)//when using 8-bit interface (DB17:10)
GPIO_SetBits(GPIOC, RS);
GPIO_ResetBits(GPIOC, nWR);
TFT_delay(1);
GPIO_SetBits(GPIOC, nWR);
}







/*******************************************************************************
* Function Name  : TFT_24_7789_demo
* Description    : Loads bmp from SD card and writes to NHD-2.4-240320CF-CTXI#.
* Input          : None
* Output         : None
* Return         : 1-end of function reached
*******************************************************************************/
int TFT_24_7789_demo(void)
{
GPIO_SetBits(GPIOC, IM0);        //8-bit mode
//GPIO_ResetBits(GPIOC, IM0);        //16-bit mode
TFT_24_7789_Init();
TFT_24S_Write_Command(0x002C);                //Memory write

for (n=0;n<3;n++){
    memset(RGB16,0x0000,sizeof(RGB16));
    for (i=0;i<25600;i++)                    //for each 24-bit pixel...
    {
        f_read(&File1, &blue, 1, &blen);    //read the blue 8-bits
        f_read(&File1, &green, 1, &blen);    //read the green 8-bits
        f_read(&File1, &red, 1, &blen);        //read the red 8-bits
       
/* un-comment below for 8-bit interface */
        GPIO_SetBits(GPIOC, RS);
       
        GPIO_Write(GPIOB, red);
        GPIO_ResetBits(GPIOC, nWR);
        GPIO_SetBits(GPIOC, nWR);
       
        GPIO_Write(GPIOB, green);
        GPIO_ResetBits(GPIOC, nWR);
        GPIO_SetBits(GPIOC, nWR);
       
        GPIO_Write(GPIOB, blue);
        GPIO_ResetBits(GPIOC, nWR);
        GPIO_SetBits(GPIOC, nWR);
       
/* END of 8-bit interface */

/* un-comment below for 16-bit interface */
//
//        red=red>>3;                               //shift down to 5-bits
//        green=green>>2;                        //shift down to 6-bits
//        blue=blue>>3;                        //shift down to 5-bits
//        RGB16[i]= (RGB16[i] | red);            //put red 5-bits into int
//        RGB16[i]= (RGB16[i] << 6);            //move red bits over, make room for green
//        RGB16[i]= (RGB16[i] | green);        //put green 6-bits into int
//        RGB16[i]= (RGB16[i] << 5);            //move red and green bits over, make room for blue
//        RGB16[i]= (RGB16[i] | blue);        //put blue 5-bits into int
//        GPIO_Write(GPIOB, RGB16[i]);
//        GPIO_SetBits(GPIOC, RS);
//        GPIO_ResetBits(GPIOC, nWR);
//        GPIO_SetBits(GPIOC, nWR);
//                                     
/* END of 16-bit interface */

    }
}
                   
TFT_24_7789_Write_Command(0x0029);                //display ON

return 1;
}
19
TFTs / ILI9341 Controller board
« Last post by ezed413 on October 24, 2019, 07:58:08 AM »
Are there any off the shelf ILI9341 controller boards for the NHD-3.5-320240MF-ASXN# TFT display. I want to drive the display with this controller using a ESP32 MCU. I am using Embedded Wizard for the GUI design and there is a software driver for this controller.
20
TFTs / Re: Using the NHD-3.5-320240MF-20 with the HND-3.5-320240MF-ASXN#ND
« Last post by rrubiocastil on October 22, 2019, 12:43:15 AM »
Hello ezed413, did your code work?
I am using a PIC24F curiosity board (xc16 compiler)
Pages: 1 [2] 3 4 ... 10