Application note v4.04 Using Keil uVision2/3/4 simulator with DCD's 8051 IP Cores 1. Overview ______________________________________________________________2 2. Supplied files ___________________________________________________________2 3. Installation _____________________________________________________________2 4. Preparing to work with uVision2/3/4 interface ________________________________3 5. Simulating an example project _____________________________________________4 6. User configurable SFR view Window ________________________________________6 7. References ____________________________________________________________10 8. Contacts ______________________________________________________________10 Copyright© 1999‐2011 DCD – Digital Core Design. All Rights Reserved All trademarks mentioned in this document are trademarks of their respective owners. Application note v4.04 1. OVERVIEW All of the DCD's 8051/80390 IP Cores are now supported by Keil uVision2/uVision3 AGSI interface. It al‐ lows Keil software users to work within uVision2/uVision3 environments without switching between Keil compiler and external DoCD software. Everything ‐ compilation, simulation, debugging ‐ is under control of a single application. This document describes how to install and use DCD's 8051/80390 simulation driver with programs written using Keil C/ASM tools. 2. SUPPLIED FILES Delivered package contains a complete set of files, needed to run DCD's 8051/80390 IP Cores inside uVision2/uVision3 IDE. The following directories can be found inside package: .\C51\BIN\ : Contains DCD's simulation DLL files .\C51\INC\DCD\ : Contains DCD's 8051/80390 include files .\C51\EXAMPLES\DCDsim\ : Contains example C/ASM 8051 application .\DATASHTS\DCD\ : Contains DCD's 8051/80390 related PDF files .\UV2\ : Contains DCD's 8051/80390 uVision2/uVision3 database This package is delivered to all existing DCD's customers. You may also order the DoCD FPGA evaluation [email protected] , and receive complete debug system to start working with our kit by emailing us directly [email protected] 8051/80390 IP Cores. 3. INSTALLATION Manual installation of DCD peripherals driver is no longer required, because package is delivered as ex‐ ecutable program, and all steps are performed automatically by setup program. The description provided below is left for informational purposes. In order to use DCD peripherals driver follow the steps: ● ● Install uVision2/uVision3 and the C51 Compiler on your machine. You may try to use evaluation version of http://www.keil.com/demo/eval/c51.htm 8051 Keil software at http://www.keil.com/demo/eval/c51.htm The installed files should appear inside <Keil install path>\C51\BIN, <Keil install path>\UV2 and <Keil in‐ stall path>\C51\EXAMPLES\DCDsim directories The following line should appear in TOOLS.INI file located inside <Keil install path>\ folder: ○ section [UV2]: ● CDB0=UV2\DCD.CDB("Digital Core Design") Note: if CDB0 is already in use, then use the next free digit, for example CDB1 Copyright© 1999‐2011 DCD – Digital Core Design. All Rights Reserved All trademarks mentioned in this document are trademarks of their respective owners. Application note v4.04 4. PREPARING TO WORK WITH UVISION2/3/4 INTERFACE In order to run your application inside uVision simulator using DCD processor follows the steps: ● ● Run µVision2/3/4. Select ‘Project – Open Project’, the Select Project dialog comes up. Select the ‘DCDsim.uv2’ project. It can be found normally in the folder ‐ <Keil install path>\C51\EXAMPLES\DCDsim. Select ‘Options for Target – Devices'. From the 'Database' list‐box, select “Digital Core Design” which is our devices database. Select required microcontroller type you actually have. If everything is right, then the dialog should look like this: ● ● Available peripherals depend on selected CPU. You may select the full set of peripherals using an XP suf‐ fixed CPU. Select ‘Rebuild all target files’ to build the project. Copyright© 1999‐2011 DCD – Digital Core Design. All Rights Reserved All trademarks mentioned in this document are trademarks of their respective owners. Application note v4.04 5. SIMULATING AN EXAMPLE PROJECT This chapter shortly describes how to use uVision C/ASM application with DCD 8051 peripherals driver bas‐ ing on example DCDsim project. It is assumed that the installation and configuration steps had been per‐ formed. Please follow the steps below: ● Run µVision2. Select ‘Project – Open Project’, the Select Project dialog comes up. Select the ‘DCDsim.uv2’ project. It can be found normally in the folder ‐ <Keil install path>\C51\EXAMPLES\DCDsim. The dialog should look like this: ● Select ‘Rebuild all target files’ to build the project. The build window shown above should report no warn‐ ings and errors. ● Start simulation by selecting 'Start/Stop Debug session' Copyright© 1999‐2011 DCD – Digital Core Design. All Rights Reserved All trademarks mentioned in this document are trademarks of their respective owners. Application note v4.04 ● When simulator is properly configured, and program successfully uploaded/downloaded, then the simula‐ tor window should look similarly to picture below: ● At this point simulation process is similar as isn typical uVision2/uVision3 application. The program can be run, halted, executed step by step, breakpoints can be set/cleared. Variables can be watched, memory ar‐ eas read/written/modified. Please refer to uVision users manual. Copyright© 1999‐2011 DCD – Digital Core Design. All Rights Reserved All trademarks mentioned in this document are trademarks of their respective owners. Application note v4.04 6. USER CONFIGURABLE SFR VIEW WINDOW SFR memory contents can be displayed in SFR window. Items are added to this window by use “svc” file (in our case it is “example.svc”). Select “Peripherals” main menu item and click SFR View unit. The SFR View window will be displayed on the screen. Click right mouse button to up‐ load configuration file. Number of configuration files is not limited. In case of DR8051DS chip type, the default SVC file is named DR8051DS.SVC and located in the same directory as its corre‐ sponding DLL. Custom “Load configuration file” option is not available. Copyright© 1999‐2011 DCD – Digital Core Design. All Rights Reserved All trademarks mentioned in this document are trademarks of their respective owners. Application note v4.04 ● The example.svc file includes example set of items which may be displayed on SFR View window. Only one instance of SFR View window is available. Copyright© 1999‐2011 DCD – Digital Core Design. All Rights Reserved All trademarks mentioned in this document are trademarks of their respective owners. Application note v4.04 Content of each writable register can be directly modified by double clicking its value in Value column, and entering required number as decimal, binary (<value>b or B), octal (<value>o or B) or hexadecimal number (0x<value> or <value>h or H). The examples above show methods of definition displayed items. To define type of displayed items the following keywords have been used: ○ ○ ○ [section_name] – name of section ‐ must be unique NAME – name of item which is displayed on SFR view window MODE – definition kind of displaying item (group, byte, bit, bits) ○ GROUP – defines a group of bits ○ BYTE – defines that it is a byte ○ BIT – defines that it is a single bit ○ BITS – defines that it is group of bits. ADDRESS defines LSB bit of group (range 0 to 6), SIZE defines number of consecutive bits in group (range 2 to 7) e.g. Copyright© 1999‐2011 DCD – Digital Core Design. All Rights Reserved All trademarks mentioned in this document are trademarks of their respective owners. Application note v4.04 ○ ○ ○ NAME=GAINSEL MODE=BITS ADDRESS=2 SIZE=2 Defines that GAINSEL[3:2] bits are displayed as a single group. PARENT‐ name of parent’s section. When this parameter is equal “‐1” it means that the item is a top level member. ADDRESS – item address in SFR memory. It can be 8‐bit hexadecimal or decimal value for byte and from 0 to 7 for bit. Range of valid SFR byte addresses is from 0x80 to 0xFF. NOTE – Any text describing a certain bit/register Copyright© 1999‐2011 DCD – Digital Core Design. All Rights Reserved All trademarks mentioned in this document are trademarks of their respective owners. Application note v4.04 7. REFERENCES The DCD peripherals driver package for uVision2/uVision3 AGSI is delivered by DCD free of charge upon customer request. The Keil 8051 uVision2/3/4 tool suite is also required. It can be obtained from Keil GmbH at hhttp://www ttp://www..kkeil.com eil.com . ttp://www.dcd.pl . Please refer to other application DoCD debug system is available at DCD web‐site hhttp://www.dcd.pl notes for more details about its usage. 8. CONTACTS For any questions or comments, please contact DCD. Headquarters: Wroclawska 94 41‐902 Bytom, POLAND [email protected] e‐mail: [email protected] tel. : +48 32 282 82 66 fax : +48 32 282 74 37 Distributors: http://www.dcd.pl/apartn.php Please check http://www.dcd.pl/apartn.php Copyright© 1999‐2011 DCD – Digital Core Design. All Rights Reserved All trademarks mentioned in this document are trademarks of their respective owners.