Arduino Forum

Products => Arduino Due => Topic started by: Docedison on Jan 22, 2013, 09:24 am

Title: New UTFT Libray with Arduino ARM spport
Post by: Docedison on Jan 22, 2013, 09:24 am
I found this this morning: NEW UTFT 2.0 Library.
Released about 10:00 AM PST 1/21/2013, Has support for Arduino, Arduino ARM and ChipKit Uno and Max32.
Partial release notes:
2.0   21 Jan 2013  -   added support for Arduino Due and Arduino Leonardo
            added support for the "AquaLEDSource All in One Super Screw Shield" on chipKit Max32
            added support for more display modules
            fixed a bug in printNumF()
            optimized drawLine()
            optimized 16bit data transfer
            optimized some 8bit data transfer
            added option to use pre-defined RGB565 values with setColor(), setBackColor() and fillScr()
            added functions getColor(), getBackColor(), getFont(), getFontXsize() and getFontYsize()
            added 16 VGA standard colors as pre-defined color literal
            rearranged the manual to keep related functions grouped together

Bob
 
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: pYro_65 on Jan 22, 2013, 01:41 pm
Nice, hopefully we'll have a flood of Due based graphical apps soon. Indie games are the best, ones on an Arduino would be even better.
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: kamil_szczepan on Jan 22, 2013, 04:13 pm
Hi .

I have examples for you

Arduino DUE + 5" SSD1963 LCD 800 x 480
Speed on the OLD UTFT(mod for due) VS NEW UTFT lib

OLD ONE
http://www.youtube.com/watch?v=u4U6vxT_m9k

NEW ONE !
http://www.youtube.com/watch?v=0tfuwOYfhNA


This is It  !

Title: Re: New UTFT Libray with Arduino ARM spport
Post by: pYro_65 on Jan 22, 2013, 04:36 pm
It appears the new video is set to private.
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: kamil_szczepan on Jan 22, 2013, 04:43 pm
Sorry,my phone does this by default

Now it's ok
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: Markus_L811 on Jan 22, 2013, 05:11 pm
Would say the new one is faster.
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: kamil_szczepan on Jan 22, 2013, 05:22 pm
Faster ?
This is a rocket ! :)
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: pYro_65 on Jan 22, 2013, 05:25 pm
Quote
Sorry,my phone does this by default

Now it's ok


Cheers, looks good. I'm curious to know weather there is a significant difference between the 320x240 and 800x480 screens, probably more to do with the MPU rather than the display driver IC.
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: pagoda on Jan 22, 2013, 06:03 pm

Hi .

I have examples for you

Arduino DUE + 5" SSD1963 LCD 800 x 480
Speed on the OLD UTFT(mod for due) VS NEW UTFT lib

OLD ONE
http://www.youtube.com/watch?v=u4U6vxT_m9k

NEW ONE !
http://www.youtube.com/watch?v=0tfuwOYfhNA


This is It  !




That looks  an improvement on the original hardware & UTFT library. 

However - I'm  curious how you got round the way the fonts are stored. In normal Atmel processors the data for fonts or bitmaps is stored in flash, using pgmspace.h
No longer applicable to M3Cortex CPUs....

Are they being parked in regular RAM now?  If so - how?  normal but large arrays?

Good to see Henning burning the midnight oil   :-)

Graeme

Title: Re: New UTFT Libray with Arduino ARM spport
Post by: ODwyerPW on Jan 22, 2013, 11:59 pm
Where can this library be downloaded? 
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: Arctic_Eddie on Jan 23, 2013, 12:23 am
I found a copy here in RAR format.

http://henningkarlsen.com/electronics/download.php?f=UTFT.rar


Title: Re: New UTFT Libray with Arduino ARM spport
Post by: kamil_szczepan on Jan 23, 2013, 01:09 am
http://www.henningkarlsen.com/electronics/library.php?id=51
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: ralphnev on Jan 25, 2013, 08:57 pm
{stupid error snipped}

