MarkT:
Firstly that chip is 3.3V logic only...
I thought so and it was confirmed. Today I received Arduino DUE, I use same wiring as above and it success! Display is working.
I use MultiLCD library and I modify included TFThello.INO example:
#include <Arduino.h>
#include <Wire.h>
#include <SPI.h>
#include <MultiLCD.h>
#define OFFSET 12
#define WIDTH 48
#define HEIGHT 48
#define XBORDER 14
#define YBORDER 6
static const PROGMEM uint8_t smile[48 * 48 / 8] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xF8,0xFC,0xFC,0xFE,0xFE,0x7E,0x7F,0x7F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x7F,0x7F,0x7E,0xFE,0xFE,0xFC,0xFC,0xF8,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xC0,0xF0,0xFC,0xFE,0xFF,0xFF,0xFF,0x3F,0x1F,0x0F,0x07,0x03,0x01,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x01,0x03,0x07,0x0F,0x1F,0x3F,0xFF,0xFF,0xFF,0xFE,0xFC,0xF0,0xC0,0x00,
0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x1F,0x1F,0x1F,0x3F,0x1F,0x1F,0x02,0x00,0x00,0x00,0x00,0x06,0x1F,0x1F,0x1F,0x3F,0x1F,0x1F,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,
0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x30,0xF8,0xF8,0xF8,0xF8,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF8,0xF8,0xFC,0xF8,0x30,0x00,0x00,0xE0,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,
0x00,0x03,0x0F,0x3F,0x7F,0xFF,0xFF,0xFF,0xFC,0xF8,0xF0,0xE1,0xC7,0x87,0x0F,0x1F,0x3F,0x3F,0x3E,0x7E,0x7C,0x7C,0x7C,0x78,0x78,0x7C,0x7C,0x7C,0x7E,0x3E,0x3F,0x3F,0x1F,0x0F,0x87,0xC7,0xE1,0xF0,0xF8,0xFC,0xFF,0xFF,0xFF,0x7F,0x3F,0x0F,0x03,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0F,0x1F,0x1F,0x3F,0x3F,0x7F,0x7F,0x7E,0xFE,0xFE,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFC,0xFE,0xFE,0x7E,0x7F,0x7F,0x3F,0x3F,0x1F,0x1F,0x0F,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
};
LCD_ILI9341 lcd; /* for 2.2" SPI TFT module */
int mydelay = 200;
void setup()
{
Serial.begin(115200);
lcd.begin();
};
void loop()
{
lcd.backlight(true);
lcd.clear();
lcd.setTextColor(255, 255, 0);
int lastX, lastY;
for(int X = XBORDER;X < (320 - WIDTH); X = X + WIDTH + OFFSET){
lcd.draw(smile, X, YBORDER, WIDTH, HEIGHT);
lastX = X;
delay(mydelay);
};
for(int Y = HEIGHT + OFFSET;Y < (240 - HEIGHT); Y = Y + HEIGHT + OFFSET){
lcd.draw(smile, lastX, Y, WIDTH, HEIGHT);
lastY = Y;
delay(mydelay);
};
for(int X = lastX - WIDTH - OFFSET;X >= 0; X = X - WIDTH - OFFSET){
lcd.draw(smile, X, lastY, WIDTH, HEIGHT);
lastX = X;
delay(mydelay);
};
for(int Y = lastY - HEIGHT - OFFSET;Y >=YBORDER; Y = Y - HEIGHT - OFFSET){
lcd.draw(smile, lastX, Y, WIDTH, HEIGHT);
lastY = Y;
delay(mydelay);
};
int curX = XBORDER + WIDTH + OFFSET;
int curY = 6;
lcd.setTextColor(255, 255, 255);
lcd.setCursor(curX, curY);
lcd.setFont(FONT_SIZE_SMALL);
lcd.print("Hello, world!");
curY++;
delay(mydelay);
lcd.setTextColor(255, 0, 255);
lcd.setCursor(curX, curY);
lcd.setFont(FONT_SIZE_MEDIUM);
lcd.print("Hello, world!");
curY++;
curY++;
delay(mydelay);
lcd.setTextColor(255, 0, 0);
lcd.setCursor(curX, curY);
lcd.setFont(FONT_SIZE_SMALL);
lcd.printLong(1234567890);
curY++;
delay(mydelay);
lcd.setTextColor(0, 255, 0);
lcd.setCursor(curX, curY);
lcd.setFont(FONT_SIZE_MEDIUM);
lcd.printLong(1234567890);
curY++;
curY++;
delay(mydelay);
lcd.setTextColor(0, 0, 255);
lcd.setCursor(curX, curY);
lcd.setFont(FONT_SIZE_LARGE);
lcd.printLong(12345678);
curY++;
curY++;
delay(mydelay);
lcd.setTextColor(0, 255, 255);
lcd.setCursor(curX, curY);
lcd.setFont(FONT_SIZE_XLARGE);
lcd.printLong(12345678);
delay(5000);
lcd.backlight(false);
delay(mydelay);
mydelay = 0;
};