In this tutorial we will learn how to programming the TFT LCD Touch Screen. I used 2.8' TFT Touch Display ILI9325 Module and Arduino Uno for this tutorial. The topics we will view in this tutorial. OPEN-SMART Shields can not read LM75A on a Mega because there are no SDA/SCL pins next on AREF header. Uno: LM75A on pcb works. Difficult to add external I2C devices when Shield is plugged in.
Connections are different to those in my other Instructables (this is for my convenience!) you can change the pin allocations, but do use the hardware SPI pins:
- UNO +5V to display pin 1 (VCC)
- UNO +5V through a 56 Ohm resistor to display pin 8 (LED)
- UNO 0V (GND) to display pin 2 (GND)
- UNO digital pin 7 through a 1K2 resistor to display pin 4 (RESET), add a 1K8 resistor from display pin 4 to GND
- UNO digital pin 8 through a 1K2 resistor to SD card SD_CS, add a 1K8 resistor from SD_CS to GND
- UNO digital pin 9 through a 1K2 resistor to display pin 5(DC/RS), add a 1K8 resistor from display pin 5 to GND
- UNO digital pin 10 through a 1K2 resistor to display pin 3 (CS), add a 1K8 resistor from display pin 3 to GND
- UNO digital pin 11 through a 1K2 resistor to both display pin 6 (MOSI) and SD card pin SD_MOSI, add a 1K8 resistor from display pin 6 to GND
- UNO digital pin 12 direct to SD card SD_MISO (or via 1K2, see below)
- UNO digital pin 13 through a 1K2 resistor to both display pin 7 and SD card pin SD_SCK, add a 1K8 resistor from display pin 7 to GND
Other pin outs at the Arduino can be used by adapting the sketch should you have a display from another supplier or wish to use an existing setup.
You may wish to put an inline 1K2 (or there about) resistor in series with the MISO signal line (between UNO pin 12 and SD_MISO) this will help protect the SD Card in case you accidentally switch the UNO pin 12 to output a +5V logic 1... The SD card might survive such abuse but you may not be lucky... and the resistor will limit the current into the device to a couple of mA.
Bear in mind the display I have incorporates 10K pullups to the +3.3V supply on the SD Card SPI lines, this means that using higher value resistors in the voltage divider (these drop the UNO 5V levels to around 3V logic) will not achieve a reliable logic zero and it won't work! Ideally we would use a logic level converter but resistors are so cheap and they work fine at these frequencies because the stray capacitance of the lines we are driving is not that significant. The display is quite greedy on power so the dissipation in the resistors is not that significant in comparison.
Do not insert and remove the SD card when the Arduino is powered, this can (does!) corrupt the card and it will need reformatting!