Jump to content

UTFT Library - UTouch - Henning Karlsen

Recommended Posts

Has anybody looked at possibly porting these to Energia?


He built these libs so that there are separate hardware defines for AVR, ARM, and ChipKIT.  


As you all know - I am fairly new to all of this...but I am wondering how tough it would be to port these to Energia for the MSP430, and ESPECIALLY for the Stellaris (it has enough pins, and power to be very effective at driving a 3.2 inch touch screen, plus everything else you might want to hook up.)


Just curious if someone better at this than me could take a quick peek and let me know what you think.


UTFT lib - - -   http://henningkarlsen.com/electronics/library.php?id=52


UTouch - - -    http://henningkarlsen.com/electronics/library.php?id=56


He also has a really good library for GRAPHICS on the Nokia 5110 displays.







Link to post
Share on other sites

The problem with such rich and optimised libraries is that, going inside and understanding how they work take more time than starting from scratch.


The UTFT is also customised for different platforms and boards. See

#if defined(__AVR__)
	#include "Arduino.h"
	#include "HW_AVR_defines.h"
#elif defined(__PIC32MX__)
	#include "WProgram.h"
	#include "HW_PIC32_defines.h"
#elif defined(__arm__)
	#include "Arduino.h"
	#include "HW_ARM_defines.h"


Now, the best way would be to dig inside and find out the core functions to initialise, display on and read from the 8/16-parallel screens.

Link to post
Share on other sites

I just finished porting it to Energia. Here is longer post what I did: http://andres.svbtle.com/how-to-add-energia-support-to-utft-library


Rectangles can be drawn, but printing characters takes too much memory. MSP430FR5739 has only 16 KB.

This part must be optimized somehow.


Here is commit, which adds Energia support to UTFT v2.1: https://github.com/andresv/industrial-switcher/commit/9ca1816f5c4ab81bea9e3fc3d24c0e07481e152a




Standalone github repo can now be found here.

Link to post
Share on other sites

Using binary search I found out that calling rotateChar(*st++, x, y, i, deg); in void UTFT::print(char *st, int x, int y, int deg) used huge amount of memory. I added special flag DISABLE_CHAR_ROTATING to UTFT library to disable this feature:



Now everything seems to be working correctly.

Link to post
Share on other sites

Well, your explanation of what you changed is excellent.  I am going to see about making the HW specific file for the Stellaris, and the MSP430G2553 (that one may only be worth using if the TFT supports serial as it has a limited number of GPIO's).


Thank you again.

Link to post
Share on other sites

I also tried out UTouch and it was already working without modifications.


Only thing that I changed were calibration constants that I got from running UTouch_Calibration.pde, which comes wit the lib.

In order to fit into 16 KB (MSP430FR5739) I removed almost all TFT prints from that program, I just printed out calibration result.


I am very happy with the results. UTFT and UTouch are very easy to use and they are well documented.


Although I have just 4 KB left for my application bussiness logic I think it would fit.

Link to post
Share on other sites

All I have right now is a 5 pin serial 1.8 inch TFT which uses the ST7735 controller.  I am running it right now on a launchpad with an MSP430G2553 in it (using the UTFT library of course).  Created the hardware file per your guidance and everything is working just great.


Now, all I have to do is wait (not good at that), for my 3.2 inch display to arrive.  Then I will give the 8 bit interface a shot.


Thanks again for your direction andresv.


Next is to try to figure out how to create the HW file for the Stellaris.  I think 16 bit on the SD1289 controller (the one on the 3.2 inch display that is on the way), would look pretty darn sweet running on a Stellaris at 80 mhz.



Link to post
Share on other sites
  • 3 weeks later...
Feel free to fork and add modifications to that library. Actually it would be awesome if Henning Karlsen personally adds it to github. I ping him about that.

Henning said that he is doing development in his private "Team Foundation Server" and it is unlikely that he moves development to github.

However he plans to add support to MSP430 based boards to the library if he gets those boards.


Proper public repository would make developing it soooo much easier, considering that Energia is already supported in my fork. Just specific board support should be added (Launchpad, Fraunchpad etc).

Link to post
Share on other sites
  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...