Library for Mini-DK board

Dependencies:   SPI_TFT_ILI9320

Dependents:   LPC1768_Mini-DK_EasyWeb_DM9161 LPC1768_Mini-DK LPC1768_Mini-DK

Fork of Mini-DK by Frank Vannieuwkerke

Mini-DK board overview (Micro SD connector is at the bottom side)

One serial interface , uses CP2102 (USB to RS232 interface, support ISP download )

RJ45-10/100M Ethernet network interface (Ethernet PHY: DM9161)

2.8 inch TFT color LCD interface (SPI interface or 16Bit parallel interface)

Touch panel controller XPT2046 (ADS7843 compatible)

USB 2.0 interface, USB host and USB Device interface.

TF SD / MMC card (SPI) interface.

Two user buttons, One Reset button and ISP button , One INT0 button, two user-programmable LED lights

Serial ISP download, Standard 20-pin JTAG download simulation debugging interface.

Selection between external 5V power supply or USB 5V supply.

Board size: 95mm * 78mm

All IO available on extension connectors

/media/uploads/frankvnk/mini-dk_top.jpg

04/01/13

Erik Olieman (http://mbed.org/users/Sissors/) joined the code development for the Mini-DK board.

Thanks to his input, we were able to obtain a tremendous speed gain, remove warnings, ...

An overview of all modifications is stored in modifs.h

The old page (http://mbed.org/users/frankvnk/code/LPC1768_Mini-DK/) contains the demo code.

IMPORTANT : Due to a change in the mbed libraries (Stream()), we cannot use the printf instruction - we need to use <SPI_TFT>.printf (example - see main.cpp in http://mbed.org/users/frankvnk/code/LPC1768_Mini-DK/)

WARNING: filetoflash (SD to CPU flash)

The SPI_TFT library contains an option to copy an image from the SD card to the CPU flash memory. This allows you to use an image as background without speed loss when writing other text and graphics.

By default, this option is enabled.

It can be disabled by uncommenting the #define mentioned below in Mini_DK.h:

#define NO_FLASH_BUFFER

Since the flash memory has limited write endurance, DO NOT use this feature when you intend to read multiple images from the SD card (eg: when used as a photo frame).

14/01/13

A newer version of the Mini-DK has been released by the manufacturer: Mini-DK2. They replaced the DM9161 PHY with a LAN8720A PHY and better buttons are fitted on the board. All other hardware remains the same. Code for this PHY is available from the NXP MCU SW application team. This allows us to use the mbed 'EthernetInterface' library with little modifications. Further info - see http://mbed.org/forum/mbed/topic/3684/?page=1#comment-18473.

Notes:

The code in 'lpc_phy_lan8720.c' uses 'msDelay' - needs to be replaced with 'osDelay'.

A custom MAC address can be defined using following code:

extern "C" void mbed_mac_address(char * mac) {
 
// define your own MAC Address
  mac[0] = 0x00;  
  mac[1] = 0x01;  
  mac[2] = 0x02;  
  mac[3] = 0x03;  
  mac[4] = 0x04;  
  mac[5] = 0x05;           
  
};

Files at this revision

API Documentation at this revision

Comitter:
Sissors
Date:
Tue Jan 08 17:39:50 2013 +0000
Parent:
15:9399be4feea0
Child:
17:66c4e84d8571
Commit message:
Added option to define NO_FLASH_BUFFER to disable flash buffer

Changed in this revision

Mini_DK.h Show annotated file Show diff for this revision Revisions of this file
SPI_TFT/SPI_TFT.cpp Show annotated file Show diff for this revision Revisions of this file
SPI_TFT/SPI_TFT.h Show annotated file Show diff for this revision Revisions of this file
--- a/Mini_DK.h	Tue Jan 08 15:29:29 2013 +0000
+++ b/Mini_DK.h	Tue Jan 08 17:39:50 2013 +0000
@@ -7,6 +7,9 @@
  *****  Func: Includes, pin and macro Declarations for the Mini DK board                      *****
  *****                                                                                        *****
  **************************************************************************************************/
+//Uncomment the following line if you need more flash memory.
+//#define NO_FLASH_BUFFER
+
 #include "SPI_TFT.h"
 #include "Arial12x12.h"
 #include "Arial24x23.h"
--- a/SPI_TFT/SPI_TFT.cpp	Tue Jan 08 15:29:29 2013 +0000
+++ b/SPI_TFT/SPI_TFT.cpp	Tue Jan 08 17:39:50 2013 +0000
@@ -29,7 +29,7 @@
     tft_reset();
     set_orientation(0);
     backgroundimage = false;
-    #ifdef USE_FLASH_BUFFER
+    #ifndef NO_FLASH_BUFFER
     backgroundOrientation = 0;
     #endif
 }
@@ -299,7 +299,7 @@
     _spi.format(8,3);
     _cs = 1;
     }
-    #ifdef USE_FLASH_BUFFER
+    #ifndef NO_FLASH_BUFFER
     else {
         int _orientation=orientation;
         set_orientation(backgroundOrientation);
@@ -628,11 +628,11 @@
             z =  bitmap_char[bpl * i + ((j & 0xF8) >> 3)+1];
             b = 1 << (j & 0x07);
             if (( z & b ) == 0x00) {
-                #ifdef USE_FLASH_BUFFER
+                #ifndef NO_FLASH_BUFFER
                 if (backgroundimage==false)
                 #endif
                     _spi.fastWrite(_background);
-                #ifdef USE_FLASH_BUFFER
+                #ifndef NO_FLASH_BUFFER
                 else
                 {
                     unsigned short *bitmap_ptr = (unsigned short *)sector_start_adress[ 25 ];
@@ -758,7 +758,7 @@
     return(1);
 }
 
-#ifdef USE_FLASH_BUFFER
+#ifndef NO_FLASH_BUFFER
 
 int SPI_TFT::fileToFlash(const char *Name_BMP)
 {
--- a/SPI_TFT/SPI_TFT.h	Tue Jan 08 15:29:29 2013 +0000
+++ b/SPI_TFT/SPI_TFT.h	Tue Jan 08 17:39:50 2013 +0000
@@ -14,16 +14,18 @@
 #ifndef MBED_SPI_TFT_H
 #define MBED_SPI_TFT_H
 
-//Use LPCs flash as extra memory, required for background images, allows rapid writing of images on filesystems after loading them once.
-//It uses alot of flash memory, generally that wont be a problem, if it is, comment the following line
-#define USE_FLASH_BUFFER
+/* This library allows you to store a background image on the local flash memory of the microcontroller, 
+from any filesystem (such as SD cards). This allows very fast writing of this specific image, and it allows
+you to write text in a nice way over the image. However it does cost the last 5 flash sectors of the LPC1768.
+Generally that won't be a problem, if it is a problem, add #define NO_FLASH_BUFFER before including this file.
+*/
 
 
 #include "GraphicsDisplay.h"
 #include "BurstSPI.h"
 #include "mbed.h"
 
-#ifdef USE_FLASH_BUFFER
+#ifndef NO_FLASH_BUFFER
     #include "IAP.h"
 #endif
 
@@ -280,7 +282,7 @@
    */
   void mod_orientation(void);
   
-  #ifdef USE_FLASH_BUFFER
+  #ifndef NO_FLASH_BUFFER
   /** Move an image to the background buffer
   * 
   * The image must fit exactly on the screen (240x320). This function takes quite some time, depending on source filesystem.
@@ -402,7 +404,7 @@
   BurstSPI _spi;
   DigitalOut _cs;
   unsigned char* font;
-  #ifdef USE_FLASH_BUFFER
+  #ifndef NO_FLASH_BUFFER
   IAP     iap;
   int backgroundOrientation;
   #endif