Jump to content
gmtii

[Energia Library] ILI9341 TFT 2.2 port

Recommended Posts

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

Share this post


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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×