Pages: [1] 2 3   Go Down
Author Topic: TFT library compatible with Due?  (Read 9399 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Finland
Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
https://github.com/cmaglie/Arduino/commit/74dea07f2c7e977bacf5c61f7e8502609b285dbb

* UTFT_itdb02-32s-due.zip (750.68 KB - downloaded 49 times.)
Logged

Finland
Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

Code:
// 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[size] = {
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow, this is some very interesting stuff!

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

You guys are great! smiley
Logged

Finland
Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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..
« Last Edit: December 07, 2012, 09:18:17 am by jake1981 » Logged

Finland
Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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..

Code:


#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 smiley

Or improve it..

* UTFT_tinyFAT.zip (132.22 KB - downloaded 46 times.)
Logged

Finland
Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* IMG_5936_resize.JPG (58.65 KB, 800x533 - viewed 424 times.)
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Arduino DUE rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
http://arduino.cc/forum/index.php/topic,130714.msg1013319.html#msg1013319
Logged

Check all my projects based on Atmel/Arduino -> www.aqualed-light.com

Germany
Offline Offline
Full Member
***
Karma: 10
Posts: 221
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

« Last Edit: December 11, 2012, 03:28:49 am by Dimdim » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1] 2 3   Go Up
Jump to: