graphics controllers control panel demo€¦ · 3.10 add text fields ... after installing the ghc...

25
Fujitsu Microelectronics Europe Application Note Internal an-mb86r03-controlpanel- tutorial-rev0-02 GRAPHICS CONTROLLERS MB86R03 'JADE-L' CONTROL PANEL DEMO TUTORIAL

Upload: others

Post on 16-Aug-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Fujitsu Microelectronics Europe Application Note

Internal

an-mb86r03-controlpanel-tutorial-rev0-02

GRAPHICS CONTROLLERS MB86R03 'JADE-L'

CONTROL PANEL DEMO TUTORIAL

Page 2: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Revision History

an-mb86r03-controlpanel-rev0-02 - 2 - © Fujitsu Microelectronics Europe GmbH Internal

Revision History

Date Issue

2010-03-24 tk First draft

2010-05-19 tk Preparation and IAR chapter added

This document contains 25 pages.

Page 3: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Warranty and Disclaimer

© Fujitsu Microelectronics Europe GmbH - 3 - an-mb86r03-controlpanel-rev0-02 Internal

Warranty and Disclaimer

To the maximum extent permitted by applicable law, Fujitsu Microelectronics Europe GmbH restricts its warranties and its liability for all products delivered free of charge (eg. software include or header files, application examples, target boards, evaluation boards, engineering samples of IC’s etc.), its performance and any consequential damages, on the use of the Product in accordance with (i) the terms of the License Agreement and the Sale and Purchase Agreement under which agreements the Product has been delivered, (ii) the technical descriptions and (iii) all accompanying written materials. In addition, to the maximum extent permitted by applicable law, Fujitsu Microelectronics Europe GmbH disclaims all warranties and liabilities for the performance of the Product and any consequential damages in cases of unauthorised decompiling and/or reverse engineering and/or disassembling. Note, all these products are intended and must only be used in an evaluation laboratory environment.

1. Fujitsu Microelectronics Europe GmbH warrants that the Product will perform substantially in accordance with the accompanying written materials for a period of 90 days form the date of receipt by the customer. Concerning the hardware components of the Product, Fujitsu Microelectronics Europe GmbH warrants that the Product will be free from defects in material and workmanship under use and service as specified in the accompanying written materials for a duration of 1 year from the date of receipt by the customer.

2. Should a Product turn out to be defect, Fujitsu Microelectronics Europe GmbH´s entire liability and the customer´s exclusive remedy shall be, at Fujitsu Microelectronics Europe GmbH´s sole discretion, either return of the purchase price and the license fee, or replacement of the Product or parts thereof, if the Product is returned to Fujitsu Microelectronics Europe GmbH in original packing and without further defects resulting from the customer´s use or the transport. However, this warranty is excluded if the defect has resulted from an accident not attributable to Fujitsu Microelectronics Europe GmbH, or abuse or misapplication attributable to the customer or any other third party not relating to Fujitsu Microelectronics Europe GmbH.

3. To the maximum extent permitted by applicable law Fujitsu Microelectronics Europe GmbH disclaims all other warranties, whether expressed or implied, in particular, but not limited to, warranties of merchantability and fitness for a particular purpose for which the Product is not designated.

4. To the maximum extent permitted by applicable law, Fujitsu Microelectronics Europe GmbH´s and its suppliers´ liability is restricted to intention and gross negligence.

NO LIABILITY FOR CONSEQUENTIAL DAMAGES

To the maximum extent permitted by applicable law, in no event shall Fujitsu Microelectronics Europe GmbH and its suppliers be liable for any damages whatsoever (including but without limitation, consequential and/or indirect damages for personal injury, assets of substantial value, loss of profits, interruption of business operation, loss of information, or any other monetary or pecuniary loss) arising from the use of the Product.

Should one of the above stipulations be or become invalid and/or unenforceable, the remaining stipulations shall stay in full effect

Page 4: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Contents

an-mb86r03-controlpanel-rev0-02 - 4 - © Fujitsu Microelectronics Europe GmbH Internal

Contents

