Getting Started: Running the “External Memory Demo”

 

Required Hardware

Configuring the Software

Configuring the Hardware

Demo Compatibility Matrix

 

Running the Demo:

This demo project is created to run on supported Microchip Demo Boards and development hardware. External data are programmed to the external SPI Flash memory of the selected hardware. Pre-generated hex files are available on the "Precompiled Hex” sub-directory found in the demo directory. These hex files are generated using the alternative hardware profiles found in the sub-directory named "Configs". Use the "Demo Compatibility Matrix" when running pre-generated hex files appropriate for your hardware.

For proper demo execution, the ExternalResource-ExternalMemory.hex file in "Resources” folder must be programmed into external flash memory installed on the selected hardware.

 

Please refer to the Getting Started - Programming Memory on Graphics PICtail Daughter and Demo Boards.htm for details of setting up the hardware for external memory programming.

 

To create a new hex file containing data for fonts and bitmaps to be located in the external flash memory use “Graphics Resource Converter (grc.jar)” utility included in the Graphics Library. Together with the generated hex file, the utility will also create a C file containing structures for referencing the fonts and bitmaps in the hex file. This C file must be included in the project. Please refer to the help file built in the “Graphics Resource Converter (grc.jar)” utility for details in generating the C and hex files. In the application, the use of bitmap and fonts located in external memory can be enabled by defining USE_BITMAP_EXTERNAL and USE_FONT_EXTERNAL in the GraphicsConfig.h included in the application. Stored data in the external memory will be accessed using the ExternalMemoryCallback() function also defined in the application.

 

ExternalMemoryCallback() is an application defined function that will fetch data from the external memory module. This function will be called by the PutImage() or OutChar() (also in OutText() and OutTextXY()) when the image or font is located in the external memory. Application code must supply the correct external memory driver that will do the actual communication to the external memory device.  

 Configuring the Software

To run the demo in the supported Development Board combination, set the proper hardware profile in the project HardwareProfile.h file:

 

·         To run the demo on selected Development Boards using QVGA display use:

#include "Configs/HWP_XXX_QVGAv1.h”

·         To run the demo on selected Development Boards using WQVGA display use:

#include "Configs/HWP_XXX_WQVGAv1.h”

·         To run the demo on Multimedia Expansion Board use:

#include "Configs/HWP_MEB_XXX.h”

 

Where: XXX represents any of the selected Development Boards.

 

The hardware profile file name refers to the combination of Development Boards that are used to run the demo. Refer to the abbreviations summary (link) for details.

 

The table below shows the hardware set up for the selected Development Boards attached to different Display Boards:

 

Required Hardware/Configuring the Hardware

 

Selected Development Boards

Graphics PICtail Board

3.2″ QVGA Truly TFT Display Board (AC164127-4)

4.3″ WQVGA Powertip TFT Display Board (AC164127-6)

 

PIC24FJ256DA210 Development Board (DM240312)

none

(see note 1)

(see note 1)

 

Multimedia Expansion Board (DM320005)

+

PIC32 USB Starter Kit II (DM320003-2)

OR

PIC32 Ethernet Starter Kit (DM320004)

(see note 2)

 

Explorer 16 (DM240001)

+

PIC24FJ128GA010 Plug-In-Module (PIM) (MA240011)

OR

PIC24FJ256GA110 Plug-In-Module (PIM) (MA240015)

OR

PIC24FJ256GB110 Plug-In-Module (PIM) (MA240014)

OR

PIC24FJ256GB210 Plug-In-Module (PIM) (MA240021)

OR

PIC24HJ128GP504 Graphics Plug-In-Module (PIM) (MA240016-2)

OR

dsPIC33FJ128GP804 Graphics Plug-In-Module (PIM) (MA330019-2)

OR

PIC32MX 100P QFP TO 100P Plug-In-Module (PIM) (MA320001)

OR

PIC32MX USB Plug-In-Module (PIM) (MA320002)

OR

PIC32MX CAN-USB Plug-In-Module (PIM) (MA320003)

Graphics LCD Controller PICtail™ Plus SSD1926 Board (AC164127-5) (see note 3)

 

Explorer 16 (DM240001)

+

PIC24EP512GU810 Plug-In-Module (PIM) (MA240025-1)

OR

dsPIC33EP512MU810 Plug-In-Module(PIM) (MA330024-1)

Note:

1.     When using PIC24FJ256DA210 Development Board set the jumpers to:

-       JP8 – open (color depth is 16BPP, byte access is not performed)

-       JP9 – don’t care

-       JP10 – don’t care

-       JP11 – don’t care

-       JP12 – don’t care

-       JP13 – don’t’ care

-       JP14 – set to RE9-S2 (use S2 switch)

-       JP15 – don’t care

-       JP23 – don’t care

2.     The Multimedia Expansion Board and the 3.2″ QVGA Truly TFT Display Board (AC164127-4) uses the same TFT display.

3.     When using Graphics LCD Controller PICtail™ Plus SSD1926 Board set the jumpers to:

-       JP1 – open

-       JP2 – depending on the PMP interface setting

- set to 1-2 (for 8-bit PMP)

- set to 2-3 (for 16-bit PMP)

-       JP3 – set to 1-2 (use RD1)

 

  

Legend:

Supported out of the box

Hardware compatible, will need firmware modification

Supported, see limitations

Not supported, hardware not compatible

 

Setting up the External Memory Programming Mode

 

The table below shows the programming mode used for each project.

·         UART means, the UART port of the PIC device is used to send external hex data.

·         USB means, the PIC device will act as a USB Device and external data will be sent through the USB Device port.

Project Name(*.mcp)

Programming Mode

External Memory Demo dsPIC

UART

External Memory Demo UART PIC24

UART

External Memory Demo UART PIC32

UART

External Memory Demo USB PIC24

USB

External Memory Demo USB PIC32

USB

 

For each development board and PIC device combination, the PRG switch (or push button) used in each development board to prompt the external memory programming is different and enumerated below.

Development Board

Switch to Prompt Flash Programming Mode

(PRG switch)

PIC24FJ256DA210 Development Board

S2

Explorer 16 + PIC24FJ256GB210 PIM + 16bit PMP Mode

S5

Explorer 16 + any PIC32 PIM + 16bit PMP Mode

S5

Explorer 16 + all other PIM

S6

 

 

To program the external memory:

1.     Hold down MCLR and PRG (see table above) switches on the board

2.     Release MCLR while holding down PRG. This will place the board on programming mode. The display will show the user prompted Programming External Memory Message.

3.     Send the hex data from the External Memory Programmer utility.

4.     After the programming, the firmware will automatically reset. If there was an error in the programming the screen will show the invalid data Programming External Memory Message.

 

 

Programming External Memory Messages

User Prompted

 

Program External Data

 

Please send data using

“External Memory

Programmer” utility.

Now waiting for data

via USB… (for USB based projects)

via UART… (for UART based projects)

 

Invalid Data Prompted

 

External data invalid

 

Please send data using

“External Memory

Programmer” utility.

Now waiting for data

via USB… (for USB based projects)

via UART… (for UART based projects)

 

 

 

Trademarks:

The Microchip name and logo, the Microchip logo, MPLAB, and PIC are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.

PICDEM and PICTail are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.

SD is a trademark of the SD Association in the U.S.A and other countries

Microsoft, Windows, Excel, and Windows Vista are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.