bad code ,, mea culpa
??
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: pdwyer on Jan 26, 2013, 05:41 pm
I am trying to get a SainSmart 3.2" 320x240 TFT LCD (it uses the SSD1289 controller) working with the Due board.  I have downloaded the latest UTFT library from Henning Karlsen (dated 1/20/13) and it compiles and loads onto my Due without error.  However, nothing on the display.  This led me to check the shield (supplied by SainSmart) which was apparently designed for the Mega board.  I "buzzed" out the pins from the display connector through to the Due pin assignments on the SainSmart shield and the shield appears to be way off.  I had presumed (mistakenly) that, based upon the Arduino concept, the pinouts for a Due board would be the same for the Mega board (by function).  So, does anyone know of a shield that can be used without too much modification to connect this display to the Due?  Does anyone have the pin assignment on the Due board needed to run the SSD1289 controller?  Does anyone know if the Due board is set up to use 8080 or 6800 timing?  Does anyone know what pins on the Due are used for external data lines D0-D15 and for the control lines of WR, RD, CS, and D/C (8080 timing) or E, CS, R/W, D/C (6800 timing) required by the SSD1289?  It appears from the software library that pins 32, 38, 39, 40, and 41 are used as the control signals (the statement myGLCD(TST01_32, 38, 39, 40, 41)), but I can't find a correlation to any of the control timing signals (WR, RD, CS, E, etc.).

I presume that I am going to have the same questions about the touch controller on the SainSmart display and also the SD drive, so info on the Due pins used for those would also be very helpful.

I have a suggestion: would it be possible to have a single web location where all of this type of information is centrally posted for the Due board?  I did find the pinout diagram at robgray.com/temp/Due-pinout and this is what enabled me to do the testing of the SainSmart shield (excellent work on this diagram -- thanks!).  I certainly would post whatever I learn and also to help pay for this if needed (I would be happy to donate USD$100+ to a fund).  I have 20 years of background running an electronics (automation) company and I know how much time/effort can be saved for everyone by some organizational tools. 

Thank you! Patrick
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: coldtears on Jan 26, 2013, 11:15 pm
Here is the modified UTFT library with a newly routed shield for DUE,
all Data pins are routed to PORTC and all command pins are routed to PORTD
only 4 instructions are needed per write strobe.

Filling the screen 800x480 once will take 212ms
Filling the screen 800x480 with an image directly reading from SPI flash using 42Mhz speed with DMA will take 312ms

This should be the maximum ability of DUE as i think should be the mostly optimized.
Of course, any chance to make it faster will be appreciated. ]:D

http://www.youtube.com/watch?v=6EvJUABbedQ

The library is here
http://coldtears.lin3.siteonlinetest.com/files/Arduino_DUE_TFT_library.zip
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: pYro_65 on Jan 27, 2013, 01:22 am
Very nice.

I'm not up with the due yet ( ordered and waiting ), the two ports A & C, I'm assuming are 32-bits wide. If this is the case, does this mean there is around 40 unused pins?

If so are they usable, I'm thinking along the lines of 'probably not' without changing the single write to a mask of bits. Maybe the due has someway of dealing with this.

I'm just wondering as there only appears to be a few port B and D pins left without A & C.
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: coldtears on Jan 27, 2013, 02:28 am
There is a typo, all command lines are routed to PORTD ( PD0-PD3)
and data lines are routed to PORTC

The pins left for use will probably be those on horizontal headers on DUE (just like MEGA2560) where they are not occupied by the shield. Should be around 4x8=32pins left unused

Title: Re: New UTFT Libray with Arduino ARM spport
Post by: pdwyer on Jan 28, 2013, 01:04 am
Rather than just refer to a port, can you reference the actual pin numbers (IC and board connection) used for D0-D15 of a display and WR, RD, CS, E, D/C used for LCD control?  Also, does the code employ 8080 or 6800 timing?  I have a new shield on order, but I would still like the pin numbers so that I can start looking at the code and understand the hardware.  Also, if you have the pinout for the touch screen and the SD drive, that will be next.

Thanks!
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: coldtears on Jan 28, 2013, 01:46 am
The data pins are routed to PC1-8 (lower 8 bit) and PC12-19 (higher 8 bit), so you probably need to shift your lower 8 bit to the right<<1, and higher 8 bit to the right <<12, and then you can strobe the WR pin. So you will need 3 arduino command for one WR strobe.
Like this:
                REG_PIOC_CODR=0xFF1FE;
      REG_PIOC_SODR=(VL<<1) & 0x1FE;
      REG_PIOC_SODR=(VH<<12) & 0xFF000;
      pulse_WR();

