iTeadStudio TFT Display for ARDUINO
Purchased a 400×240 pixel graphic touch-capable display (new link) module plus its accompanying Arduino MEGA-compatible shield from iTead Studio. The shield has been updated to version 2. See bottom of post for more information.
The shield has, in addition to the connections to the display module, connections to a battery-backed real time clock that has been implemented in the shield. The display module consists of the display panel (the screen), a touch controller and a SD Card socket.
The iTead description says:
The ITDB02 LCD module is work in 3.3V voltage level and it’s not compatible with Arduino MEGA pins, so we make a shield for Arduino MEGA. Now user can directly plug the ITDB02 in the shield and stand on the Arduino MEGA board.
In reality, the ITDB02 module IS fully compatible with Arduino MEGA pins. The shield just makes it much, much easier to connect to the Arduino board. With respect to the 3.3 power, the shield merely connects the Arduino 5V power pin to the display module’s VCC pin which feeds a local LDO regulator that generates the required 3.3V.
MEGA COMPATIBLE SHIELD
(Update 9/7/12): The resistors in the shield are there to limit the current to the protection diodes in the display module, so they are just in series with the signal lines. The inputs of the display must be 5V tolerant even thought the display operates at 3.3V. The better solution is to implement a level conversion 5V->3.3V and this has been done in the new version of the shield. More information in the Arduino forums [link]
COMPONENTS OF DISPLAY MODULE
Full color, 400×240 pixel TFT screen with a 16:9 widescreen aspect ratio. S/W supports 24-bit RGB color. The ITDB02-3.2WD uses the HX8352-A controller
On the back side of the display module:
3.3v LDO regulator: CE6209. The jumper J1 is there to bypass the regulator if your VCC is already 3.3V. First time I see a Chinese-branded LDO regulator.
Note that J1 is used to pass VCC if a regulator is not used. In this case, a regulator is used and thus J1 is open. There is also opportunity to increase C1.
SD Card socket
Here is the display module and the shield stacked on top of an Arduino MEGA 2560
The library (“UTFT” for “Universal TFT”) for this display has been developed by Mr Karlsen and is available here: [link]. Support for the 240×400 pixel display is available with version 1.10 and higher as this is a new display. The software also supports the wiring of the Mega shield shown above. (The control pins are assigned through s/w, though).
The controller for this screen is HX8352-A (apparently it replaces the ILI9327 controller). You will need to enter the controller model in the code as “HX8352A”. The enclosed documentation in the code tells you more. In addition, you need to know this controller model to take advantage of “memory saving” as specified in memorysaver.h
The library is ITDB02-TOUCH, also developed by Mr. Karlsen: [link]. Is also compatible with the wiring of the Mega shield shown above and any other wiring configuration as the 5 interface wires are assignable through s/w.
Real Time Clock:
Mr. Karlsen also developed a library for the SD Card socket/reader [link]. However it is limited to FAT16 formatted SD cards up to 2GB in size and 8.3 characters file names. There is also the Arduino SD Library [link] that supports both FAT16 and FAT32 file systems on standard SD cards and SDHC cards. It is also limited to 8.3 characters file names. There is also a tutorial on SD Card interfacing at LadyAda [link].
Even though the shield takes up all the pins in the Arduino MEGA board, not all the pins are used for the display module and the real time clock. You can connect other devices (e.g. soldering wires) to the free pins.
Pin-out assignment of display module
Includes the screen, touch controller, SDCard reader and Flash. Designation to the different device interfaces are as follows:
- Dxx: TFT screen
- SDxx: SDCard reader
- D_xx: Touch controller
- F_xx: Flash (not populated in this particular module)
Here is the pin mapping of the Ardino MEGA 2560 board:
Obviously the shield matches the 40-pin output of the display module with the pins of the Arduino. In addition, the shield has a real time clock that is separate from the display module and exports the interface pins of this device as well.
These are the pins that are used by the shield. You can refer to the pin basic pin mapping [link] and the manual in pdf [link] (I saved a local copy because this is now a discontinued product: ITDB02MEGAshield_DS ):
Shield/TFT Arduino MEGA pins (section) DB0 to DB15 22 to Digital 37 (Digital) - 16-bit data for screen RS, WR, CS, RST 38, 39, 40, 41 (Digital) - Screen control signals LED-A, VCC, GND 3.3V, 5V, GND (Power) - Power SD_OUT 50 (Digital) - SD Card reader SD_CLK 51 (Digital) - SD Card reader SD_IN 52 (Digital) - SD Card reader SD_CS 53 (Digital) - SD Card reader ------ 42-49 (Digital) - Free pins D_CLK 6 (PWM -also digital) - Touch controller D_CS 5 (PWM -also digital) - Touch controller D_IN 4 (PWM -also digital) - Touch controller D_OUT 3 (PWM -also digital) - Touch controller D_IRQ 2 (PWM -also digital) - Touch controller RTC (SDA) 20 (Communication) - Real Time clock (I2C) RTC (SLC) 21 (Communication) - Real Time clock (I2C) Since the RTC is an I2C device, these pins can be used to connect other I2C devices
Here is a diagram of the pin assignments:
Note: a readier discovered an error in diagram for the SD pins. Look at the pin assignment in the following diagram from the vendor’s website. The diagram corresponds to the new V2 shield, thus there is no real time clock (which is an I2C device). However if you use the shield, you don’t have to worry about the pin assignments except to figure out which pins are free for other functions:
Download the latest version of the UTFT library.
Copy the UTFT folder to the arduino-1.0\libraries folder
There is sample code for the 400×240 display in the arduino-1.0\libraries\UTFT\examples\Arduino folder. Comment the code for UNO and un-comment the code for MEGA (follow the instructions written in the code). Modify the UTFT function with the model for your controller. For the above display I used “HX8352A”
// Uncomment the next line for Arduino Mega UTFT myGLCD(HX8352A,38,39,40,41); // Remember to change the model parameter to suit your display module!
Compile with Arduino 1.0 (does not work with earlier versions of the Arduino software and upload
Here is all I can for now…
NEW VERSION OF THE SHIELD
The shield has been replaced with a newer mode. It does away with the real-time clock chip and replaces the resistors with logic chips (74xx541) for buffering and voltage level conversion, which is a better implementation. In addition it has a input voltage selection switch to make it compatible with Arduino (5v operation) or ChipKit (3.3v operation).
Possibly the buffer chip used in the new shield is a part similar to 74LCX541 which has 5V tolerant inputs and output. This design further protects the display module.
The resistors that were used in the previous version of the shield are there to limit the current to the protection diodes in the display module, so they are just in series with the signal lines. Based on the implementation of the shield, the inputs of the display must therefore be 5V tolerant even thought the display operates at 3.3V. The better solution is to implement a level conversion 5V->3.3V as implemented in the new version of the shield. More information in the Arduino forums [link]
The old version of the shield is still available in kit form: [link] for US $5.50. However it is missing the 3.3V regulator and the SD card reader (so maybe not such a good deal)
For some, this may be a better option because you can solder connection wires to some of the unused pins