I have connected Arduino through CD4050BE to ILI9341 by scheme below and display works fine, but i don't understand how to connect SD-card. I tried to connect SD_MOSI, SD_MISO, SD_SCK jointly with MOSI, MISO, SCK from TFT-display and SD_CS into D4, but it doesn't work. Anybody help me make it work...
ironic ? 5 lines must be converted from 5V to 3,3V, so a simple "voltage divider" is sufficient. 5 lines, x 2 resistors (voltage divider) = 10 resistors
Hi all !3 days i read, i read and i read.3 days i try, i try and i try.I do Many things but i am disappointed I have a ILI9341 LCD TFT, the same as most people here. I have a CD4050. i have a 3.3v power supply.And i have un Arduino uno and a nano (328).Arduino -> CD4050 -> ILI9341sclk= 13miso = 12 (direct arduino TFT)mosi = 11cd= 6cs = 5reset = 4I Power LCD and CD4050 with 3.3v from power supply (grounded to arduino GND).I Use a cap near TFT and CD4050.All is ok, i can run libraries (ILI9341/SeeedTFTv2/AdaFruit9341/UTFT/Ucglib/MultiLCD).But : I can't run Fast SPI (HW SPI) on AdaFruit, UTFT and Ugclib.MultiLCD is probably the most speed, it run HW SPI (i think) but it's very limited functions.ILI9341/SeeedTFTv2 run fast but no landscape possibility.- Adafruit is very slow with :Adafruit_ILI9341 tft = Adafruit_ILI9341(5, 6, 11, 13, 4, 12); : WORKS Adafruit_ILI9341 tft = Adafruit_ILI9341(5, 6, 4); WHITE SCREEN- Ucglib is very slow too :Ucglib_ILI9341_18x240x320_SWSPI ucg(/*sclk=*/ 13, /*data=*/ 11, /*cd=*/ 6 , /*cs=*/ 5, /*reset=*/ 4); WORKSUcglib_ILI9341_18x240x320_HWSPI ucg(/*cd=*/ 6 , /*cs=*/ 5, /*reset=*/ 4); WHITE SCREEN- UTFT is SW SPI Only (i Think).ILI9341/SeeedTFTv2/MultiLCD are probably *10 faster. SD Card isn't wired.I tried it and it works (so HW SPI WORKS ?) Show directoty/read/write/infos... from serial monitorBUT it doesnt' work if i try to use TFT together (SW and HW mode)I Tried with Uno and Nano, same result.CD5040 isn't bad, FAST SPI works with some libraries.I read someone have the same issue in this topic (i think).I don't know where is the problem.Anyone have an idea ?(Sorry for my english).
Ucglib_ILI9341_18x240x320_HWSPI ucg(/*cd=*/ 6 , /*cs=*/ 5, /*reset=*/ 4); [b]WHITE SCREEN[/b]
#include "SPI.h"#include "Adafruit_GFX.h"#include "Adafruit_ILI9340.h"#define _sclk 13#define _miso 12#define _mosi 11#define _cs 5 //10#define _dc 6 //9#define _rst 4 //8Adafruit_ILI9340 tft = Adafruit_ILI9340(_cs, _dc, _rst); // Use hardware SPI
#include "SPI.h"#include "Adafruit_GFX.h"#include "Adafruit_ILI9341.h"// For the Adafruit shield, these are the default.#define TFT_DC 9#define TFT_CS 10// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DCAdafruit_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);
Just a last question.For driving this screen, 6 wires are needed.- sclk - miso - mosi - cs - dc - rst[sclk] is needed and must be pin 13 for Hardware SPI.[miso] is unneeded and can be unwire disconnect. (communication TFT => Arduino)[mosi] is needed and must be pin 11 for Hardware SPI.[cs] is needed and can be any other output pin.[dc] is needed and can be any other output pin.[rst] is unneeded and can be wired to 3.3v or arduino reset with a resistor.So Can i use Hardware SPI and use pin 12 for [cs] or [dc].I try it but not working.
No. You cant define two functions to a single PIN. Either you set it to HWSPI or to Digital Output.
Assuming you are not using the TFT you could ground the CS Pin to save a digital I/O. You have to change the library tough, otherwise it will give you an error if you dont define it.