Table of Contents

Advertisement

Quick Links

phyCORE-P87C591
QuickStart Instructions
Using PHYTEC FlashTools98 for Windows and the Raisonance
Integrated Development Environment (RIDE)
for 8051 and XA Demo Version
Note: The PHYTEC Spectrum CD includes the electronic version of
the English phyCORE-P8xC591 Hardware Manual
Hinweis: Die PHYTEC Spektrum CD beinhaltet die elektronische
Version des deutschen phyCORE-P8xC591 Hardware Manuals
Edition: July 2002
A product of a PHYTEC Technology Holding company

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the phyCORE-P87C591 and is the answer not in the manual?

Questions and answers

Summary of Contents for Phytec phyCORE-P87C591

  • Page 1 Using PHYTEC FlashTools98 for Windows and the Raisonance Integrated Development Environment (RIDE) for 8051 and XA Demo Version Note: The PHYTEC Spectrum CD includes the electronic version of the English phyCORE-P8xC591 Hardware Manual Hinweis: Die PHYTEC Spektrum CD beinhaltet die elektronische...
  • Page 2 PHYTEC Meßtechnik GmbH neither gives any guarantee nor accepts any liability whatsoever for consequential damages resulting from the use of this manual or its associated product. PHYTEC Meßtechnik GmbH reserves the right to alter the information contained herein without prior notification and accepts no responsibility for any damages which might result.
  • Page 3: Table Of Contents

    1.5 The Raisonance Integrated Development Environment (RIDE) for 51+XA..........7 Getting Started...................11 2.1 Installing Rapid Development Kit Software.......11 2.2 Interfacing the phyCORE-P87C591 to a Host-PC .....18 2.3 Starting PHYTEC FlashTools98 for Windows ......20 2.4 Downloading Example Code with FlashTools ......21 2.4.1 "Blinky"...
  • Page 4 5.1 FlashTools98 ................75 5.2 Linking and Locating ..............77 Index of Figures Figure 1: Mounting the phyCORE-P87C591 onto the phyCORE Development Board LD 5V ........18 Figure 2: Important Connectors, Buttons and Suitable Jumper Settings on the phyCORE Development Board LD 5V ......19 Figure 3: Power Connector ................
  • Page 5: Introduction To The Rapid Development Kit

    User's Manuals and Data Sheets • this QuickStart Instruction with general “Rapid Development Kit” description, software installation hints and three example programs enabling quick out-of-the box start-up of the phyCORE-P87C591 in conjunction with the Raisonance Integrated Development Environment (RIDE) for 51+XA ©...
  • Page 6: Overview Of This Quickstart Instruction

    The "Getting Started" section uses two example programs: "Hello" and "Blinky" to demonstrate the download of user code to the Flash device using PHYTEC FlashTools98 for Windows. The "Getting More Involved" section provides step-by-step instructions on how to modify both examples, create and build...
  • Page 7: System Requirements

    Introduction 1.3 System Requirements Use of this “Rapid Development Kit” requires: • the phyCORE-P87C591 SBC module • the phyCORE Development Board LD 5V with the included DB-9 serial cable and AC adapter supplying 5 VDC /min. 500 mA • the PHYTEC Spectrum CD •...
  • Page 8: The Phytec Phycore-P87C591

    All applicable data/address lines and applicable signals extend from the underlying logic devices to standard-width (2.54 mm /0.10 in.) pin headers lining the circuit board edges. This enables the phyCORE-P87C591 to be plugged like a “big chip” into target hardware. The standard memory configuration of the phyCORE-P87C591...
  • Page 9 • 6-channel on-chip A/D converter with 10-bit resolution • three Chip Select signals for connection to external peripherals • requires only a +5 V/250 mA power source • operates temperature range 0... 70°C (optional -40... 85°C temperature range available) © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 10 • simple jumper configuration allowing phyCORE Development Board LD 5V with various PHYTEC phyCORE SBC’s • one control LED D3 for quick testing of user software • 2 x 160-pin Molex connector (X2) enabling easy connectivity to expansion boards (e.g. PHYTEC GPIO Expansion Board) ©...
  • Page 11: The Raisonance Integrated Development Environment (Ride) For 51+Xa

    The OMF-to-HEX utility converts a Raisonance .aof format file into an Intel hexfile that is suitable for programming into the external Flash on the PHYTEC phyCORE-P87C591 target board. The Raisonance tool chain consists of the following tools; all integrated in RIDE: •...
  • Page 12 The Raisonance RC51 compiler provides the fastest and smallest code using industry benchmarks. The Getting Started Guide from Raisonance provides more information on these tools. It also includes an introduction on ‘Migrating from the 8051 to the XA’. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 13 All the debugging functions are enabled in the demo version with the same restrictions in manipulable code size as follows: • 4 kByte for the 8051, • 8 kByte for the XA (Page Zero mode only). © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 14 QuickStart Instructions © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 15: Getting Started

    • downloading example user code in Intel hexfile format from a host-PC to the external Flash memory using FlashTools98 2.1 Installing Rapid Development Kit Software • Insert the PHYTEC Spectrum CD into the CD-ROM drive of your host-PC. The PHYTEC Spectrum CD should automatically launch a setup program that installs the software required for the Rapid Development Kit as specified by the user.
  • Page 16 If you decide to individually choose different paths and/or drives you must consider this for all further file and path statements. We recommend that you accept the default destination location. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 17 All Kit-specific content will be installed to a Kit-specific subfolder of the Rapid Development Kit root folder that you have specified at the beginning of the installation process. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 18 QuickStart Instructions All software and tools for this phyCORE-P87C591 RDK will be installed to the \PHYBasic folder on your hard drive. • In the next dialog you must choose whether to copy the selected documentation as *.pdf files to your hard drive or to install a link to the file on the Spectrum CD.
  • Page 19 Raisonance tool chain. The default location is C:\Ride. If installing a different software development tool chain, please refer to the applicable version of the QuickStart manual. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 20 Acrobat Reader. The applicable FlashTools software must be installed to ensure successful completion of this QuickStart Instruction. Failure to install the proper software could lead to possible version conflicts, resulting in functional problems. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 21 Getting Started • Decide if you want to begin the QuickStart Instruction immediately by selecting the appropriate checkbox and click on Finish to complete the installation. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 22: Interfacing The Phycore-P87C591 To A Host-Pc

    QuickStart Instructions 2.2 Interfacing the phyCORE-P87C591 to a Host-PC Connecting phyCORE-P87C591, mounted phyCORE Development Board LD 5V, to your computer is simple: • As shown in the figure below, if the phyCORE module is not already preinstalled, mount it pins-down onto the Development Board’s receptacle footprint (X6).
  • Page 23: Figure 2: Important Connectors, Buttons And Suitable Jumper Settings On The Phycore Development Board Ld 5V

    Power Connector • Simultaneously press the Reset (S2) and Boot (S1) buttons on the phyCORE Development Board LD 5V, first releasing the Reset and then, two or three seconds later, release the Boot button. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 24: Starting Phytec Flashtools98 For Windows

    PHYTEC Spectrum CD. FlashTools98 for Windows is a utility program that allows download of user code in Intel *.hex file format from a host-PC to a PHYTEC SBC via an RS-232 connection. FlashTools98 consists of firmware resident in the external Flash and corresponding software installed on the host-PC.
  • Page 25: Downloading Example Code With Flashtools

    • Choose the correct serial port for your host-PC and a 9,600 baud rate. Note: Always ensure that the phyCORE-P87C591 is in Flash programming mode before pressing the Connect button. • Click the Connect button to establish connection to the target hardware.
  • Page 26 The number of banks shown on the Bank Utilities tabsheet varies depending on the size and type of the Flash mounted on the phyCORE-P87C591. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 27 Communication Setup allows selection of the serial port and speed before the communication is initialized, or to disconnect the ongoing communication: The appearance of the Flash Information tabsheet varies depending on the size and type of the Flash mounted on the phyCORE-P87C591. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 28 QuickStart Instructions File Download downloads specified hexfiles to the target hardware: Protected Areas Information shows protected areas of Flash memory: © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 29: Blinky

    • Next choose the File Download tab and click on the File Open button. The appearance of the Sector Utilities tabsheet varies depending on the size and type of the Flash mounted on the phyCORE-P87C591. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 30 QuickStart Instructions The hexfile has already been installed to your hard drive during the installation procedure. • Browse to the correct drive and path for the phyCORE-P87C591 Demo folder (default location C:\PHYBasic\pC-P87C591\Demos\Raisonance\Blinky\Blinky.hex) and click Open. • Click on the Download button. You can watch the status of the download of the Blinky.hex into the external Flash memory in the...
  • Page 31: Hello

    • Wait until the status check in the lower left corner of the FlashTools98 tabsheet finishes, returning connection properties description to the lower left corner of the window. • Next choose the File Download tab and click on the File Open button. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 32 QuickStart Instructions The demo hexfile has already been installed to your hard drive during the installation procedure. • Browse to the correct drive and path for the phyCORE-P87C591 Demo folder (default location C:\PHYBasic\pC-P87C591\Demos\Raisonance\Hello\Hello.hex ) and click Open. • Click on the Download button. You can watch the status of the download of the Hello.hex into the external Flash memory in the...
  • Page 33 • Next click on OK. This creates a new HyperTerminal session named “COM Direct” and advances you to the next HyperTerminal window. The HyperTerminal window has a different appearance for different versions of Windows. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 34 (COM1/COM2 Properties). • Then set the following COM parameters: Bits per second = 9600; Data bits = 8; Parity = None; Stop Bits = 1; Flow Control = None. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 35 Hello.hex file loaded into the Flash. • Now push the <Space> bar on your keyboard once to start the automatic baud rate detection on phyCORE-P87C591 module. • Successful execution will send the character string "Hello World" from the target hardware to the HyperTerminal window.
  • Page 36 QuickStart Instructions © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 37: Getting More Involved

    51+XA demo software should have been installed during the install procedure, as described in section 2.1. You can also manually install the tool chain by executing install.exe from within the \Software\Raisonance folder of your PHYTEC Spectrum CD. Note: It is necessary to use the Raisonance tool chain provided on the accompanying Spectrum CD in order to complete this QuickStart Instructions successfully.
  • Page 38: Creating A New Project And Adding An Existing Source File

    RIDE, close it by selecting the Project menu and Close the project. • To create a new project file open the Project menu and choose New within the RIDE menu bar. The window as shown below appears. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 39 • In the text field ‘File name’, enter the file name of the project you are creating. For this example, enter the name Blinky2. • Click on Open. • Click on OK in the New Project window. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 40 QuickStart Instructions • The following window will appear: • From here, you will be able to add various files to your project. • Open the Project menu and choose Add node Source/Application. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 41 At this point you have created a project called blinky2.prj and added an existing C source file called blinky2.c. The next step is to modify the C source before building your project. This includes compiling, linking, locating and creating the hexfile. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 42: Modifying The Source Code

    /* call wait function /* end of while(1) /* EOF This will change the LED on/off ratio. 3.4 Saving the Modifications • Save the modified file by choosing File|Save or by clicking the Save icon © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 43: Setting Tool Chain Options

    To configure the Target: • Open the Options|Target menu and select the 8xC591 as shown below: • Click on OK to save the configuration. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 44 • Select the Large memory model and activate the checkbox Component with XRAM under Special features and keep the other RC51 options at their default settings. • Click on OK to save these settings. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 45 • All others options are correct to run our first example. Click on OK to save the configurations. The linker/locator options are now suitable for the Blinky2 project, enabling you to build an absolute object file (*.aof) and a hexfile. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 46: Building The Project

    • If a list of errors appears, double-click on the error to open the file and locate the error. Use the editor to correct the error(s) in the source code and (re-)build the project. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 47: Downloading The Output File

    • Next choose the File Download tab and click on the File Open button. • Browse to the correct drive and path for the phyCORE-P87C591 Demo folder (default location C:\PHYBasic\pC-P87C591\Demos\Raisonance\Blinky2\Blinky2.hex and click Open.
  • Page 48: Hello2

    Add Hello2.c and Serinit.c from within the project folder to the project Hello2.prj. • Save the project. At this point you have created a project called Hello2.prj consisting of the C source files Hello2.c and Serinit.c. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 49: Modifying The Example Source

    (re-)build the project. If there are no errors, the code is assembled and linked and the executable code is ready to be downloaded to the board. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 50: Downloading The Output File

    • Next choose the File Download tab and click on the File Open button. • Browse to the correct drive and path for the phyCORE-P87C591 demo folder (default location C:\PHYBasic\pC-P87C591\Demos\Raisonance\Hello2\Hello2.hex directory (default location).
  • Page 51: Starting The Terminal Emulation Program

    Hello2.hex file loaded into the Flash. • Now push the <Space> bar on your keyboard once to start the automatic baud rate detection on phyCORE-P87C591 module. • Successful execution will send the modified character string "PHYTEC... Stick It In!" to the HyperTerminal window.
  • Page 52 QuickStart Instructions © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 53: Debugging

    Do not use these resources when developing an application program to be debugged using the ROM monitor interface. Before using the ROM monitor interface, a special *.hex file (the monitor loader firmware) must be downloaded to the target hardware. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 54: Preparing The Target Hardware To Communicate With Rom Monitor

    Tools folder C:\PHYBasic\pC-P87C591\Tools\Raisonance\Loader (default location). The PHYTEC Spectrum CD-ROM also contains the loadxa.hex monitor file. This version is made for XA-compatible phyCORE modules. Please refer to readme files within the Loader directory for details. • Click on the Download button and view the download procedure in the status window.
  • Page 55: Creating A Debug Project And Preparing The Debugger

    Add Debug.c and Serinit.c from within the project folder to the project Debug.prj. • Save the project. At this point you have created a project called Debug.prj, consisting of two C source files called Debug.c and Serinit.c. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 56: Setting Options For Target

    Here, in contrast to the Harvard architecture, access to CODE and XDATA space is directed towards the same physical memory device, normally RAM. With this von Neumann memory architecture, it is now possible to change the application program during runtime. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 57: Figure 4: Memory Model For Use With The Raisonance Monitor (64 Kbyte Ram)

    CODE and XDATA areas within the application program do not overlap. This is important because otherwise portions of the program (CODE) will be overwritten by e.g. variables (XDATA), resulting in an error when executing user code. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 58 • Open the Options|Target menu, select the 8xC591 and a Von Neumann architecture as shown below: • Click on OK to save the configuration. • Open the Options|Project|RC51 menu and choose Defines. Add MONITOR51 in the Defines input field. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 59 • Select the Large memory model. Disable the checkbox Component with XRAM under Special features. This is necessary because the XRAM portion can not be accessed as von Neumann memory architecture. • Click on OK to save these settings. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 60 • In the Options|Project|RC51 menu, now choose Optimizer. • Select the Optimizer level 1 as shown below. This is necessary because the created Debug.aof file can be better debugged when the C file is compiled with this optimization level. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 61 This option should be enabled by default. The memory ranges for off-chip CODE and off-chip XDATA memory are configured to fit within the von Neuman memory space as configured by the the Raisonance load51.hex monitor file (refer to Figure 4). © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 62 • The linker/locator options are now suitable for the Debug project, enabling you to build an absolute object file (*.aof). • Click on the ‘Make All’ Command icon from RIDE toolbar or open the Project menu and select Build All or Make All. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 63: Preparing The Debugger

    Select the correct COM port and baud rate in both the Loading Port and the Communication Port menus as shown in the screen capture on the following page. Make sure XEVA is selected as Loader protocol. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 64 FC00H and FFFFH. These memory areas can not be used by the application code. • Click on the OK button to exit the ROM-Monitor Options window. • The Debug Options window will appear. • Click on the OK button again. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 65: Starting The Debugger

    You will see a blue status bar from left to right within each window indicating the progress of these steps. If a problem occurs during data transfer, the following window will appear: © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 66 Start debug.aof in the Debug menu. • If the data transfer was successful, the following window will appear: • Click on OK to continue. • The RIDE debug environment is now connecting to the ROM- Monitor. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 67 You can open inactive windows by choosing the desired window from the View pull-down menu. • The debugger will automatically run to the ‘main’ function and stop. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 68: Raisonance Debug Features

    Clicking the Go icon runs the program without active debug functions. To stop program execution at a desired point, a breakpoint can be placed before the Go icon is clicked. The Stop icon interrupts and stops the running program at an undetermined location. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 69: Using The Raisonance Debug Features

    • Right-click on the constant rhythm and select Add Watch in the pop-up window. You may also use the <F6> function key to enable the Add Watch window. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 70: Run To

    "rhythm[]". 4.6.2 Run to ... • The Run to... command executes the program until it reaches the code line where the cursor is currently located. Go with the cursor to the code line led(1);. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 71 Run to... in the Debug menu. • The Debugger executes the program until it reaches the code line where the cursor is currently located. This code line is now highlighted in blue color as shown below: © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 72: Step Into And Step Over

    Watch window after the first step over command. • Notice that the LED (D3) on the Development Board illuminates after the third time you clicked on the Step Over icon. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 73: Breakpoints

    • Click on the green icon in front of the code line if(blink >...) to set a breakpoint here. • The red marker on the left-hand side of the selected line indicates the breakpoint. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 74 • Notice that the LED (D3) on the Development Board now goes off. This is because the led(0) function call has been executed. • Also notice that the variable blink in the Watch window has changed its value to ‘1(0x1)’. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 75 • Repeat clicking on the Go icon and watch the variable blink and the LED D3 on the Development Board. • Click on red marker on the left-hand side of the selected code line to remove the breakpoint. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 76: Running, Stopping And Resetting

    • Click on the Go icon. The LED now blinks with alternating on and off durations. • To exit the current debug session go to the Debug menu and click on Terminate debug.aof. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 77: Changing Target Settings For The "Final Version

    After successfully debugging the program, next change the target settings in order to create an Intel hexfile. This can then be downloaded to the Flash memory of the phyCORE-P87C591. • Open the Options|Target menu and select the Harvard architecture as shown below: •...
  • Page 78 Start the HyperTerminal program and push the <Space> bar as described in section 2.4.2. This starts the automatic baud rate detection. Now you can watch your final debug example execute. © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 79: Advanced User Information

    FlashTools98 allows the download of user code from the host-PC into the Flash. Additionally, the re-programmable Flash device on the phyCORE-P87C591 allows you to easily update your own code and the target application in which the phyCORE-P87C591 has been implemented.
  • Page 80 QuickStart Instructions The following description is valid only for the FlashTools98 included with the phyCORE-P87C591 and is not intended as a guideline for using any other program. FlashTools98 incorporates a safety mechanism that ensures that the system bank (bank 0), in which the firmware is resident, can not be overwritten during programming of the available user banks of the Flash device.
  • Page 81: Linking And Locating

    To ensure proper execution of your application, it is required that all XDATA segments are located to the external RAM of the phyCORE-P87C591 and that all CODE segments are located to the external Flash memory of the phyCORE-P87C591. Exceptions may occur if you use a 8051 derivative with on-chip portions of XDATA (e.g.
  • Page 82 For instance all XDATA segments should end below 0x7FFF if a 32 kByte RAM device mounted on the phyCORE-P87C591. We recommend generation of a *.m51 map file for your project and inspection of the memory map information within this file.
  • Page 83 How would you improve this manual? Did you find any mistakes in this manual? page Submitted by: Customer number: Name: Company: Address: Return to: PHYTEC Technologie Holding AG Postfach 100403 D-55135 Mainz, Germany Fax : +49 (6131) 9221-33 © PHYTEC Meßtechnik GmbH 2002 L-586e_2...
  • Page 84 Published by © PHYTEC Meßtechnik GmbH 2002 Ordering No. L-586e_2 Printed in Germany...

Table of Contents