For the 4 command pins, they are routed to PD1-4. This should be straight forward.
This is possible because the creator of DUE has made perfect routing of these lines to the 2x20 header.

SD Card will be directly connected to the SPI interface on the 6pin header in the center of the DUE board(DUE only has SPI access on this 6pin header).

Schematic is http://coldtears.lin3.siteonlinetest.com/files/CTE_DUE_shield.zip (http://coldtears.lin3.siteonlinetest.com/files/CTE_DUE_shield.zip)  ]:)
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: cowasaki on Feb 11, 2013, 11:55 am

The data pins are routed to PC1-8 (lower 8 bit) and PC12-19 (higher 8 bit), so you probably need to shift your lower 8 bit to the right<<1, and higher 8 bit to the right <<12, and then you can strobe the WR pin. So you will need 3 arduino command for one WR strobe.
Like this:
                REG_PIOC_CODR=0xFF1FE;
      REG_PIOC_SODR=(VL<<1) & 0x1FE;
      REG_PIOC_SODR=(VH<<12) & 0xFF000;
      pulse_WR();

For the 4 command pins, they are routed to PD1-4. This should be straight forward.
This is possible because the creator of DUE has made perfect routing of these lines to the 2x20 header.

SD Card will be directly connected to the SPI interface on the 6pin header in the center of the DUE board(DUE only has SPI access on this 6pin header).

Schematic is http://coldtears.lin3.siteonlinetest.com/files/CTE_DUE_shield.zip (http://coldtears.lin3.siteonlinetest.com/files/CTE_DUE_shield.zip)  ]:)



This is very useful thanks.

Do you have a key to the values of the other components on the board?
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: TheKitty on Feb 12, 2013, 06:34 pm
Has anyone had luck with a Due compatible library for SPI based displays?  UTFT seems to be only parallel and I2C?
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: cowasaki on Feb 16, 2013, 04:27 pm
I've just received a 7" SSD1963 based touch screen LCD from china :)

It has a micro SD card slot and two 32 way connectors (both of which have the SAME connections):

GND   3v3
D1     D0
D3     D2
D5     D4
D7     D6
D9     D8
D11   D10
D13   D12
D15   D14
RS     CS
RD    WR
TE    RST
INT   TD0
PWM TD1
PCS   TSCK
SDCS  TCS
5V     GND   (But these two are not connected)

There is a diagram on the back of it that goes like this:

JP1  Back_Light
@    SSD-PWM
     MCU-PWM

JP1 has a SMD resistor soldered across it at the factory and I think that "@   SSD-PWM" is telling me about this model.

Not a bad price for such a large touchscreen with card reader either........


....   now to connect it :D
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: cowasaki on Feb 16, 2013, 08:12 pm
So just to get this straight....

Does this look right / what about pins 22-32  ??

-------------------------------------------------
| PIN   | LABEL | PIN    |  PIN
| NUM | TFT    | DUE   | FUNCTION
|         |          |          |
|         |          |          |
| 1      | 3v3    | >>    | 3v3 power
| 2      | GND   | >>    | Ground
| 3      | D0     | 33      |
| 4      | D1     | 34      |
| 5      | D2     | 35      |
| 6      | D3     | 36      |
| 7      | D4     | 37      |
| 8      | D5     | 38      |
| 9      | D6     | 39      |
| 10    | D7      | 40      |
| 11    | D8      | 51      |
| 12    | D9      | 50      |
| 13    | D10    | 49      |
| 14    | D11    | 48      |
| 15    | D12    | 47      |
| 16    | D13    | 46      |
| 17    | D14    | 45      |
| 18    | D15    | 44      |
| 19    | CS      | 27      |
| 20    | RS      | 25      |
| 21    | WR     | 26      |
| 22    | RD      | >>    |  3v3
| 23    | RST    | 28      |
| 24    | TE      | 9        |  Don't know !  ?????????????
| 25    | TD0    | >>    | MISO
| 26    | INT     |          |  Don't know !  ?????????????
| 27    | TD1    | >>    | MOSI
| 28    | PWM   | 9       |  Don't know !  ?????????????
| 29    | TSCK  |          |  Don't know !  ?????????????
| 30    | PCS    | 52     |  Don't know !  ?????????????
| 31    | TCS    | 5       |  Don't know !  ?????????????
| 32    | SDCS  | 4       |  Don't know !  ?????????????  possibly 54??????
-----------------------------------------------------------------------------------