REVISION HISTORY............................................................................................................ 2

WARRANTY AND DISCLAIMER ......................................................................................... 3

CONTENTS .......................................................................................................................... 4

1 INTRODUCTION.............................................................................................................. 5

2 PREPARATION ............................................................................................................... 6

2.1 Hardware................................................................................................................. 6

2.2 GHC installation ...................................................................................................... 6

2.3 CodeSourcery installation........................................................................................ 6

2.4 GHC compiler configuration .................................................................................... 6

2.5 IAR installation ........................................................................................................ 7

3 GHC PROJECT ............................................................................................................... 8

3.1 Start New Project .................................................................................................... 8

3.2 Open New Page ...................................................................................................... 8

3.3 Open Flow Design Table ......................................................................................... 9

3.4 Include images ........................................................................................................ 9

3.5 Drag and drop all graphics onto the Page ............................................................... 9

3.6 Update Action Table.............................................................................................. 10

3.7 Update Event Table............................................................................................... 11

3.8 Configure buttons.................................................................................................. 13

3.9 Define Fonts.......................................................................................................... 16

3.10 Add text fields........................................................................................................ 18

3.11 Finished project ..................................................................................................... 20

3.12 Compile project ..................................................................................................... 21

4 IAR PROJECT ............................................................................................................... 22

4.1 Initialize Hardware................................................................................................. 22

GDC Interrupt........................................................................................................ 22

4.2 Functions called within GHC.................................................................................. 22

4.3 Main GHC application ........................................................................................... 22

4.4 Compile and start the application .......................................................................... 23

APPENDIX ......................................................................................................................... 24

Troubleshooting.............................................................................................................. 24

WORLDWIDE HEADQUARTERS AND DISCLAIMER....................................................... 25

Page 5: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 1 Introduction

© Fujitsu Microelectronics Europe GmbH - 5 - an-mb86r03-controlpanel-rev0-02 Internal

1 Introduction

Creating modern Human Machine Interfaces (HMI) can be a challenging and time consuming task for programmers. The Jade-L Embedded Starterkit comes with an evaluation version of Fujitsu's new 'Graphic Human Interface Creator Version 2.0'. With this software, any user without programming experience can design Human Machine Interfaces (HMI) and automatically generate source code for an application which runs on the Fujitsu MB86R03 'Jade-L'. This tool greatly reduces development time and permits creating professional HMIs for embedded products.

This tutorial describes how to design and implement a basic control panel with GHC. All necessary tasks a briefly described and the reader should be able to design his own GUI after reading.

If you are new to GHC we recommend to first start with the tutorial inside the GHC installation package.

Page 6: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 2 Preparation

an-mb86r03-controlpanel-rev0-02 - 6 - © Fujitsu Microelectronics Europe GmbH Internal

2 Preparation

2.1 Hardware

The following hardware is needed:

� JadeL Starterkit

� J-Link ARM Emulator

� 800x480(WVGA) Touch panel

See the following link for more details

http://www.fujitsu.com/emea/services/microelectronics/gdc/evalbds/jade-l-starterkit.html

2.2 GHC installation

The following steps are necessary to install and license the GHCV2 - HMI Creator:

1. Extract DiskInfo.zip to your local hard disk

2. Login with administrator privilege

3. Run DiskInfo.exe

4. Press "...." to obtain the Primary Disk ID

5. Contact and send the Primary Disk ID to the Fujitsu regional support for requesting the serial number

6. After receiving the serial number, run GHCV2.0.xx.msi with administrator privilege and apply the serial number

7. After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account

2.3 CodeSourcery installation

Codesourcery is an EABI GNU toolchain for ARM. GHC needs the compiler to generate a librariy which is later used within the IAR toolchain.

You can download the IA32 Windows Installer from the Codesourcery webpage

http://www.codesourcery.com/sgpp/lite/arm/portal/release1033 .

2.4 GHC compiler configuration

You must select the Codesourcery compiler path within the GHC tool environment. Press the Option->Path->Compiler button inside the top menu and select the Codesourcery folder as shown in the picture below.

