artium 2 Posted May 1, 2016 Share Posted May 1, 2016 Adafruit ILI9341 is an Arduino library for ILI9341 TFT display. This is a cheap controller and display module that can be bought on ebay/aliexpress fror as low as 6$. Recently I experimented with porting this library to Energia. Not surprisingly, it was almost trivial since most of the low level stuff is abstracted by SPI library functions. The port itself: https://github.com/alkhimey/Adafruit_ILI9341/tree/msp430-support Wiring instructions: http://www.nihamkin.com/2016/04/30/connecting-msp430-with-ili9341-tft-display/ This might be a little redundant as I see now that there is a dedicated msp430 graphics library that supports this display, still I want to believe it has some value for the community. spirilis and pine 2 Quote Link to post Share on other sites
spirilis 1,265 Posted May 2, 2016 Share Posted May 2, 2016 Thanks! I have a few of these too. Quote Link to post Share on other sites
phenyl 18 Posted May 4, 2016 Share Posted May 4, 2016 Hi @@artium Thank you very much for making this library available. I compiled it on a F5529 launchpad without issue (needed to adapt the pins slightly) I am trying to get it working on the msp432 now, however I am running into problems. First it mentions that min(,) is not defined, this is easily circumvented with two definesat the top of the sketch: https://github.com/energia/Energia/issues/815 Then I changed volatile RwReg with volatile int32_t in the h file where the SPI pin pointers are defined. Unfortunately, now the compiler tells me that digitalpintoport and associated functions are not defined. Do you or anyone have any hints? I'll upload the exact error message tonight, this is from memory... NurseBob 1 Quote Link to post Share on other sites
artium 2 Posted May 4, 2016 Author Share Posted May 4, 2016 This library was developed by Adafruit so the thanks should go to them. The following macros are not implemented in Energia: digitalPinToPort portOutputRegister digitalPinToBitMask As a temporary workaround, you can comment the line: #define USE_FAST_PINIO in Adafruit_ILI9341.h. Also, it would be better to use volatile uint32_t as replacement for RwReg (this is how it is typedefed for Arduino). I do not have msp432 to test, but I was able to compile using the three fixes (min/max, RwReg and USE_FAST_PINIO). If you manage to compile and run the example sketch, can you post the benchmark result? Quote Link to post Share on other sites
phenyl 18 Posted May 5, 2016 Share Posted May 5, 2016 Hi @@artium, thank you very much (and also adafruit ) I ran the benchmarks on my msp432 launchpad and also on my msp430f5529 launchpad (25 MHz), here with #define USE_FAST_PINIO commented for both. msp432Display Power Mode: 0x9CMADCTL Mode: 0x48Pixel Format: 0x5Image Format: 0x0Self Diagnostic: 0x0Benchmark Time (microseconds)Screen fill 31922493Text 1787874Lines 17494289Horiz/Vert Lines 2618766Rectangles (outline) 1675845Rectangles (filled) 66276560Circles (filled) 9775988Circles (outline) 7653239Triangles (outline) 5548662Triangles (filled) 21812339Rounded rects (outline) 3461099Rounded rects (filled) 72269681Done!msp430f5529ILI9341 Test!Display Power Mode: 0x60MADCTL Mode: 0x0Pixel Format: 0xFFImage Format: 0x0Self Diagnostic: 0x0Benchmark Time (microseconds)Screen fill 2263167Text 340734Lines 3615312Horiz/Vert Lines 195546Rectangles (outline) 133089Rectangles (filled) 4699971Circles (filled) 1194204Circles (outline) 1580064Triangles (outline) 1146462Triangles (filled) 1952517Rounded rects (outline) 558189Rounded rects (filled) 5281704Done! The 432 seems to be significantly slower in everything than the 5529, which I don't understand yet. (I did use uint32_t, I forgot which one I used when writing the forum post away from my home computer)... chicken 1 Quote Link to post Share on other sites
NurseBob 111 Posted May 29, 2016 Share Posted May 29, 2016 Hi @@artium Thank you very much for making this library available. I compiled it on a F5529 launchpad without issue (needed to adapt the pins slightly) I am trying to get it working on the msp432 now, however I am running into problems. First it mentions that min(,) is not defined, this is easily circumvented with two definesat the top of the sketch: https://github.com/energia/Energia/issues/815 Then I changed volatile RwReg with volatile int32_t in the h file where the SPI pin pointers are defined. Unfortunately, now the compiler tells me that digitalpintoport and associated functions are not defined. Do you or anyone have any hints? I'll upload the exact error message tonight, this is from memory... Thanks to all who've contributed. This saved me hours of spelunking!!! >I compiled it on a F5529 launchpad without issue (needed to adapt the pins slightly) Yes. FWIW, based on the BoosterPack "standard" definitions: MOSI - P3_0 MISO - P3_1 CLK - P3_2 and TFT_DC P2_3 (CS other) TFT_CS P2_6 (CS display) Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.