Community
cancel
Showing results for 
Search instead for 
Did you mean: 
mfu1
New Contributor I
1,303 Views

Adafruit 2.8" TFT ili9341 based display for Edison Arduino Board

Hi:

I know this topic was very old,but I still have questions about this.

Adafruit ili9341 based 2.8" TFT display is fully supported in the newest UPM library 0.6.2 and mraa 1.0.0 . https://software.intel.com/en-us/iot/hardware/sensors/ili9341-lcd IoT - ILI9341 LCD | Intel® Developer Zone

I followed http://www.intel.com/content/dam/support/us/en/documents/edison/sb/edisonarduino_hg_331191007.pdf Intel® Edison Kit for Arduino* Hardware Guide and I connect ili9341 TFT to edison arduino board with SPI mode like this:

edison arduino board adafriut ili9341 board

A0 : GP44 (mraa31) ----------->>> CS_LCD(CS)

D11 :GP43(mraa38) ----------->>> CS_SD(CCS)

D3 :GP12(mraa20) ----------->>> D/C

D5 :GP13(mraa14) ---------->>> RSET(RST)

GND ------------------------------>>> GND

5V -------------------------------------->>> Vin

I program with Java like this:

// TODO Auto-generated method stub

short a=31;

short b=38;

short c=20;

short d=14;

upm_ili9341.ILI9341 lcd =new upm_ili9341.ILI9341(a, b, c, d);

lcd.drawFastHLine(a, d, c, b);

try {

Thread.sleep(2000);

lcd.delete();

} catch (Exception e) {

// TODO: handle exception

}

Compile and upload to edison. It does not work for me.

My question:

1. The above is correct?

2.Can I use some linux commands in Putty to show the status about the connection between edison and ili9341 ?

 

Thank you!!

 

9 Replies
Sergio_A_Intel
Employee
173 Views

Hi,

The blocks in your code seem correct and since it complies it's not likely that something outside the code you posted can cause issues. I'd recommend you to try and change the lcd.drawFastHLine(a, d, c, b); with a void fillScreen(int color). This is a better option to try if you're just starting to test the display. The fourth argument of lcd.drawFastHLine is the color, so use something like this lcd.drawFastVLine(a, d, c, int color);

The connection between the Edison and the adafruit seems correct as well.

As an alternative option you can check full examples in C++, Javascript and Python here https://learn.sparkfun.com/tutorials/using-an-lcd-on-the-edison https://learn.sparkfun.com/tutorials/using-an-lcd-on-the-edison

Sergio

mfu1
New Contributor I
173 Views

Hi:

Thanks for your help.

And I glad to hear that my connection is correct.

I try this in Java:

// TODO Auto-generated method stub

short a=31;

short b=38;

short c=20;

short d=14;

try {

upm_ili9341.ILI9341 lcd =new upm_ili9341.ILI9341(a, b, c, d);

} catch (Exception e) {

// TODO: handle exception

e.printStackTrace();

}

//lcd.fillScreen(10);

//lcd.drawFastVLine(a, c, b, 10);

//Thread.sleep(2000);

//lcd.delete();

}

When I compile and upload to Edison Arduino board,the console show like this:

java.lang.IllegalArgumentException: UPM Invalid Argument: Invalid GPIO pin specified

at upm_ili9341.javaupm_ili9341JNI.new_ILI9341(Native Method)

at upm_ili9341.ILI9341.(ILI9341.java:39)

at Ili9341.main(Ili9341.java:19)

So it seems that 31,38,20,14 are invalid arguments.

I found http://iotdk.intel.com/docs/master/upm/classupm_1_1_i_l_i9341.html# a89e5d63b51c1a17b52a87df95b4390c3 Constructor & Destructor Documentation of ili9341,it says:

