Elec Freaks 3.2" Colour TFT touch screen panel (HCARDU0097)

LCD, TFT, OLED, LED modules
admin
Site Admin
Posts: 727
Joined: Sun Aug 05, 2012 4:02 pm

Elec Freaks 3.2" Colour TFT touch screen panel (HCARDU0097)

Post by admin » Thu Jun 18, 2015 3:05 pm

Image
Pictured with Arduino Mega and HCARDU0098 adaptor shield (not supplied).
Image
Rear side of shield showing SD card adaptor.



Image

This feature rich 262K colour TFT module (HCARDU0097) has a resolution 320 x 240 pixels (QVGA) and includes a ILI Technology SSD1289 or ILI9341 controller for easy interface to microcontrollers. Additionally this module also includes a resistive touch screen capability making this screen very versatile as a configurable human interface for your microcontoller project. Finally to allow offloading of graphic information from your microcontrollers memory, an SD card interface is also included.

If you wish to interface this screen to an Arduino Mega please see our shield adapter board (HCARDU0098) which will not only allow easy connection of the screen to your Arduino, but will also level shift the interface pins to the correct voltage levels.


Image

SSD1289 or ILI9341 240RGBx320 a-Si 262K color TFT controller
ADS7843 compatible touch panel controller
Standard SD card interface
Support 16 bit RGB565 format , can connect any 16 bit data bus
Onboard 3.3V regulator requires just a single 5V supply
3.3V I/O voltage level tolerance
Module Size (L * W * H): 95 * 65 * 20mm including connector





Example Arduino Sketch Using HCTFT Library:

Code: Select all

/* FILE:    HCTFT_Example_1_Random_Graphics
   DATE:    17/06/15
   VERSION: 0.1
   AUTHOR:  Andrew Davies

   
This example will output graphics, text and bitmap data randomly to the screen.
The sketch demonstrates the use of these vairous functions including how to
set their colours and positions on the screen.

To use this sketch you will need to uncomment the appropriate initialisers below
for your particular display.

IF YOU GET AN OUT OF MEMRY COMPILE ERROR:
Library support for TFT screens can be quite memory intensive. If you are using 
an UNO you may find that you will get and out of memory compile error. To get the
sketch to compile you will need to edit the MemorySave.h file in the HCTFT folder
to free up some memory.


You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used directly for the purpose of selling products that
directly compete with Hobby Components Ltd's own range of products.

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
REASON WHATSOEVER.
*/



/* Include the HCTFT library */
#include "HCTFT.h"


/* Example bitmap */
const PROGMEM byte Tiny_Logo_Resistor[] =
{
  0xC0, 0xE0, 0x30, 0x30, 0xF0, 0xE0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x80, 0xE0, 0x38, 0x0E, 0x07, 0x1E, 0x78, 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x70, 0x1C, 0x07, 0x0F, 0x3C, 0xF0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0xF0, 0x3C, 0x0F, 0x07, 0x1C, 0x70, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x80, 0xE0, 0x78, 0x1E, 0x07, 0x0E, 0x38, 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0xF0, 0x30, 0x30, 0xE0, 0xC0, 
  0x00, 0x01, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0F, 0x3C, 0x38, 0x0E, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x1E, 0x38, 0x1C, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0E, 0x38, 0x38, 0x0E, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x1C, 0x38, 0x1E, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0E, 0x38, 0x3C, 0x0F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x03, 0x01, 0x00, 
};

/* Options used to select one of the demos */
#define LINE 0
#define RECTANGLE 1
#define FONT 2
#define BWGRAPHIC 3


/* Uncomment one of the lines below to to create an instance of the TFT library 
   to match your screen */
//HCTFT HCTFT(ELECFREAKS_2_4_WITH_TFT01_UNO); // Elecfreaks 2.4" TFT (HCARDU0083)
//HCTFT HCTFT(ELECFREAKS_3_2_WITH_TFT01_MEGA); // Elecfreaks 3.2" TFT with ILI9481 contoller (HCARDU0097)
//HCTFT HCTFT(ELECFREAKS_3_2_9341_WITH_TFT01_MEGA); // Elecfreaks 3.2" TFT with ILI9341 controller (HCARDU0097)
//HCTFT HCTFT(MCUFRIEND_2_4_UNO); // McuFriend 2_4" TFT (HCARDU0095)
//HCTFT HCTFT(MCUFRIEND_3_5_MEGA); // Mcufriend 3.5" TFT (HCARDU0096)


void setup() 
{
  /* Initialise the TFT library */
  HCTFT.Init();

  /* Select one of the libraries fonts and seed the Arduino random function*/
  HCTFT.SetFont(LargeProp_25pt);
  randomSeed(analogRead(0));
}