Page 7: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 2 Preparation

© Fujitsu Microelectronics Europe GmbH - 7 - an-mb86r03-controlpanel-rev0-02 Internal

2.5 IAR installation

Insert the installation CD. The CD contains all the software you need to get your development project up and running. The installation program starts automatically.

Page 8: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 3 GHC Project

an-mb86r03-controlpanel-rev0-02 - 8 - © Fujitsu Microelectronics Europe GmbH Internal

3 GHC Project

This chapter describes all necessary steps to create a basic control panel.

3.1 Start New Project

Select Project->New from the top menu to start a new project. Select Jade and 800x480 as LCD size. Navigate with the Next button to Step 3 of 3 and leave other panes untouched.

3.2 Open New Page

Right click on the Page folder and select New Page. After that you can rename the page.

Page 9: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 3 GHC Project

© Fujitsu Microelectronics Europe GmbH - 9 - an-mb86r03-controlpanel-rev0-02 Internal

3.3 Open Flow Design Table

Right click on the FlowDesignTable folder and select New Flow Design. All events and animations are configured here.

3.4 Include images

In the bottom right corner change to the Image Library pane. Right click in the pane and select Add New Image to include all graphics.

3.5 Drag and drop all graphics onto the Page

Open the Page by a double click onto the Page symbol inside the browser menu on the left. After that you can simply drag and drop your images (only off state in this case) onto the page.

Page 10: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 3 GHC Project

an-mb86r03-controlpanel-rev0-02 - 10 - © Fujitsu Microelectronics Europe GmbH Internal

3.6 Update Action Table

Open the FlowDesignTable by a double click onto the FlowDesignTable symbol inside the browser menu on the left. Inside the Action Table pane add an action by pressing the plus sign.

The ControlPanel Action is later used as startup action to show the project on the screen. The dummy_action is without any ActionDefinition inside the lower window.

Page 11: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 3 GHC Project

© Fujitsu Microelectronics Europe GmbH - 11 - an-mb86r03-controlpanel-rev0-02 Internal

3.7 Update Event Table

Open the FlowDesignTable by a double click onto the FlowDesignTable symbol inside the browser menu on the left. Inside the Event Table pane select Define Event and add the following events.

After that you can configure all events inside the Event Table window. These events are triggered later when a button is pressed.

Page 12: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 3 GHC Project

an-mb86r03-controlpanel-rev0-02 - 12 - © Fujitsu Microelectronics Europe GmbH Internal

By clicking inside the User code column you can enter your own code. In this example we call an external function called ctrl_led1. You can define the function inside your main application outside of GHC. This function controls the on-board LED and the virtual LED inside the GUI.

Page 13: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 3 GHC Project

© Fujitsu Microelectronics Europe GmbH - 13 - an-mb86r03-controlpanel-rev0-02 Internal

3.8 Configure buttons

Double click on an image you need to define as a button.

Drag and drop the corresponding on state image from the Image Library into the upper window from the Image list pane.

After that, switch back to the General pane and change the Characteristic to Button.

Page 14: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 3 GHC Project

an-mb86r03-controlpanel-rev0-02 - 14 - © Fujitsu Microelectronics Europe GmbH Internal

By clicking Details beside the Button checkbox you can configure the behaviour. First of all you must define the Button Type by pressing Define Button Type. We need a two state button type as shown below.

Page 15: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 3 GHC Project

© Fujitsu Microelectronics Europe GmbH - 15 - an-mb86r03-controlpanel-rev0-02 Internal

Select the new defined Button inside the Button Type combo box. Configure the Trigger Event by selecting the appropriate event we defined before inside the FlowDesignTable.

Page 16: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 3 GHC Project

an-mb86r03-controlpanel-rev0-02 - 16 - © Fujitsu Microelectronics Europe GmbH Internal

Select as Detection Type Rectangle. You can define the Detection Area in more detail by pressing into the Detection Area column. Select a new colour to make the detection rectangle visible. You can then easily modify the size by clicking and moving the rectangle.