Title: Re: New UTFT Libray with Arduino ARM spport
Post by: cyclegadget on Feb 24, 2013, 03:45 am

I have this screen and adapter from Sainsmart http://www.sainsmart.com/arduino-compatibles/module/lcd-module/sainsmart-3-2-tft-lcd-display-touch-panel-pcb-adapter-sd-slot-for-arduino-2560.html

Can anyone tell me if I can make the screen work with the Due by removing the resistors from the adapter shield? I am thinking that they used resistors to lower the voltage of the Arduino Mega from 5 volts to 3.3 volts. Therefore, if you have a Due producing only 3.3 volts, then the resistors can be removed to make it work.

Any ideas?
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: pYro_65 on Feb 24, 2013, 06:35 pm
@cyclegadget, I remember reading about a pen that contained conductive ink. If you can get one, and its good quality, you might be able to draw a line over the top of the resistors.

Or use a loop of wire over each resistor, some people fixed the SD card connection using this method.

If you have the resources, a little breakout that reconfigures the 40pin header to the LCD format would work, then you don't need the shield.
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: pagoda on Feb 24, 2013, 07:13 pm
The stuff you are looking for used to be marketed in car accessory shops for repairing rear screen heaters.
It is basically like a small bottle of nail varnish - but loaded with either silver or aluminium powder for conductivity.
You can certainly use it to fix damaged pcb tracks (remove varnish from the good area first!!) , so shorting out a couple of SM resistors should be easy.  Just don't splash it around... :)

Graeme
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: cyclegadget on Feb 24, 2013, 07:55 pm

Thanks for the replies from both of you! I wanted to be sure that I had the correct idea before I did anything drastic. I can solder down to 805 resistors with good results so, I think I will be able to solder out or jumper those resistors.

I will give it a try soon!
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: jake1981 on Mar 16, 2013, 10:20 am
I have problems accessing DS1307(rtc) on pins 20(sda) and 21(scl). RTC renders un usable right after initializing UTFT.. :/

Any help appreciated..
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: jchalo99 on Mar 18, 2013, 03:55 pm
I have a older shield for the mega, want to make it work the the due. how can i do this, mine the display is soldered on the shield, and there are surfacemount resisters, i can get to the resisters with a soldering iron if need be.
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: Docedison on Oct 02, 2013, 10:59 pm
I'be been using both the CTE class and the UTFT class on a Digix and both are flawless, The CTE shield and class being noticeably faster compared to the class Mr Karlsen wrote last year. Screamer fast)
Apparently when he rewrote the class to better encompass the Arm Avr and Pic processors he changed a substantial amount of code. I have had.. some code for the class written early last year and the speed differences are substantial... One of the Very few times I've "Donated" to a project and really got my $0.50's worth.. The Manuals... "Manuals"? who ever heard of actually supplying manuals with Arduino code...?  The manuals are an encyclopedia compared to the Arduino Manuals? and are actually useful.
If you use Mr Karlsen's code a donation would be a sign that you appreciate what he has done and how much it's made your own work easier. FWIW I own 3, 3.2" displays (5 if you cound 2, 4D Systems 3.2" displays and an Itead 4.3 which was junk defective out of the box (randomly shows a silver screen and the postage to return it is more than the 'thing' is worth) and a CTE 4.3 which is beautiful.
All in all the best display of it's class I've ever seen.

