Page 1 of 2

2.4" TFT adapter board / shield for Arduino (HCARDU0084)

Posted: Wed Jun 11, 2014 3:21 pm
by admin
Shield with 2.4" TFT screen and Arduino Uno (not supplied with shield)


This adapter board shield (HCARDU0084) is intended to be used with our 2.4" TFT touch screen module (HCARDU0083) which is also available for purchase via our website. This shield allows the TFT screen to be easily interfaced with an Arduino boards such as an Uno or Leonardo. It also includes level shifters to provide correct 3.3V voltage level interface to the screen. Please note that as of version 2.1 of this shield 16 bit mode and IRQ support has been removed, but provides support for the screens resistive touch screen and SD card features of the module.

Please note: Although this shield is hardware compatible with most types of Arduino boards that have the standard Arduino headers, the current version of our HCTFT library only supports the use of adapter shield with the Arduino Uno.

Order Yours Here.



D0...........DB8 (screen data bus)
D1...........DB9 (screen data bus)
D2...........DB10 (screen data bus)
D3...........DB11 (screen data bus)
D4...........DB12 screen data bus)
D5...........DB13 (screen data bus)
D6...........DB14 (screen data bus)
D7...........DB15 (screen data bus)
D8...........D_CS (resistive touch chip select)
D9...........D_OUT (resistive touch data out)
D10.........SD_CS (SD card chip select)
D11.........SD_DIN (SD card data in)
D12.........SD_OUT (SD card data out)
D13.........SD_SCK (SD card data SCK)
A0...........D_DIN (resistive touch data in)
A1...........D_CLK (resistive touch clk)
A2...........RESET (screen reset)
A3...........LCD_CD (screen chip select)
A4...........WR (screen write strobe)
A1...........RS (screen register select)


What pins (if any) are free if I want full functionality?

If you need to use all the features of the screen, i.e. display, restive touch sensor, and SD card interface then unfortunately due to the limited number of I/O pins available on an Arduino Uno there are no spare pins available. If you don't need the SD card or touch screen features then it is possible to free up some pins. although you will need to reference the adapter shield schematic as for some pins there may still be hardware attached. Additionally, as the screen, SD, and resistive touch all use chip select (CS) lines, it is possible (again with consideration to the schematic) to multiplex some of these pins. For instance if you wanted at attach some push buttons you could connect them to Arduino's digital pins used for the screens data pins. You could then briefly configure the pin(s) as an input with pullup whilst reading the state of the button(s). However in this example as there would be no way to guarantee that a button wouldn't be pressed at the same time data is being written to the screen. You would therefore need to consider applying some sort of buffering such as putting a resistor in series with the button which is low enough in value to pull the pin low but not too low that it would overload the maximum output current capabilities of the Arduino's digital pin/ screen should bus contention occur.

Re: 2.4" TFT adapter board / shield for Arduino (HCARDU0084)

Posted: Thu Jul 03, 2014 7:21 am
by danuggster
I have both products shown above (HCARDU0084 & HCARDU0083) both designed for use with the Arduino Uno. I am hoping to use them with a Mega 2560. So far I have managed to get the TFT screen working without a problem using the UTFT library which handily has a #include for using Uno Shields on Megas (I have read that this may cause performance degradation but I'm not too bothered about this) So far it seems to be working fine. However I cannot get the touch screen to work using the HCTFT_Touch library and was wondering if you knew of any further changes or physical pin discrepancies that could be causing this not to work on the Mega.


Re: 2.4" TFT adapter board / shield for Arduino (HCARDU0084)

Posted: Thu Jul 03, 2014 8:08 am
by andrew
It's interesting that you managed to get the Uno adapter shield working with with the Mega and UTFT library, this is not something we've looked at ourselves. The HCTFT_Touch library hasn't been tested with a Mega in this combination but it uses simple bit bashing to communicate with the touch screen controller. It doesn't rely on any hardware or libraries to do this so there shouldn't really be any issues with using it on a Mega. The only thing that comes to mind is a pin conflict between the UTFT library when using like this. Is it possible for you to connect the screen up without the shield again and change the pin definitions in the HCTFT_Touch(byte CS_Pin, byte Clk_Pin, byte Din_Pin, byte Dout_Pin) line to some unused pins on your mega? You can then link these pins to the appropriate pins on the TFT module. If it works this would help confirm a pin conflict.

Re: 2.4" TFT adapter board / shield for Arduino (HCARDU0084)

Posted: Thu Jul 03, 2014 10:26 am
by danuggster
Ok, after making a few tweaks I got it running and it seems to be working fine. Here are the three things I had to change:

In the UTFT library there is a file called HW_AVR_defines.h (UTFT/hardware/avr/) In this file I had to uncomment the #definition for USE_UNO_SHIELD_ON_MEGA. So it looks like this:

Code: Select all

// Enable or disable the use of a display shield designed for use on 
// an Arduino Uno (or compatible) on an Arduino Mega
// ** Currently only available for 8bit display shields **
// Uncomment the following line to enable this feature
Next I had to make a slight change to the Solution file for the example I was using. It defined the DIN_DIO and DCLK_DIO as 14 and 15 respectively. On the UNO 14 and 15 are the digital addresses of the analogue pins A0 and A1, so on the mega these had to be changed to 54 and 55 respectively (although I believe you can just use A0 and A1 and that will also work)

Lastly I had to redefine DCS_DIO and DOUT_DIO from pin 8 and 9 to other pins I wasnt using (I used 22 and 23). For some reason 8 and 9 seem to be conflicting, but 22 and 23 work fine. Just a bit of hastle required to reroute these pins from the shield.

So my definitions section now looks like this:

Code: Select all

/* The following pin definitions assume you are using the TFT screen 
   with the Uno TFT adaptor board (HCARDU0084) */

/* Pin definitions for the touch screen controller */
#define DCS_DIO 22// Was 8 
#define DCLK_DIO 55// Was 15 
#define DIN_DIO 54 // Was 14
#define DOUT_DIO 23//Was 9 

/* Pin definitions for the TFT panel. */
#define RS_DIO A5 
#define WR_DIO A4 
#define CS_DIO A3 
#define RST_DIO A2 

/* Include the touch screen library */
#include <HCTFT_Touch.h>

/* Include the UTFT library */
#include <UTFT.h>
Hope that helps


Re: 2.4" TFT adapter board / shield for Arduino (HCARDU0084)

Posted: Thu Jul 03, 2014 7:57 pm
by andrew
Thanks for posting this, it's really useful information. I'm sure the buried deep within the UTFT library there will be a pin conflict hiding somewhere. Least you managed to fund a solution though.

Re: 2.4" TFT adapter board / shield for Arduino (HCARDU0084)

Posted: Wed Jan 28, 2015 9:39 am
by kenco
many thanks to danuggster for posting how to get this working on a mega and i only had to reroute 2 pins now i have plenty spare pins to play with thnks again :D

Re: 2.4" TFT adapter board / shield for Arduino (HCARDU0084)

Posted: Mon Feb 16, 2015 10:06 am
by EllertVanKoperen
Am i correct in reading in the schematic that this adaptor uses all digital and analog pins on the UNO ?

Re: 2.4" TFT adapter board / shield for Arduino (HCARDU0084)

Posted: Mon Feb 16, 2015 10:31 am
by andrew
Yes, if you are using the SD card reader as well it will require all the available pins on an Uno.

Re: 2.4" TFT adapter board / shield for Arduino (HCARDU0084)

Posted: Mon Feb 16, 2015 10:35 am
by EllertVanKoperen
That is unfortunate.
Thank you for the quick reply though.

Re: 2.4" TFT adapter board / shield for Arduino (HCARDU0084)

Posted: Sat Mar 14, 2015 11:24 am
by pvrancke
i also tried the solution postd by dannugster - thanks for that
it is indeed working but the performance is a lot less than on a UNO

but the UNO has too much limitations in terms of memory for the project i want to do

Andrew, do you plan to also sell the genuine MEGA shield from elecfreaks ?