DM-TFT24-104
.
Description
The DM-TFT24-104 display module, specifications and other resources are available from DisplayModule.com.
- 2.4"
- Touch Screen
- SD-card slot
- 262K color depth
- 240x320
- 8-bit interface
- 4 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 |
---|---|
A0 | SPI MOSI for touch |
A1 | SPI SCLK for touch |
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 |
D8 | ChipSelect for touch |
D9 | SPI MISO for touch |
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 T_IRQ position does nothing (the driver does not use interrupts).
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 "DmTftIli9325.h" #include "DmTouch.h" /* Displays with adapter */ #define DM_PIN_SPI_MOSI A0 #define DM_PIN_SPI_MISO D9 #define DM_PIN_SPI_SCLK A1 #define DM_PIN_CS_TOUCH D8 #define DM_PIN_CS_TFT A3 #define DM_PIN_CS_SDCARD D10 DmTftIli9325 tft; /* DM_TFT28_103 and DM_TFT24_104 */ //DmTouch touch(DmTouch::DM_TFT24_104, DmTouch::Software); /* For LPC4088 QuickStart Board */ DmTouch touch(DmTouch::DM_TFT24_104); DigitalInOut csTouch(DM_PIN_CS_TOUCH, PIN_OUTPUT, PullUp, 1); DigitalInOut csDisplay(DM_PIN_CS_TFT, PIN_OUTPUT, PullUp, 1); DigitalInOut csSDCard(DM_PIN_CS_SDCARD, PIN_OUTPUT, PullUp, 1); int main() { tft.init(); tft.drawString(20, 20, "x:"); tft.drawString(100, 20, "y:"); touch.init(); while(true) { ... } }
To use the SD Card instead of the Touch Screen include the SDFileSystem library in your project and initialize like this:
main.cpp
#include "mbed.h" #include "DmTftIli9325.h" #include "SDFileSystem.h" /* Displays with adapter */ #define DM_PIN_SPI_MOSI A0 #define DM_PIN_SPI_MISO D9 #define DM_PIN_SPI_SCLK A1 #define DM_PIN_CS_TOUCH D8 #define DM_PIN_CS_TFT A3 #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 DmTftIli9325 tft; /* DM_TFT28_103 and DM_TFT24_104 */ 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 csTouch(DM_PIN_CS_TOUCH, PIN_OUTPUT, PullUp, 1); DigitalInOut csDisplay(DM_PIN_CS_TFT, PIN_OUTPUT, PullUp, 1); 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_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.
Import programdm_calibrate
This application makes it possible to calibrate the touch screen. Note that the calibration data is not persistently saved. Either do the calibration on every startup or modify the default values in DmTouchCalibration.
Import programdm_touch
Shows how to use a display and the touch controller. Will display the X and Y coordinates of the current touch event.
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_paint
Shows how to use a display and the touch controller. A very basic paint program.
Import programdm_calc
Shows how to use a display and the touch controller. A very basic calculator. Note that for some displays the LANDSCAPE define must be set for the layout to be correct.
1 comment on DM-TFT24-104:
Please log in to post comments.
Please give pinning diagram of DM-TFT24-104 to mbed LPC1768 board. Thank you