Doc
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: Docedison on Oct 02, 2013, 11:01 pm
I'be been using both the CTE class and the UTFT class on a Digix and both are flawless, The CTE shield and class being noticeably faster compared to the class Mr Karlsen wrote last year. Screamer fast)
Apparently when he rewrote the class to better encompass the Arm Avr and Pic processors he changed a substantial amount of code. I have had.. some code for the class written early last year and the speed differences are substantial... One of the Very few times I've "Donated" to a project and really got my $0.50's worth.. The Manuals... "Manuals"? who ever heard of actually supplying manuals with Arduino code...?  The manuals are an encyclopedia compared to the Arduino Manuals? and are actually useful.
If you use Mr Karlsen's code a donation would be a sign that you appreciate what he has done and how much it's made your own work easier. FWIW I own 3, 3.2" displays (5 if you cound 2, 4D Systems 3.2" displays and an Itead 4.3 which was junk defective out of the box (randomly shows a silver screen and the postage to return it is more than the 'thing' is worth) and a CTE 4.3 which is beautiful.
All in all the best display of it's class I've ever seen.

Doc
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: garygid on Oct 04, 2013, 03:40 am
Yes, this great UTFT library supports my CTE32HR, and the CTE50 and CTE70
quite well.  The 22 September 2013 version of UTouch is also much better.
Thanks!!!

I added code to UTFT to support the CTE40 and
the CTE35, so now both seem to work well using
CTE40 or CTE35 as the display type.

I will try UTouch for calibration soon.
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: garygid on Oct 05, 2013, 05:42 am
The UTouch calibration required using LANDSCAPE mode for
the CTE35, but the 32HR, 35, 40, 50, and 70 all calibrate
and Paint, using somewhat modified libraries and sketches.

There is still at least one bug in the lbraries, possibly in UTFT_CTE
that causes icons to be positioned  relative to the right edge rather
than relative to the left edge.  Howeve, it should be easy to find.
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: kortium on Oct 05, 2013, 07:05 am

The data pins are routed to PC1-8 (lower 8 bit) and PC12-19 (higher 8 bit), so you probably need to shift your lower 8 bit to the right<<1, and higher 8 bit to the right <<12, and then you can strobe the WR pin. So you will need 3 arduino command for one WR strobe.
Like this:
                REG_PIOC_CODR=0xFF1FE;
      REG_PIOC_SODR=(VL<<1) & 0x1FE;
      REG_PIOC_SODR=(VH<<12) & 0xFF000;
      pulse_WR();

if DUE has 32 bits port, why not use one data variable instead of VL and VH?
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: ghlawrence2000 on Nov 13, 2014, 01:34 pm
Hi .

I have examples for you

Arduino DUE + 5" SSD1963 LCD 800 x 480
Speed on the OLD UTFT(mod for due) VS NEW UTFT lib

OLD ONE
http://www.youtube.com/watch?v=u4U6vxT_m9k

NEW ONE !
http://www.youtube.com/watch?v=0tfuwOYfhNA


This is It  !


Both videos now private,

Regards,

Graham
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: bobity on Feb 13, 2015, 12:29 pm
Hello.
Please help me. I have Arduino DUE + 7" SSD1963 LCD 800 x 480 + shield for arduino due. I downloaded the UTFT library and try the example but the display did not run. I tried with Mega 2560 + shield for mega 2560 the same result.
How can I check if the display is ok? Can I power up only the blacklight using the CTE70 pins ?
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: ghlawrence2000 on Feb 13, 2015, 05:58 pm
bobity,

You could elaborate where you downloaded the UTFT library from? If you downloaded it from this thread, it is a modified version with unofficial modifications.

You could further elaborate who the TFT shield is made by, let me guess.... Sainsmart??

Your best bet is download the official version of the UTFT suite of libraries from the author's own website. http://www.henningkarlsen.com/electronics/library.php?id=51 (http://www.henningkarlsen.com/electronics/library.php?id=51) If these are not the libraries you already have, delete the ones you have now!!

Did you read the documentation for your TFT shield? Did you change the example sketches to use the pins of YOUR shield? Did you use an external AC/DC power supply since 7" panels require more power than USB can supply? Did you try google and see the 5 or 6 different threads on this forum where I have already made these suggestion many times before.....

Regards,

Graham
Title: Re: New UTFT Libray with Arduino ARM spport
Post by: bobity on Feb 23, 2015, 01:20 pm
Hi ghlawrence2000,
Thank you for the help.

I tried many times with UTFT library from http://www.henningkarlsen.com without any result.  The pins are configured for my LCD type and an external 9V/3A power supply is plugged in. I red a lot of threads and I am thinking about purchasing a new one. I think this one i damaged or defective one.