PDF Print E-mail

HOW TO: Use the external EEPROM to load images onto the 128x128 Colour GLCD

 

 

overview

 

Items used in this tutorial:

  • FlamingICE40
  • GLCD + RTC Combo Module
  • FI EEPROM
  • FI Comm.Key
  • 6V Power Supply

With the launch of FIDE 2.0, many new and powerful features were introduced to make embedded programming and integration a whole lot easier; one of the greatest features that came with it is the ability to flash the external EEPROM with the data generated by the GLCD tool.  Before we go on to explore this new feature, let’s get the hardware up.

 

HARDWARE CONFIGURATION

 

FI40_GLCD_CONFIG.png

 NOTE(1): To find out how to interface the FI Comm.Key to the FIDE and power up the FI40 Board, as well as setting up a new project in FIDE, please refer to the document ‘FlamingICE_GettingStarted’, a copy of this can be obtained from the download’s tab.

 NOTE(2): To find out how to use the GLCD tool, please refer to the application note for the tool. This can be obtained from the download’s tab.

 

For this tutorial, I’m using the following image (100x100)px.

exampleImg.png

After loading the image up in the GLCD tool (FIDE > Tools > GLCD), save it as a text file so that the tool can automatically generate the code data required for writing to the external EEPROM later on.

Now that the preparations are done, we can move on to programming the FI40 Board to display the image from the EEPROM.

Launch FIDE and enter the COM Port assigned to your FI Comm.Key. (Refer to Note 1)

Set up a new project in FIDE and save it before doing anything else.

 

LOADING UP THE External EEPROM

Open up the text file you just saved and copy everything to the clipboard.

Under ExEEPROMData1 (select the file from the project tree view), declare a 2 dimensional Integer array with parameters (100, 50).

Project_TreeView.png

NOTE: The colours are saved in 16bit word data, which is 2 bytes, so a 100x100 pixel with 1byte worth of data per pixel would be saved with 100 rows of 50 columns of 16bit word data.

 

CODE:

'CODE:Data1

Public IMAGE100(100, 50) As Integer

‘<paste the data from the text file here>

 

 

Power up the FI40 Board.

Compile the Data and Write to the EEPROM by clicking on the 2 respective icons on the tool bar as shown below.

EEPROM_tool.png

The data is now in the FI EEPROM. Now we need to write some codes to retrieve the data for display on the GLCD.

 

PROGRAMMING THE FI40

Under Module1;

Declare these (BX, BY) as public variables.

 

CODE:

 

Dim BX, BY As Integer

Dim I as Integer

 


Under the Main() Subroutine, initialize the GLCD and fill the background with the colour white (value = 255) using the following commands.

 

CODE:

 

OS.GLCD.Init()

OS.GLCD.Fill(255)

 

‘Set the starting location of the image (0, 0)

BX = 0

BY = 0

 

‘set the region to fill the image;

‘where the starting point is (0,0) and the ending point is (99,99)

OS.GLCD.SetRegion(BX, BX + 99, BY, BY + 99)

 

‘Read the first column to the Buffer. Note that the buffer is limited to 128 bytes.

OS.ExEEProm.ReadToBuffer(0, 100)

‘Fill the first line of the GLCD region with data from the buffer.

OS.GLCD.FillRegion(0, 100)

‘Continue to do this for the rest of the 49 columns.

For i = 1 To 49

    OS.ExEEProm.ReadToBuffer(i * 100, 100)

    OS.GLCD.FillRegion_Cont(0, 100)

Next

 

 

COMPILE_DOWNLOAD.png

Compile the project to check for any syntax errors. If there are none, proceed to download the project into the FI40 Board.

Congrats! The image should now show up on your GLCD.

 


download_sourceCode.png

 
Previous Next
Two New Tutorials
Learn how to control a Servo Motor with the FIDE, as well as adding a wireless peer-to-peer communication link using the EBlue Bluetooth Module.
Hoorah! We've Updated!
3 Cheers to a new tutorial, a FIDE patch, and a Language Reference Update!
New Sensor and Documentation Updates

 

We now carry the distance measuring sensor, SHARP GP2D12, WITH the compatible 3pin connector.

In other updates, we have uploaded the technical paper for our GLCD+RTC Combo complete with example configurations to our FlamingICE Boards. 

Our Hardware Reference now stands at version 1.5 with slight changes to the pin-outs on the FI28 Board. 

 

Christmas Updates

Download the latest FIDE v2.1 and get all the updated documentation that comes along with it!

Check out the new goodies that we have over at our updated Products Page!

Resource Page

Now that FIDE 2.0 is up, we published the Resource Page with 2 major tutorials to boot.

Start clicking and head over to check out those tutorials!

FIDE v2.0 RELEASED!

AIS Cube is proud to release the latest and most complete installment to date, FIDE v2.0. Delivering faster feature packed goodness, whats not to love?

Head over to the downloads tab and grab your copy!

FIDE v1.4.2 PATCH

IMPORTANT: Responding to a bug report, the FIDE v1.4.2 PATCH is a patch for a major bug fix in the FIDE SD Tool. Please ensure that you have FIDE v1.4.2 installed before proceeding with the Patch.

Patch is available over on the Downloads Tab.

FIDE v1.4 Released!
More features with the latest release of FIDE at version 1.4. Extended syntax highlighting range, greater support for FIDE system language instructions...
FIDE v1.3 Released!

FIDE v1.3 is now available for download over at the downloads tab. Featuring bug fixes and other features such as an expanded syntax highlighting coverage, it is highly recommended that you upgrade to the newest version.

AVRIL LE BOB

We have a new project named AVRIL LE BOB up over at the projects page (with videos!!). Check it out today!


Copyright © 2007-2008. AIS Cube. All Rights Reserved.
All trade and/or services marks mentioned are the property of their respective owners.
Joomla! is Free Software released under the GNU/GPL License.