Define all remaining buttons with the same method. The virtual LED Characteristic is defined as Dynamic instead of Button.

3.9 Define Fonts

Right click on the Font folder and select New Font.

Page 17: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 3 GHC Project

© Fujitsu Microelectronics Europe GmbH - 17 - an-mb86r03-controlpanel-rev0-02 Internal

Define and add all fonts you need in your project.

To dynamically change the text in our application we must select Full Character Set. Otherwise we can only use the characters already used inside the GHC text fields.

Page 18: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 3 GHC Project

an-mb86r03-controlpanel-rev0-02 - 18 - © Fujitsu Microelectronics Europe GmbH Internal

3.10 Add text fields

Select the Draw Text List symbol inside the top menu. You can now draw a text field and configure it by a double click.

Configure the default Text, font and colour.

Page 19: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 3 GHC Project

© Fujitsu Microelectronics Europe GmbH - 19 - an-mb86r03-controlpanel-rev0-02 Internal

Select an adequate name for the text field. This name is later used inside the user code.

User Code:

Page 20: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 3 GHC Project

an-mb86r03-controlpanel-rev0-02 - 20 - © Fujitsu Microelectronics Europe GmbH Internal

The current value from the variable meassure_val is shown inside the Control Panel.

3.11 Finished project

Press F7 or View->PagePreviewWindow inside the top menu for a preview window.

Page 21: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 3 GHC Project

© Fujitsu Microelectronics Europe GmbH - 21 - an-mb86r03-controlpanel-rev0-02 Internal

Furthermore you can start the simulator to see if the buttons are changing their states. Double click the “FlowDesignTable1” and select the “Simulator” button.

3.12 Compile project

To compile the project you must select Compile->Resources on the top menu. Inside the following menu just press the “ok” button to generate the GHC files. They are then saved into the folder GHC\GHCV2_Project\GenCode.

Note:

If you are using the IAR Embedded Workbench 5.5 version you must add the compiler option “-g0” (see image below). Otherwise you will get an error when downloading the program. This limitation will be fixed in the next IAR release.

The compiler option is currently not saved and you must add them before each compilation process. This limitation will be fixed in the next GHC release.

Page 22: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 4 IAR Project

an-mb86r03-controlpanel-rev0-02 - 22 - © Fujitsu Microelectronics Europe GmbH Internal

4 IAR Project

If you are new to the IAR toolchain we recommend to first start with the example included inside the IAR workbench.

4.1 Initialize Hardware

The control panel uses several peripherals which must be first configured. The hardware is initialized within the function init_hw inside the main.c file.

� The control panel uses GPIOs to toggle the on board LEDs. If you press the virtual LED buttons inside the control panel the on board LEDs are also triggered.

� The i2c unit is necessary to communicate with the external touch panel controller. The application can be controlled by pressing the display touch panel.

� The displayed voltage is read in with the ADC module. Please see the SK-86R03 Jade Eval Board description for more details on the ADC connection.

� The PWM is used to control the display brightness.

GDC Interrupt

It is necessary in every GHC project to configure the graphics interrupt.

The interrupt service routine is defined within the GHC library.

4.2 Functions called within GHC

Several functions are called within GHC. The functions are defined inside the control_panel.c file.

� Ctrl_ledX functions toggle the on board LEDs

� Ctrl_backlight controls the display brightness

� All other functions only change the virtual button and LED state

4.3 Main GHC application

The GHC application can be started with the following commands:

1. Load the project with GhcProject_load(dGhc_MemoryPoolSize, dGhc_displayListMemorySize)

2. Setup the timers with GhcProject_setTimer(GhcTimer_start, GhcTimer_stop, GhcTimer_isTimeUp, GhcTimer_reload)

3. Set first startup action which is defined inside GHC with GhcProject_setStartupAction()

4. Run the first action with GhcProject_RunAction();

Page 23: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Chapter 4 IAR Project

© Fujitsu Microelectronics Europe GmbH - 23 - an-mb86r03-controlpanel-rev0-02 Internal

