Jump to content
43oh

[Energia Library] ILI9341 TFT 2.2 port


Recommended Posts

  • Replies 34
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

hi,   I've ported the Seeed library for cheap ebay 2.2 inch ILI9341 displays (only tested on Stellaris),   http://www.ebay.com/itm/1PC-2-2-Inch-SPI-TFT-LCD-Serial-Port-Module-Display-ILI9341-5V-3-

Got my new displays in, and got one working with the same text example... Tiva-C TM4C123GH6PM LaunchPad used here.   Two things: 1. Please include the FastDigitalWrite lib, I didn't have that; I fo

PS- Did Seeed really misspell the word "Triangle"? void drawTraingle(int poX1, int poY1, int poX2, int poY2, int poX3, int poY3, uint16_t color); ... void TFT::drawTraingle( int poX1, in

Posted Images

@@gmtii, Thanks! Do you have any pics?

Link to post
Share on other sites
  • 5 months later...
I'm testing your code on Tiva C LaunchPad using the same type of LCD module.

It displays perfectly with text.ino example, but it sends incorrect LCD_ID to my PC via UART/USB.

 

The result i get:

Read TFT ID failed, ID should be 0x09341, but read ID = 0x000

or 


Read TFT ID failed, ID should be 0x09341, but read ID = 0xFFFFFF

 

I use the same pin fonfig as you used.

Did your module send the correct ID?

 

 

Thanks in advance.

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

Got my new displays in, and got one working with the same text example... Tiva-C TM4C123GH6PM LaunchPad used here.

 

Two things:

1. Please include the FastDigitalWrite lib, I didn't have that; I found it over here: http://forum.stellarisiti.com/topic/675-solved%C2%A0launchpad-stellaris-on-energia-miso-erratic-behaviour-on-spi0-and-spi3/ (the SPI_all_ports_LM4F.zip file, I copied the FastDigitalWrite.* files over to get it working)

Looks like @@Rei Vilo wrote this one.

 

2. The Tiva-C shows as board not supported... Here's what I did to both FastDigitalWrite.h and TFTv2.cpp:

// Board check
#include "Energia.h"
#if defined(TARGET_IS_BLIZZARD_RB1) || defined(TARGET_IS_SNOWFLAKE_RA0)
#else
#error Board not supported.
#endif

Moved the #include "Energia.h" up above, then checked for the TARGET_IS_ definition instead.  SNOWFLAKE_RA0 is in preparation for the new TM4C129-series LaunchPad FYI (that silicon uses TARGET_IS_SNOWFLAKE_RA0 in the TivaWare headers).

 

Anyway, pics or it didn't happen:

post-163-14264605369626_thumb.jpg

 

Pinout is mostly self-explanatory, Vcc/GND go to the 3.3V Vcc and GND, SCK goes to the boosterpack-standard SPI SCLK pin (PB4), SDO (MISO) goes to the boosterpack-standard MISO pin (PB6), SDI (MOSI) goes to the boosterpack-standard MOSI pin (PB7), then RESET/LED/DC/CS is your choice and you define them in the object initializer statement in setup().

 

All in all, what a sweet LCD!  It's my first TFT for MCU work so I'll be gushing over it.  Time to dream up some projects :-)  And good work on the port!

Link to post
Share on other sites
  • 1 month later...

PS- Did Seeed really misspell the word "Triangle"?

        void drawTraingle(int poX1, int poY1, int poX2, int poY2, int poX3, int poY3, uint16_t color);

...

void TFT::drawTraingle( int poX1, int poY1, int poX2, int poY2, int poX3, int poY3, uint16_t color)
{
    drawLine(poX1, poY1, poX2, poY2,color);
    drawLine(poX1, poY1, poX3, poY3,color);
    drawLine(poX2, poY2, poX3, poY3,color);
}

I'm slightly amused :D  Think I'm going to use this as my first experiment with writing a TivaWare GraphLib driver, porting the code over to C.

Link to post
Share on other sites

@@Rei Vilo Do you know if LCD_screen supports the 9341 or should the differences be negligible?

 

Relying on the data sheets is one thing, playing with actual screen is another.

 

I went through the commands list on the data sheets and saw no difference. But I hardly trust the data sheets...

 

I haven't managed to read pixel from ILI9340-based screens. Maybe the ILI9341 fixes this issue.

 

But I'd need one ILI9341-based screen to proceed with the required tests to be sure.

Link to post
Share on other sites

Join the conversation

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

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