Offline
Newbie
Karma: 0
Posts: 7
|
 |
« on: December 02, 2012, 05:59:26 pm » |
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
Newbie
Karma: 0
Posts: 34
|
 |
« Reply #1 on: December 05, 2012, 10:42:14 am » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Finland
Offline
Newbie
Karma: 0
Posts: 34
|
 |
« Reply #2 on: December 05, 2012, 10:51:19 am » |
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[size] = {
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #3 on: December 05, 2012, 06:42:35 pm » |
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.rargreetings
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #4 on: December 05, 2012, 07:15:27 pm » |
Wow, this is some very interesting stuff! I have several TFTs here, I will do some testing and report back. You guys are great! 
|
|
|
|
|
Logged
|
|
|
|
|
Finland
Offline
Newbie
Karma: 0
Posts: 34
|
 |
« Reply #5 on: December 06, 2012, 03:54:33 am » |
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
Newbie
Karma: 0
Posts: 34
|
 |
« Reply #6 on: December 07, 2012, 10:31:53 am » |
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  Or improve it..
|
|
|
|
|
Logged
|
|
|
|
|
Finland
Offline
Newbie
Karma: 0
Posts: 34
|
 |
« Reply #7 on: December 07, 2012, 10:35:08 am » |
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
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #8 on: December 09, 2012, 06:42:01 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 41
Arduino DUE rocks
|
 |
« Reply #9 on: December 10, 2012, 05:33:10 pm » |
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
|
|
|
|
|
Germany
Offline
Full Member
Karma: 10
Posts: 179
|
 |
« Reply #10 on: December 11, 2012, 02:53:32 am » |
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
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #11 on: December 11, 2012, 03:27:04 am » |
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
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #12 on: December 12, 2012, 10:25:03 pm » |
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
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #13 on: December 13, 2012, 10:34:35 am » |
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
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #14 on: December 13, 2012, 10:51:09 am » |
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
|
|
|
|
|
|