TFT library compatible with Due?

I have been using the UTFT library on the older Arduinos but it is not yet compatible with the Due so I am kind of stuck..

Has anyone managed to interface a TFT with the Due?

Yes, but you need to get itdb02_32s display and mega shield for it from iteadstudio.com, these sources are compatible with that display and propably only with that display, other than 16bit modes are removed and this library only supports arduino due as I replaced and removed code, instead of just making it compatible with due along others. But here's a library, examples work "as is" with mega pins chosen on utft init..

Oh, one more thing.. You need to apply this patch:

UTFT_itdb02-32s-due.zip (751 KB)

Yeah, the library should be cleaned up.. It's a bit messy.. But this is a great starting point for everyone needing a display for due..

Here's one more thing, when using samples (or doing your own) - you need to change bitmap definitions a bit to make it work.. For example, tux.c in UTFT_Rotate_Bitmap example:

// Generated by  : ImageConverter 565 v1.0
// Generated from: tux.png
// Time generated: 11.10.2010 22:51:32
// Size          : 2 048 Bytes

//#include <avr/pgmspace.h>

const unsigned int tux[0x400] = {
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xE73C, 0x9CD3, 0x9CF3, 0xA514,   // 0x0010 (16)

it should start like this..
comment out #include <avr/pgmspace.h>
and change variable definition to:
const unsigned int varname = {

Hello.
I adapted the library for Arduino DUE. I also added a method to paint buttons, I added some new parameters to several methods, and have optimized several loops gaining some speed.
I've only tested on a 480x272 screen with SSD1963.
I have not tried the method LCD_Writ_Bus to 8 bits.

I was sent to the developer UTFT, but if you want to have before, you can download from the following link http://www.piensayactua.com/tmp/UTFT.rar

greetings

Wow, this is some very interesting stuff!

I have several TFTs here, I will do some testing and report back.

You guys are great! :slight_smile:

I have also got UTFT_tinyFat ported, although - it uses sdfat instead of tinyfat because I was interested in higher speeds provided by DMA and.. Well, actually.. Code was already complete, so I decided to use it..

In HW_AVR_defines.h you need to make one change:
#define bitmapdatatype uint16_t*

instead of unsigned int*

--- Updates ---

My UTFT now ships with picojpeg and comes with function that can load and display a jpeg file from SD..

I will put it here later.. It's not good implementation.. But works..

I started using amolinero's version of UTFT, tested it and it works with my ITDB02-3.2S display on itdb02 mega shield.
Haven't checked out amolinero's sources yet, so cannot say anything about it. Didn't notice significant speed ups, but I was drawing a jpeg on screen, so there's propably other reasons for slowliness..

Here's my UTFT_tinyFat - actually, it should be UTFT_SDFAT.. Get SDFAT from this forum/sdfat site (version that supports due).. And tweak the spi speed up..

To get it working, it needs to be connected to icsp header, so you need header spacers and some 2x3 icd connectors with ribbon cable (cut out cs pin and connect it to pin 52)..

image files folder is missing from my package, grab it from original utft_tinyfat package..


Here's a sample code for displaying jpeg..

#include <SdFat.h>
#include <UTFT.h>
#include <UTFT_tinyFAT.h>
#include <picojpeg.h>
#include <UTFT_picojpeg.h>

// SD chip select pin
const uint8_t chipSelect = SS;

UTFTtf myGLCD(ITDB32S, 38, 39, 40, 41);   // Remember to change the model parameter to suit your display module!

// file system
SdFat sd;


void setup()
{
  Serial.begin(9600);
  while (!Serial){}  // wait for Leonardo
  Serial.println();

  myGLCD.InitLCD();
  myGLCD.clrScr();
  
  if (!sd.begin(chipSelect, SPI_FULL_SPEED)) sd.initErrorHalt();

  loadJpeg(myGLCD, "image15.jpg");
  
}

void loop()
{
}

display's image15.jpg from root of SD.. Check out picojpeg - it doesn't support all jpegs..
And my routine isn't foolproof - there's not that much checking so beware to disappoint :slight_smile:

Or improve it..

UTFT_tinyFAT.zip (132 KB)

One more thing.. Henning's utouch library (support for touch screen) works out of the box on due..

So now we have initial support for touchscreens with sd slots for due.

I have tried amolinero's version of the UTFT library with my ITDB32WD display with great results, as you can see in the attachment.

Tomorrow I will also try it with my own code and see if everything also runs OK.

Me and alvesjc already ported UTFT from Henning Karlsen last month and send it to him as his the original author so he can do what feels like with that DUE version of UTFT library.

Anyway the basic info regarding the ports to change is on this post again from alvesjc:

Dimdim:
I have tried amolinero's version of the UTFT library with my ITDB32WD display with great results, as you can see in the attachment.

Tomorrow I will also try it with my own code and see if everything also runs OK.

How did you wire it up?

Did it work proper with 3.3V Logic?

I wired it up according to UTFT's documentation, adapting it to the specific TFT. It was not difficult. I should point out that it is an ITDB32WD compatible display that I got off of ebay, and not an ITead original.

The display works natively with 3.3V logic (I had to use resistors to use it with the older Arduinos) so it is actually easier to interface to the Due than to older Arduinos.

Here's a little video of it in action:

Hello Folks,
I have the ITDB28 (2.8" with Touchscreen, Uno Shield pin layout). Here is the product link if anyone is curious:
http://imall.iteadstudio.com/im120417020.html

I would like to use it with my Due, unfortunately the Due modifications I have run across only work with the 16bit models. Could anyone give me some pointers for getting it running in 8 bit mode?

Much appreciated!

This should work just fine, it's just that the level converters will be redundant since the Due's logic is already 3.3V. It should be OK though.

Dimdim:
This should work just fine, it's just that the level converters will be redundant since the Due's logic is already 3.3V. It should be OK though.

Oh, I'm not worried about the board's electrical compatibility, its just that the current Due modifications to the UTFT Library only work with the 16 bit models of LCD. I am curious what I would need to modify in the library to get my 8 Bit LCD running properly.

I'm sorry, there seems to be a mixup.. I was replying to a post that now appears to be gone (it was regarding a shield that simplified wiring a TFT to a MEGA). :frowning:

Dimdim:
I'm sorry, there seems to be a mixup.. I was replying to a post that now appears to be gone (it was regarding a shield that simplified wiring a TFT to a MEGA). :frowning:

Ah, no problem :slight_smile:

Dimdim:
I'm sorry, there seems to be a mixup.. I was replying to a post that now appears to be gone (it was regarding a shield that simplified wiring a TFT to a MEGA). :frowning:

Yes that was me, my post and I killed the post in hurry klicked the wrong button.

I found this Shield http://imall.iteadstudio.com/development-platform/arduino/shields/im120417024.html that works with Boards with 3.3V or 5V so it would make it easy to use an TFT with the UTFT Lib and dimdim's modifications. So you have the tft and the touch function together.

Hi.

Speaking about speed in UTFT, would be nice to do some comparison.

We have two distinct situations.

With ITDB32WD I get 32s, with ITDB32WC my friend get 29,5s

Here is our code running in the ITDB32WC

By the way, how do I set the youtube link to directly display the movie here?

liquidice007:
I am curious what I would need to modify in the library to get my 8 Bit LCD running properly.

Hi.

I've included code for 8 bit mode.

Replace (doing backup of your current file) the HW_ARM.h file in your library with the one attached with your IDE closed.

I don't have a display to test it, but should work, try it! :wink:

Regards,

Joao

HW_ARM.h (5.91 KB)