http://iotdk.intel.com/docs/master/upm/classupm_1_1_i_l_i9341.html ILI9341(uint8_tcsLCD,uint8_tcsSD,uint8_tdc,uint8_trst)Instantiates an http://iotdk.intel.com/docs/master/upm/classupm_1_1_i_l_i9341.html ILI9341 objectParameterscsLCDhttp://iotdk.intel.com/docs/master/upm/classupm_1_1_l_c_d.html LCD chip select pincsSDSD card select pindcData/command pinrstReset pin

Should I use the physical pin number in Java working with edison arduino board?

I try it ,but failed.

And this is an arduino program from Adafriut website:

# include "SPI.h"

 

# include "Adafruit_GFX.h"

 

# include "Adafruit_ILI9341.h"

// For the Adafruit shield, these are the default.

 

# define TFT_DC 9 <<<------- it uses the physical pin number<p> # define TFT_CS 10 <<<------- it does too

// Use hardware SPI (on Uno, # 13, # 12, # 11) and the above for CS/DC

 

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);

 

// If using the breakout, change pins as desired

 

//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);

Do you have any suggestion?

Thanks a lot!!

idata
Community Manager
173 Views

Can you try to test your screen with one of C++, Javascript or Python examples provided above? What is the result, are you able to get the screen working?

 

What image version are you using? Also, are you using an IDE?

 

 

The table that shows the mraa number and its relationship to each physical pin can be seen here http://iotdk.intel.com/docs/master/mraa/edison.html http://iotdk.intel.com/docs/master/mraa/edison.html .

 

 

Sergio

 

idata
Community Manager
173 Views

Do you have any updates for this case? Have you managed to get the TFT display to work?

 

 

Sergio

 

mfu1
New Contributor I
173 Views

Hi:

Thanks for your concern.

I tried C++, Python , Java example programs with the newest Edison image ver 3.0, upm ver 1.0.0 and mraa ver 0.7.

The problem is still here : "Invalid GPIO pin specified".

idata
Community Manager
173 Views

Do you see this error in 3 languages? What happens in C++ if you use the sample code, append the UPM modules, such as 

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib and compile with

 

g++ ili9341.cpp -o ili9341 -lupm-ili9341 -lmraa -I/usr/local/include/upm.

 

 

Are you able to compete this successfully, do you still see this error after running the program with ./ili9341? Please post the full output log if you receive an error and describe if you're able to see the screen responding. Also please attach pictures of your connection and of the screen if there's any activity.

 

 

Sergio

 

idata
Community Manager
173 Views

Were you able to try our latest suggestion? If you still need help with this thread let us know the results of our suggestions and attach the pictures we requested.

 

 

Sergio

 

PShah13
Beginner
173 Views

Hi,

We are trying the ILI9341 display with Intel Edison for Arduoni Board.

On Adafruit ILI9341 shield, we jump-soldered IM1, IM2 and IM3 (https://learn.adafruit.com/adafruit-2-dot-8-color-tft-touchscreen-breakout-v2/spi-wiring https://learn.adafruit.com/adafruit-2-dot-8-color-tft-touchscreen-breakout-v2/spi-wiring ) to enable SPI communication as indicated on their website.

We are testing the upm example code (https://github.com/intel-iot-devkit/upm/blob/master/examples/javascript/ili9341.js upm/ili9341.js at master · intel-iot-devkit/upm · GitHub ) could but received the 'Invalid GPIO Pin specified' error. I have attached pictures of the code and the hardware setup.

Can you please help us in debugging this?

Best,

Pratik

idata
Community Manager
173 Views

Hi,

 

 

Did you try the previous suggestions posted on this thread, specifically the one with instructions to append UPM modules? If you did and have errors, post the output.

 

 

I haven't tested this TFT specifically, but I found a couple of threads that discuss a similar issue:

 

/message/385056# 385056 https://communities.intel.com/message/385056# 385056

 

/message/409465# 409465 https://communities.intel.com/message/409465# 409465

 

There's also this option made by a community user https://github.com/KurtE/Adafruit_ILI9341/tree/Intel-Edison https://github.com/KurtE/Adafruit_ILI9341/tree/Intel-Edison you can also try.

 

 

-Sergio

 

Reply