/* Main sketch */
void loop() 
{
  int Index;
  
  /* Draw lots of lines in random places and colours */
  for (Index = 0; Index < 500; Index++)
  {
    Draw_Graphic(LINE);
  }  
  HCTFT.Clear();
  
  /* Draw lots of rectangles in random places and colours */
  for (Index = 0; Index < 100; Index++)
  {
    Draw_Graphic(RECTANGLE);
  }  
  HCTFT.Clear();
  
  /* Draw the word HELLO in random sizes, places and colours */
  for (Index = 0; Index < 100; Index++)
  {
    Draw_Graphic(FONT);
  }  
  HCTFT.Clear();
  
  /* Draw an example graphic in random sizes, places and colours */
  for (Index = 0; Index < 150; Index++)
  {
    Draw_Graphic(BWGRAPHIC);
  }  
  HCTFT.Clear();

}


/* Function to randomly draw a graphic or test */
void Draw_Graphic(byte Type)
{
  /* Create some random X/Y coordinates and colours */
  int X1 = random(HCTFT.Max_X());
  int X2 = random(HCTFT.Max_X());
  int Y1 = random(HCTFT.Max_Y());
  int Y2 = random(HCTFT.Max_Y());
  byte Red = random(255);
  byte Green = random(255);
  byte Blue = random(255);
  byte Scale = random(4);
  
  /* Get the foreground colour */
  HCTFT.SetFG(Red,Green,Blue);
  
  /* Select a graphic function to draw */
  switch(Type)
  {
    /* Draw a random line */
    case(LINE):
      HCTFT.Line(X1,Y1,X2,Y2);
      break;
      
    /* Draw a random solid or outlined rectangle */ 
    case(RECTANGLE):
      if(random(2))
      {
        HCTFT.Rect(X1,Y1,X2,Y2,OUTLINE);
      }else
      {
        HCTFT.Rect(X1,Y1,X2,Y2,SOLID);
      }
      break;
      
    /* Print the text HELLO! in random sizes */  
    case(FONT):
      HCTFT.Scale(Scale);
      HCTFT.Cursor(X1,Y1);
      HCTFT.Print("HELLO!");
      break;
 
    /* Draw the example bitmap in random sizes */     
    case(BWGRAPHIC):
      HCTFT.Scale(Scale);
      HCTFT.Cursor(X1,Y1);
      HCTFT.BWBitmap(84, 2, Tiny_Logo_Resistor);
      break;       
  }
}

Image

HCTFT Library:

HCTFT Arduino library for above sketch is available for download from the software section of our support forum here:

http://forum.hobbycomponents.com/viewto ... =58&t=1854

Or from Github here:

https://github.com/HobbyComponents/HCTFT


To add touch screen support you can download our HCTFT_Touch touch screen library from our support forum here:

http://forum.hobbycomponents.com/viewto ... =58&t=1631

Or from Github here:

https://github.com/HobbyComponents/HCTFT_Touch


Datasheets:
SSD1289-spec.pdf
Schematic:
HCARDU0097_Schematic.pdf
You do not have the required permissions to view the files attached to this post.

leapearson
Posts: 3
Joined: Fri Mar 04, 2016 9:16 am

Re: Elec Freaks 3.2" Colour TFT touch screen panel (HCARDU00

Post by leapearson » Sun Aug 21, 2016 8:50 am

Has anyone managed to connect this to an uno R3?

I was thinking about using a 16 bit shift register and level shifting the outputs to 3.3v using inline resistors or maybe an IC is there is one available?

andrew
Site Admin
Posts: 823
Joined: Sun Aug 05, 2012 4:15 pm

Re: Elec Freaks 3.2" Colour TFT touch screen panel (HCARDU00

Post by andrew » Mon Aug 22, 2016 8:39 am

It is certainly possible to do it that way, the only thing is I think you'll find that with an ATMega328 sending the data serially will be *very* slow to the point where it may not be usable. If you do want to have a try though here are a few options to consider:

8-Bit shift register: http://forum.hobbycomponents.com/viewto ... c595#p2667

74HC4050 for level shifting: http://hobbycomponents.com/ics/208-74hc ... -pack-of-5


Alternatively this is a serial I2C to 16 bit I/O port expansion which you could run at 3.3V so no level shifting needed: http://forum.hobbycomponents.com/viewto ... =99&t=2042

Also we have a bi-directional level shifting module which consists of an array of transistors and resistors to level shift 8 channels. It's not on sale yet as it's pending evaluation but we do have a few in stock.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

DIY_Monster
Posts: 12
Joined: Thu Nov 20, 2014 3:35 pm

Re: Elec Freaks 3.2" Colour TFT touch screen panel (HCARDU00

Post by DIY_Monster » Mon Sep 11, 2017 4:12 pm

Hello, Is there an updated library as this is not allowed under Arduino 1.8.4. It looks like they now prevent the use of "-" and "_". When compiling there is also the error:

In file included from sketch_sep11b.ino:4:0:
/home/william/sketchbook/libraries/HCTFTmaster/HCTFT.h:40:18: fatal error: SPI.h: No such file or directory
#include "SPI.h"
^
compilation terminated.

Many thanks.

andrew
Site Admin
Posts: 823
Joined: Sun Aug 05, 2012 4:15 pm

Re: Elec Freaks 3.2" Colour TFT touch screen panel (HCARDU00

Post by andrew » Tue Sep 12, 2017 8:39 am

I've just checked the library with 1.8.4 and I'm afraid I'm not seeing any errors. SPI.h is one of the libraries built in to the Arduino IDE so that file defiantly shouldn't be missing. What Arduino board and operating system are you using?

Also, can you see if the Arduino example sketch File->Examples->SPI->DigitalPotControl will compile without errors. This also makes use of the built-in SPI library so it will help to identify if there is a problem with your install of the IDE.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

DIY_Monster
Posts: 12
Joined: Thu Nov 20, 2014 3:35 pm

Re: Elec Freaks 3.2" Colour TFT touch screen panel (HCARDU00

Post by DIY_Monster » Tue Sep 12, 2017 12:53 pm

Andrew, Thanks to your help I have solved the issue. There was a semi orphaned old version installation via Ubuntu Software Installation which did not place the file in the expected place. When I ran the latest version things got tangled. I had to uninstall both then reinstall 1.8.4.

ricky101
Posts: 1
Joined: Sun Dec 06, 2015 6:10 pm

Re: Elec Freaks 3.2" Colour TFT touch screen panel (HCARDU00

Post by ricky101 » Wed Feb 28, 2018 11:38 am

Hi,

Have one of these Hobby 0097 displays and interface board which run fine on the Mega with this line of code selected -

HCTFT HCTFT(ELECFREAKS_3_2_WITH_TFT01_MEGA); // Elecfreaks 3.2" TFT with ILI9481 contoller (HCARDU0097)

Has anyone been successful in running the just the display function on a Uno/Nano via SPI and could provide a link to any suitable software.

Not looking to do fancy graphics on the Uno, more slow, simple text in colour.

Thanks

ssmith
Posts: 3
Joined: Tue Feb 27, 2018 5:30 pm

Re: Elec Freaks 3.2" Colour TFT touch screen panel (HCARDU00

Post by ssmith » Thu Mar 01, 2018 10:26 am

Hi Guys,
I picked this up from you last week, it works fine. But...

The display is quite dim, is there a way to increase the brightness/contrast? I have it running on a mega, but with a different adapter shield - [LINK REMOVED] - don't buy this, i never got it to work. I have also ordered the recommended shield from you guys, i should have it in the next couple of days - i doubt it will make a difference though, given that all it seems to do is translate 5V to 3.3V.

Is there some setting that controls the brightness or could it be the adapter board?

I also only got a white-screen from the touch example version 2.

Sean

andrew
Site Admin
Posts: 823
Joined: Sun Aug 05, 2012 4:15 pm

Re: Elec Freaks 3.2" Colour TFT touch screen panel (HCARDU00

Post by andrew » Fri Mar 02, 2018 11:32 am

It's a bit difficult to answer as dim is a relative term. The backlight on these displays could be described as slightly dim, especially when comparing it to something like a smart phone tft screen. If that's the case then this is normal but it shouldn't be so dim that you can't easily see the screen. You can reference the image in the first post although it should actually look brighter then in the image.
Is there some setting that controls the brightness or could it be the adapter board?
The backlight brightness is fixed by a 3.9 (R5) ohm resistor on the back of the screen. This is powered from the LED_A pin which should be supplied with 3.3V via you adapter shield. If you have a meter you may want to check that there is about ~3.3V on this pin supply as I would a expect slightly lower voltage to have a significant effect on the backlight brightness.
I also only got a white-screen from the touch example version 2.
I assume this was using the adapter shield you purchased from the eBay seller? You may want to wait until you receive our adapter in case something about the eBay one is different or faulty. If you still see the same problem with our screen and adapter just post here again and take a further look.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

ssmith
Posts: 3
Joined: Tue Feb 27, 2018 5:30 pm

Re: Elec Freaks 3.2" Colour TFT touch screen panel (HCARDU00

Post by ssmith » Mon Mar 05, 2018 2:15 pm

Thanks for the reply - i somehow managed to brick this display - i only get white-screen now. Annoying, but probably my fault, i wonder is the adapter board the cause of this.

Regarding the brightness, comparing this one, (when it worked), it is not at the same quality as the MCUFRIEND_kbv boards - this could again be the adapter board, but the _kbv displays are bright, and have good dark blacks, and are easy to see at an angle, i had to be starting straight at your board to have the best display. Would you guys consider stocking these? It would be nice to not have to wait months for a display. Also will you have the 3.5" display in stock any time soon?

Post Reply