5. Remain in main loop and check if the touch panel is pressed. If yes, call the GhcProject_behaviorHandler() to inform GHC about the event.

4.4 Compile and start the application

On top of the workspace you can select “Debug xRAM” for the version running out of RAM or “Debug NOR Flash” to execute the program out of Flash.

1. Compile and link the application by pressing the “compile” button

2. Download the program by pressing the “Download and Debug” button

3. Run the application by pressing the “Go” button

4. You can control the application by pressing the touch panel

Page 24: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Appendix

an-mb86r03-controlpanel-rev0-02 - 24 - © Fujitsu Microelectronics Europe GmbH Internal

Appendix

Troubleshooting

Problem Solution You can’t see the control panel on the display. However, the display seems to work.

This could be a problem with the touch panel connection. The application stuck if it gets no values from the touch controller. Check if the display is connected properly. See the SK-86R03 Jade Eval Board user guide for more details.

Image can’t be downloaded within IAR Add the “-g0” compile option if you are using IAR Embedded Workbench Version 5.5 See chapter “Compile project” for more details

Page 25: GRAPHICS CONTROLLERS CONTROL PANEL DEMO€¦ · 3.10 Add text fields ... After installing the GHC V2, you may logout the administrator account and run GHC V2 with user account 2.3

Worldwide Headquarters and Disclaimer

© Fujitsu Microelectronics Europe GmbH - 25 - an-mb86r03-controlpanel-rev0-02 Internal

Worldwide Headquarters and Disclaimer

Japan

Tel: +81 3 5322 3353

Fax: +81 3 5322 3386

Fujitsu Limited Shinjuku Dai-Ichi Seimei Bldg. 2-7-1, Nishi-shinjuku Shinjuku-ku, Tokyo 163-0721 Japan

Asia Pacific

Tel: +65 281 0770

Fax: +65 281 0220

Fujitsu Microelectronics Asia Ltd 151 Lorong Chauan New Tech Park #05-08 Singapore 556741

http://www.fujitsu.com http://www.fujitsu.com/sg/

USA

Tel: +1 408 737-5600

Fax: +1 408 737-5999

Fujitsu Microelectronics America Inc. 1250 E. Arques Avenue, M/S 333, Sunnyvale, CA USA 94088-3470 Customer Response Center Mon-Fri 7am-5pm (PST)

Europe

Tel: +49 6103 6900

Fax:+49 6103 690122

Fujitsu Microelectronics Europe GmbH Pittlerstrasse 47 D-63225 Langen Germany

http://www.fujitsu.com/us/services/edevices/microelectronics/

http://www.fujitsu.com/emea/services/microelectronics/

The contents of this document are subject to change without notice. Customers are advised to consult with FUJITSU sales representatives before ordering.

The information and circuit diagrams in this document are presented as examples of semiconductor device applications, and are not intended to be incorporated in devices for actual use. Also, FUJITSU is unable to assume responsibility for infringement of any patent rights or other rights of third parties arising from the use of this information or circuit diagrams. No license is granted by implication or otherwise under any patent or patent rights of Fujitsu Microelectronics GmbH.

FUJITSU semiconductor devices are intended for use in standard applications (computers, office automation and other office equipment, industrial, communications and measurement equipment, personal or household devices, etc.).

CAUTION: Customers considering the use of our products in special applications where failure or abnormal operation may directly affect human lives or cause physical injury or property damage, or where extremely high levels of reliability are demanded (such as aerospace systems, atomic energy controls, sea floor repeaters, vehicle operating controls, medical devices for life support, etc.) are requested to consult with FUJITSU sales representatives before such use. The company will not be responsible for damages arising from such use without prior approval.

Any semiconductor devices have inherently a certain rate of failure. You must protect against injury, damage or loss from such failures by incorporating safety design measures into your facility and equipment such as redundancy, fire protection, and prevention of over-current levels and other abnormal operating conditions.

If any products described in this document represent goods or technologies subject to certain restrictions on export under the Foreign Exchange and Foreign Trade Control Law of Japan, the prior authorisation by Japanese government should be required for export of those products from Japan.