DM-TFT22-102
.
Description
The DM-TFT22-102 display module, specifications and other resources are available from DisplayModule.com.
- 2.2"
- SD-card slot
- 262K color depth
- 128x160
- SPI interface
- 2 LED backlit
The display module has a 40-pin connector and requires a shield (DM-ADTAU-001) to be compatible with Arduino pinning.
Pinning
The following pins are used (not including GND and VCC) when connected to the DM-ADTAU-001 adapter:
Arduino Pin | Function |
---|---|
A2 | Display Reset |
A3 | ChipSelect for display |
A4 | Display Read/Write |
A5 | Display Data/Command |
D0 | 8-bit display interface |
D1 | 8-bit display interface |
D2 | 8-bit display interface |
D3 | 8-bit display interface |
D4 | 8-bit display interface |
D5 | 8-bit display interface 1) |
D6 | 8-bit display interface |
D7 | 8-bit display interface |
D10 | ChipSelect for SD Card and Touch Detect pin 2) |
D11 | SPI MOSI for SD Card |
D12 | SPI MISO for SD Card |
D13 | SPI SCLK for SD Card |
1)
For LPC1549 some hardware settings are needed. Look at http://www.displaymodule.com/pages/mbed for details.
2)
The functionallity of the D10 pin is controlled with the slider on the DM-ADTAU-001 adapter board. It must be in the SD_CS position for SD Card to work. The DM-TFT22-102 does not have touch support so the T_IRQ position just disables SD Card.
Compatibility
The display module has been tested with the following platforms:
Platform | Comment |
---|---|
LPCXpresso1549 | The LPC1549 uses ports D0 and D1 for printf (STDIO_UART_RX and STDIO_UART_TX). Those two pins are part of the display's 8-bit interface. The direct consequence is that printf cannot be used in any code that uses this display. |
EA LPC4088 QuickStart Board with a LPC4088 QSB Base Board | Add comment |
Software
There is a library to get you started with the displays:
Import libraryDmTftLibrary
Driver Library for our displays
To use the library:
main.cpp
#include "mbed.h" #include "DmTftS6D0164.h" DmTftS6D0164 tft; /* DM_TFT22_102 */ int main() { tft.init(); tft.drawString(20, 20, "x:"); tft.drawString(100, 20, "y:"); while(true) { ... } }
To use the SD Card include the SDFileSystem library in your project and initialize like this:
main.cpp
#include "mbed.h" #include "DmTftS6D0164.h" #include "SDFileSystem.h" /* Displays with adapter */ #define DM_PIN_CS_SDCARD D10 #define DM_PIN_SD_SPI_MOSI D11 #define DM_PIN_SD_SPI_MISO D12 #define DM_PIN_SD_SPI_SCLK D13 DmTftS6D0164 tft; /* DM_TFT22_102 */ SDFileSystem sd(DM_PIN_SD_SPI_MOSI, DM_PIN_SD_SPI_MISO, DM_PIN_SD_SPI_SCLK, DM_PIN_CS_SDCARD, "sd"); // mosi,miso,clk,cs DigitalInOut csSDCard(DM_PIN_CS_SDCARD, PIN_OUTPUT, PullUp, 1); int main() { const char* fname = "/sd/logop565.bmp"; tft.init(); while (true) { FILE *fp = fopen(fname, "r"); if (fp != NULL) { ... } } }
There are also some demo programs:
Import programdm_sdcard_with_adapter
Shows how to use a display and the onboard SD Card. Requires a display module with an adapter
Import programdm_main
Shows how to use the display. Draws a bitmap from internal flash, some geometric shapes and some text
Import programdm_bubbles
Shows how to use the display. Draws circles that bounce around on the display.
Please log in to post comments.