TFTLCDCyg:
- Don´t connect TFT-MISO on MISO-Arduino (pin 12).
Tried not connecting it, no change. I don't think it's hurting anything if it's connected even if it's not being used. Might as well connect all the pins. Maybe in future I'll have some use for it like transferring a screenshot or something.
TFTLCDCyg:
2. VCC of CD4050 must be connected on 3.3V line.
Yep, as per my diagram, 3.3V.
TFTLCDCyg:
The library for ILI9341@MarekB it´s an excellent choise
D/l it and tested it... same result... black screen. The SS pin is at a constant 3.3V. The display is stubbornly not wanting to be sent any data.
The library looks good though, has documentation!
david_prentice:
There are several versions of SPI ILI9341 display modules.
Looks like the pins are identical if mine is slightly different. I guess the SPI interface should be the same, the only difference would be that pull up resistor that you mention further down in your post.
david_prentice:
Most have constructors like this:
// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC/RST
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
I'm using MarekB's library now and the sketch I'm using has what you're talking about. My pins line up with the CS, DC and RST pins now. Well, they were correct, it's just that programatically, they are now defined.
/*
This sketch is demonstrating loading monochome images from a byte array.
The advantage of using monochrome images is its size. You could fit a fullscreen
monochrome image in Uno's program memory. You could not do that with
a full color image.
*/
#include "SPI.h"
#include "ILI9341_due_config.h"
#include "ILI9341_due.h"
#if defined(ARDUINO_ARCH_AVR)
#include <avr/pgmspace.h>
#elif defined(ARDUINO_SAM_DUE)
#define PROGMEM
#endif
const uint8_t arduLogo[] PROGMEM = { // width 40, height 32
B00000000, B00000000, B00000000, B00000000, B01111110,
B00000000, B00000000, B00000000, B00000000, B00101110,
B00000000, B00000000, B00000000, B00000000, B00101010,
B00000001, B11111000, B00000000, B00001111, B10000000,
B00000111, B11111110, B00000000, B00111111, B11100000,
B00011111, B11111111, B10000000, B11111111, B11111000,
B00111111, B00000111, B11000001, B11110000, B11111100,
B00111100, B00000011, B11100011, B11100000, B00111100,
B01111000, B00000000, B11110111, B10000000, B00011110,
B01110000, B00000000, B01110111, B00000110, B00001110,
B11100000, B00000000, B00111110, B00000110, B00000111,
B11100001, B11111000, B00111110, B00011111, B10000111,
B11100001, B11111000, B00011100, B00011111, B10000111,
B11100000, B00000000, B00111110, B00000110, B00000111,
B11110000, B00000000, B00111110, B00000110, B00001111,
B01110000, B00000000, B01110111, B00000000, B00001110,
B01111000, B00000000, B11110111, B10000000, B00011110,
B00111100, B00000011, B11100011, B11100000, B00111100,
B00111111, B00001111, B11000001, B11110000, B11111100,
B00011111, B11111111, B00000000, B11111111, B11111000,
B00000111, B11111100, B00000000, B00111111, B11100000,
B00000001, B11110000, B00000000, B00001111, B10000000,
B00000000, B00000000, B00000000, B00000000, B00000000,
B00000000, B00000000, B00000000, B00000000, B00000000,
B00000000, B00000000, B00000000, B00000000, B00000000,
B01110011, B11001111, B00100010, B11100100, B01001110,
B10001010, B00101000, B10100010, B01000100, B01010001,
B10001010, B00101000, B10100010, B01000110, B01010001,
B11111011, B11001000, B10100010, B01000101, B01010001,
B10001010, B10001000, B10100010, B01000100, B11010001,
B10001010, B01001000, B10100010, B01000100, B01010001,
B10001010, B00101111, B00011100, B11100100, B01001110
};
// CS and DC for the LCD
#define LCD_CS 10 // Chip Select for LCD
#define LCD_DC 9 // Command/Data for LCD
#define LCD_RST 8 // Command/Data for LCD
ILI9341_due tft(LCD_CS, LCD_DC, LCD_RST);
void setup()
{
Serial.begin(9600);
tft.begin();
tft.setRotation(iliRotation270); // landscape
tft.fillScreen(ILI9341_BLACK);
tft.drawBitmap(arduLogo, 160, 100, 40, 32, ILI9341_DARKCYAN); // "transparent" background
tft.drawBitmap(arduLogo, 110, 100, 40, 32, ILI9341_WHITE, ILI9341_DARKCYAN);
}
void loop()
{
/* add main program code here */
}
david_prentice:
Note that the Adafruit examples omit the TFT_RST argument. Because the Adafruit boards have a hardware pullup on the TFT_RESET pin.
That went a bit over my head. Did some basic reading on it, but I'll have to dig deeper to understand what pullup resistors are, what they do and whether I have it.
david_prentice:
The Red modules from Ebay do not have a pullup resistor on TFT_RESET. So you must connect it to the Arduino. And you must configure it in the constructor.
In your case, you would use:
// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC/RST
Adafruit_ILI9341 tft = Adafruit_ILI9341(10, 9, 8);
Yep the new sketch has this now. (lib is here ILI9341_due).
david_prentice:
You can wire the SD card onto the same hardware SPI bus as your TFT. And use the spare channel on your 4050 for SD_CS.
If you use the ILI9341 modules with an XPT2046 Touch controller, you need a channel for the TS_CS line. You could steal the TFT_RESET channel if you provide an external pullup resistor on the TFT_RST pin.
David.
Don't plan on using the SD slot nor is my unit touch, just interested in graphical output at this stage.
Correct me if I'm wrong since this is my first Arduino project, I add the library under sketch->include library.
Then I simply open the example sketch in the library examples folder and simply click, upload?
I don't need to compile the library .cpp and .h files?
Using this new example sketch, as I mentioned, I get 3.3V output from the 4050 SS pin.
I've actually got a couple of these units, I plugged in a different one (same version I think), same result. Nadda.