Home

Copyright 1995, Jean J. Labrosse, Plantation, FL

image

Contents

1. Flash Memory Common Flash Interfa 0x00800 QxOOFFF SDRAM Controller 0x01000 OxO1FFF System ID Peripheral 0x00000 0x00000 Lancelot VGA Slave port Installed components j e J Bo Master port Add o9 Check amp Move Up V Move Down i epu was generated with full capabilities and must be compiled in Quartus Il with the same license 1 Done checking for updates Ba SI I 1I EIKI Z 0x00000 0x00000 Figure 1 3 Selecting a slave device for the Lancelot core s DMA controller After your Nios II system module with the Lancelot core has been generated you may add the module to your Quartus Il project You should then assign the Lancelot core s input and output ports to the appropriate FPGA pins by consulting the data sheet for your board and the documentation for the Lancelot controller If you encounter problems while compliling your Quartus II project or if you would like a simple design from which to begin designing graphics software utilizing the Lancelot core reference designs for both the Stratix and Cyclone Development Boards are available at www fpga nl uC GUI and the Altera Nios Il Processor 1 03 Adding uC GUI to your Project After your Nios Il system has been properly set up with the Lancelot core beginning to develop with uC GUI is simply a matter of copying the appropriate files into your project folder This section assumes that you hav
2. OSTimeGet to return the time expressed in ticks If wC OS II is not being used this function needs to be modified GUI X Delay uses the uC OS II function OSTimeDlyHMSM to delay the task from which uC GUI functions are called Again if LC OS IlI is not used this function will have to be rewritten 10 pu C GUI and the Altera Nios Il Processor In addition to the two functions declared in Listing 1 2 the functions shown below need to be declared in GUI X c but they can be left empty void void void void void GUI X GUI X I GUI X Init vo ExeclIdle id void Log con GUI X Warn co GUI X I ErrorOut st char s nst char s const char s These empty functions along with the two functions described above should be all that is required for an application running uC OS II and calling uC GUI functions from only one task GUT OS is 0 If you are not running uC OS II or if you wish to call uC GUI functions from multiple tasks GUI X c will need to be modified The uC GUI User s Manual contains further information about modifying GUI X c 11 pu C GUI and the Altera Nios Il Processor 1 05 BASIC HelloWorld c BASIC HelloWorld c which comes with uC GUI is a simple example program that can be used to make sure you have configured everything properly In a multi task environment copy MainTask from the file and add it to your application In a single task environment change
3. the name of MainTask and place it into your application as main You can then build and run your project The video controller should display a screen similar to that shown below Hello world Figure 1 5 BASIC HelloWorld c 12 uC GUI and the Altera Nios Il Processor 1 06 A uC GUI Demo ucgui flash is a flash file that can be programmed onto your Nios development board Stratix edition so that you can view a running demo of many of uC GUI s features In order to view the demo you should first use the nios2 flash programmer utility to program gui_system flash to flash memory on your board The nios2 flash programmer must be run from the Nios Il SDK shell You will need to specify an input file gui system flash the flash base address which should be 0x00800000 and a sof file which is the flash programmer design that will be configured on the FPGA The flash programmer design is included with your development board and can be found in a standard location For example the flash programmer design for the Stratix EP1S10ES Nios development board can be found in the following location nios2kitinstall components altera nios dev board stratix 1s10 es system gui system flash contains the FPGA configuration data for the hardware that the demo will run on After it has been programmed into flash memory ucgui flash can be programmed using the nios2 flash programmer as described above The board s Reset Config button shoul
4. Il Processor 1 04 Configuring uC GUI Configuring uC GUI basically involves modifying three files LCDConf h GUIConf h and GUI X c GUIConf h is a high level configuration file used mainly to enable support for various options such as memory devices It is explained further in the uC GUI User s Manual LCDConf h and GUI X c are dependent on the hardware and implementations of these files for the Nios Il are described in the sections that follow Listing 1 1 LCDConf h ifndef LCDCONF H define LCDCONF H tdefine LCD XSIZE 800 Ef 1 define LCD YSIZE 600 define LCD BITSPERPIXEL 8 2 define LCD CONTROLLER 3200 define LCD ENDIAN BIG 0 define LCD ALLOW NON OPTIMIZED MODE 1 define LCD FIXEDPALETTE 8666 define LCD SWAP RB i define LCD VRAM ADR DispRam 3 define LCD SET LUT ENTRY Pos Color 4 IOWR LANCELOT VGA COLOUR VGA BASE U32 Pos 24 OxOOFFFFFF amp Color define LCD READ MEM Off U32 DisplayRam U32 Off 5 define LCD WRITE MEM Off data U32 DisplayRam U32 Off data define LCD INIT CONTROLLER 6 DispRam U32 alt_uncached_malloc 800 600 IOWR LANCELOT VGA RESET VGA BASE 0x12345678 while IORD LANCELOT VGA STATUS VGA BASE amp OxFFFF0000 0x52470000 IOWR LANCELOT VGA RESOLUTION VGA BASE HORIZONTAL RESOLUTION lt lt 16 VERTICAL RESOLUTION IOWR LANCELOT VGA HORIZONTAL VGA BASE HSYNC PULSE WIDTH lt lt 16 HSYNC BAC
5. K PORCH WIDTH lt lt 8 HSYNC FRONT PORCH WIDTH IOWR LANCELOT VGA VERTICAL VGA BASE VSYNC PULSE WIDTH lt lt 16 VSYNC BACK PORCH WIDTH lt lt 8 VSYNC FRONT PORCH WIDTH IOWR LANCELOT VGA CONTROL VGA BASE LANCELOT VGA CONTROL START VIDEOWN LANCELOT VGA CONTROL SET DAC WN IOWR LANCELOT VGA DMA VGA BASE U32 DispRam amp Ox7FFFFFFF endif L1 1 1 The resolution is set to 800 x 600 The Lancelot VGA video controller also supports resolutions of 640 x 480 and 1024 x 768 L1 1 2 Several definitions are needed to specify the video controller and the color palette that will be used Setting LCD_CONTROLLER to 3200 selects the LCDLin32 c driver which is compatible with the Lancelot controller LCD_FIXEDPALETTE is set to 8666 but this is not the only palette that can be used with the Lancelot controller For descriptions of additional palettes see the uC GUI User s Manual L1 1 3 L1 1 4 L1 1 5 L1 1 6 pu C GUI and the Altera Nios Il Processor LCD VRAM ADR indicates the address where video memory begins Since the Lancelot video controller does not include its own video memory this address will actually be in the memory device that is designated to hold read write data in the project s System Library Properties This should be the same device that was selected as a slave device for the video controller in SOPC Builder LCD SET LUT ENTRY is used by pC GUI to set entr
6. Micrium Copyright 2004 Micrium All Rights reserved uC GUI and the ANDERA Nios TI Soft Core Processor AN 5001 www Micrium com ni ee ee ee ck DO GtUDOOG O Ooc 1 conm o uC GUI and the Altera Nios Il Processor Table of Contents MNOU HON RESET 3 Lancelot VGA Video ControllGt uuun cerita curo rnnt e ruta ren nena ree nena te hnnc 4 Using the Lancelot Core m 5 Add Ball Ts yotir POC ssec mate pex br kae E GER EX HEX bray Exe bue bea kae eee 7 ROT IE e t p eea A AE A TAER 9 BASIC Aello VOTE TS seesi c iraia T iiai 12 PCG GING 12 5 ptas eet eet sd aei Eb seen 13 Miei iUt ANREISE TERT EIE TTE DET 14 ojo 14 uC GUI and the Altera Nios Il Processor 1 00 Introduction uC GUI provides graphics software written in 100 ANSI C that can be used to add a graphical user interface to your Nios II application uC GUI can be used with a single task application or with multi task applications involving either a proprietary operating system or a commercial RTOS such as pC OS II The features available on uC GUI include the following General A clear structure The display size is configurable Characters and bitmaps may be written at any point on the LCD not just on even numbered byte addresses Routines are optimized for both size and speed Complile time switches allow for different optimizations Virtual display support the virtual display can be larger than the actual display Graphic Library Fon
7. ains header files associated with the Widget library Once you have created the suggested folders and added the include search paths you can begin copying the uC GUI files into your project folder As a minimum you will need to copy the following files e All C files of the folder GUI NCore e The fonts that you plan to use in GUI NFont e The LCD driver LCDLin32 c in GUI LCDDriver If you plan to use additional optional modules you must also copy their C files Grayscale converting function all C files located in GUINConvertMono Color conversion functions all C files located in GUI NConvertColor Antialiasing all C files located in GUI NAntiAlias Memory devices all C files located in GUI MemDev Widget library all C files located in GUI Widget Window Manager all C files located in GUI wM Additionally you must copy the hardware dependent file GUI_X c from Sample GUI_X to your Application directory After all of the files have been copied your project should resemble Figure 1 4 below H a Ee E application stf readme txt D C C Project expanded gui demo Binaries Application Config Debug E GUI PPPLPPP PPE ore EL X S X AntiAlias ConvertColor ConvertMono Core Font LCDDriver MemDev MultiLayer Widget WM uC GUI and the Altera Nios Il Processor Figure 1 4 Example project folder pu C GUI and the Altera Nios
8. d then be pressed after which a screen similar to that shown in Figure 1 6 should appear Subsequent screens will display additional examples of uC GUI s capabilities for ded app OTS RYA Nios Il Compiled Oct 112004 16 06 40 Version of uC GUI 3 90a GUI OS JOS II Figure 1 6 uwC GUI demo title screen 13 uC GUI and the Altera Nios Il Processor uC GUI is licensed on a per end product basis Specifically each different product that embeds uC GUI in a commercial product requires a different license A license allows you to manufacture an unlimited number of units of the product that embeds p C GUI for the life of that product In other words a uC GUI license is royalty free Contact Micrium for pricing information Contacts Micrium 949 Crestview Circle Weston FL 33327 USA 1 954 217 2036 1 954 217 2037 FAX e mail uC GUI Micrium com WEB www Micrium com
9. e purchased the uC GUI package from Micrium contact Micrium for pricing p C GUI is provided in source code form and is thus compiled along with your application software You should place all of the files in three main folders within the project folder this structure supports a consistent and easily maintainable environment Also since uC GUI is shipped with this same directory structure files can easily be copied from the appropriate uC GUI folder to the folder within your project directory with the same name The three folders that your project should have are Application This folder holds all of the files associated with your uC GUI application Config This folder holds the configuration files for uC GUI GUI This is where all of the uC GUI program files are located Because of this directory structure you will need to specify some additional include search paths that will be used by the compiler during the build process Include search paths can be added by right clicking your project folder and selecting Properties You can then select C C Build and use the New button to add paths Assuming that you have organized your project as described above the following paths should be added Config This is where the nC GUI configuration header files are located GUI Core This folder contains general uC GUI header files GUI WM This folder contains header files associated with the Window Manager GUI Widget This folder cont
10. erve as a slave device for the core s DMA controller Select the desired device by clicking next to its name under the vga avalon column so that a darkened circle appears Altera SOPC Builder nios File System Module View Tools Help and the Altera Nios Il Processor System Contents More cpu Settings System Generation EP1S40 Hios Developme EP20K200E Nios Develop Ethernet CS8900 Interface 9 LANS1c111 Interfa OpenCores 10 100 i Extra Utilities Performance Count IZi Lancelot Lancelot VGA Legacy Components Active Serial Memo Legacy AMD 29L V Legacy IDT71V416 Legacy On Chip Me Target ios Development Board Stratix EP1S10ES Target Device Fatr cpu instruction master avalon cpu data master avalon y trati 7 System Clock Frequency 50 tri state bridge avalon tristate vga avalon Module Name El cpu Description Nios Il Processor Altera Corporation instruction master Master port data master Master port jtag debug module Eltri state bridge Slave port Avalon Tri State Bridge Ox00000 avalon slave Slave port tristate master Master port Memory AMD 29L v800 Flas EPCS Serial Flash 6 Flash Memory Con n jtag uart sram flash sdram sysid vga vga avalon slave vga avalon master JTAG UART 0x00000 0x00000 IDT 71 416 SRAM 0x00100 OxO01FF
11. ies in the Lancelot video controller s color table Entries in the color table are modified with TOWR LANCELOT VGA COLOUR which is defined in the file 1ancelot vga regs h that is included with the Lancelot component Z CD_READ_MEM and LCD WRITE memory EM specify how to read to and write from the video LCD INIT CONTROLLER prepares the video controller to begin reading video data This routine actually allocates the space that will be used for video memory The routine also sets up the resolution and timing registers on the Lancelot video controller The documentation for the controller describes appropriate values for constants like HORIZONTAL RESOLUTION and VSYNC PULSE WIDTH Listing 1 2 GUI X c include includes h if E volatile int OS TimeMS int GUI X GetTime void 2 int ticks ticks OSTimeGet OS_TimeMS ticks return ticks void GUI_X_Delay int ms 3 ms ms 10 OSTimeDlyHMSM 0 0 0 ms L1 2 1 L1 2 2 L1 2 3 includes h is a master include file that is usually used in UC OS II applications It should include any files needed by your application For uC GUI applications includes h should include GUI h If you are not using uC OS II or if you choose not to place GUI h in includes h you must manually include GUI h in all of your application files GUI X GetTime uses the uC OS II function
12. ra Nios Il Processor 1 01 Lancelot VGA Video Controller uC GUI can be used on the Altera Nios Il Development Boards with the Lancelot VGA video controller This peripheral consists of the Lancelot core which can easily be added to an SOPC Builder generated system along with an add on daughter board that can be attached to the expansion prototype connectors on the boards Figure 1 1 The Lancelot VGA video controller daughter board uC GUI and the Altera Nios Il Processor 1 02 Using the Lancelot Core The Lancelot core can be added to a Nios II system in SOPC Builder simply select the core from the list of Avalon Modules as shown in Figure 1 2 below Ethernet 4 CS8900 Interface LAN91c111 Interfa i OpenCores 10 100 Extra Utilities Performance Count Lancelot Legacy Components 6 Active Serial Memo i Legacy AMD 29LV Legacy IDT71V416 Legacy On Chip Me i Memory AMD 29LV800 Flas i lt j 1d 2j Installed components j e Vj o Add Q check Figure 1 2 Adding the Lancelot core to your system After the core has been added and it appears in the list of modules included in your system you must select the memory device from which the core s DMA controller will gather video data In order to specify a memory device you should select Show Master Connections from the View menu This will allow you to specify which module will s
13. ts Bitmaps of different color depths are supported A bitmap converter is available Absolutely no floating point usage Fast line point drawing without floating point usage Very fast drawing of circles polygons Different drawing modes A variety of different fonts are shipped with the basic software 4x6 6x8 6x9 8x8 8x9 8x16 8x17 8x18 24x32 and proportional fonts with pixel heights of 8 10 13 16 New fonts can be defined and simply linked in Only the fonts used by the application are actually linked to the resulting executable so there is minimum ROM usage Fonts are fully scalable separately in X and Y A font converter is available any font available on your host system i e Microsoft Windows can be converted String Value Output Routines Routines to show values in decimal binary or hexadecimal and in any font Routines to edit values in decimal binary or hexadecimal and in any font Window Manager WM Complete window management including clipping overwriting of areas outside a window s client area is impossible Windows can be moved and resized Callback routines are supported usage is optional WM uses minimum RAM app 20 bytes per window Optional Widgets for PC Look and Feel Widgets window objects also known as controls are available They generally operate automatically and are simple to use PC tools Simulation plus viewer Bitmap converter Font converter uC GUI and the Alte

Download Pdf Manuals

image

Related Search

Related Contents

Installation Instructions  Automated Irrigation System Using SCADA  Geared Motors for Trolley Drive Systems / Operating Instructions  02-053 - Honda  ST7MDTU2-EMU2B HDS2 series emulator user manual - Digi-Key    Steuerung E1T  Samsung S22A200B Korisničko uputstvo  Samsung 2053BW Priručnik za korisnike  

Copyright © All rights reserved.
Failed to retrieve file