Page 1
QuickStart Instructions Using PHYTEC FlashTools 3 and the Keil µVision2 Software Evaluation Development Tool Chain Note: The PHYTEC Spectrum CD includes the electronic version of the English phyCORE-XC161 Hardware Manual Edition: July 2003 A product of a PHYTEC Technology Holding company...
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.
1.4 The PHYTEC phyCORE-XC161 ..........4 1.5 The Keil µVision2 Software Development Tool Chain ....7 Getting Started...................11 2.1 Installing Rapid Development Kit Software.......11 2.2 Interfacing the phyCORE-XC161 to a Host-PC......18 2.3 Starting PHYTEC FlashTools 3 ..........20 2.4 Downloading Example Code with FlashTools 3 ......21 2.4.1 "Blinky"...
Page 4
4.5.3 Single Stepping and Watch Window......67 4.6 Running, Stopping and Resetting ..........68 4.7 Resetting the Debugger and the phyCORE-XC161 ....69 4.8 Changing Target Settings for the "Executable Version".... 70 Advanced User Information............. 75 5.1 FlashTools 3 ................75 5.2 Start-pc-XC161.a66..............
Keil µVision2. It is structured as follows: The "Getting Started" section uses two example programs: Blinky and Hello to demonstrate the download of user code to the Flash device using PHYTEC FlashTools 3.
Introduction 1.3 System Requirements Use of this "Rapid Development Kit" requires: • the PHYTEC phyCORE-XC161 • the phyCORE Development Board HD200 2.5V with the included DB-9 serial cable and AC adapter supplying 5 VDC /min. 500 mA • the PHYTEC Spectrum CD •...
Molex SMT pin header connectors (pin width is 0.635 mm/25 mil) lining the circuit board edges. This enables the phyCORE-XC161 to be plugged like a "big chip" into target hardware. The standard module runs at a 40 MHz internal clock speed (delivering 25 ns instruction cycle) and offers 512 kByte (up to 1.5 MByte) SRAM and 256 kByte (up to 2 MByte) Flash on-board for...
Page 10
Single Board Computers. Simple jumper configuration readies Development Board’s connection phyCORE-XC161, which plugs into the receptacle contact strips mounted on the Development Board HD200 2.5V. phyCORE Development Board HD200 2.5V Technical Highlights • Reset signal controlled by push button or RS-232 control line CTS0 •...
OMF166 debugging specification. The Keil OH166 Object-to-Hex converter converts an absolute object file into an Intel hexfile that is suitable for programming into an EPROM device or downloading into external Flash on the PHYTEC phyCORE-XC161 target board. µVision2 consists of the following executables: • C Compiler c166.exe...
Page 13
This allows you to fully evaluate the features and power of Keil products on the PHYTEC target board. The PK full version has no restrictions and is fully ANSI compliant.
Flash memory using FlashTools 3 2.1 Installing Rapid Development Kit Software When you 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 18
XC161CJ QuickStart Instructions All software and tools for this phyCORE-XC161 RDK will be installed to the \PHYBasic directory 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.
XC161CJ QuickStart Instructions 2.2 Interfacing the phyCORE-XC161 to a Host-PC Connecting the phyCORE-XC161, mounted on the phyCORE Development Board HD200 2.5V, to your computer is simple. • As shown in the figure below, if the phyCORE module is not already pre-installed, mount it connector side down onto the Development Board’s receptacle footprint (X6).
This sequence of pressing and releasing the Reset (S2) and Boot (S1) buttons renders the phyCORE-XC161 into the Bootstrap mode. Use of FlashTools 3 always requires the phyCORE-XC161 to be in Bootstrap mode. See section 5.1, “FlashTools 3” for more details.
FlashTools icon or by selecting FlashTools 3 from within the Programs|Phytec program group. • The FlashTools 3 registration window will now appear. Please contact PHYTEC to obtain your registration key. • Copy your registration key into the applicable field and click on the Register button.
Page 28
XC161CJ QuickStart Instructions Note: Always ensure that the phyCORE-XC161 is in Bootstrap mode before pressing the Connect button (see section 2.2) • Now click the Connect button to establish connection to the target hardware. The microcontroller tries to automatically adjust to the baud rate selected within the baud rate pull-down menu.
• Returning to the FlashTools 3 tabsheet, choose the Download tab and click on the Open button. The hexfile has already been installed to your hard drive during the installation procedure. • Browse to the correct drive and path for the phyCORE-XC161 Demo folder (default location C:\PHYBasic\pC-XC161\Demos\Keil\Blinky\Blinky.h86) and click Open.
Open button. 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-XC161 Demo folder (default location C:\PHYBasic\pC-XC161\Demos\Keil\Hello\Hello.h86) and click Open.
Page 37
16 MHz populates the phyCORE-XC161. Using the internal PLL (Phase Locked Loop) device results in an internal 40 MHz CPU frequency. If your phyCORE-XC161 is equipped with a different speed oscillator, the demo application might transmit using another baud rate. This may lead to incoherent characters appearing in the HyperTerminal window following execution of code.
Page 48
Type the settings for the External Memory as shown below. Make sure that #1 is set to ROM. Memory configuration based on standard version of the phyCORE-XC161 as included in the Rapid Development Kit featuring 1 MByte of Flash and 512 kByte of fast SRAM. Modify these values if you are using a different memory configuration.
• Returning to the FlashTools 3 tabsheet, choose the Download tab and click on the Open button. • Choose the Download tab, and click on the Open button. • Browse to the correct drive and path for the phyCORE-XC161 Demo folder (default location C:\PHYBasic\pC-XC161\Demos\Keil\Blinky2\Blinky2.h86) and click Open.
• If there are no errors, the code is assembled and linked and the executable code is ready to be downloaded to the board. Memory configuration based on standard version of the phyCORE-XC161 as included in the Rapid Development Kit featuring 1 MByte of Flash and 512 kByte of fast SRAM. Modify these values if you are using a different memory configuration.
• Returning to the FlashTools 3 tabsheet, choose the Download tab and click on the Open button. • Choose the Download tab, and click on the Open button. • Browse to the correct drive and path for the phyCORE-XC161 Demo folder (default location C:\PHYBasic\pC-XC161\Demos\Keil\Hello2\Hello2.h86) and click Open.
• Resetting the Development Board (at S2) will execute the Hello2.h86 file loaded into the Flash. • Successful execution will send the modified character string "PHYTEC... Stick It In!" to the HyperTerminal window. • Click the Disconnect icon • Close the HyperTerminal program...
Keil. The µVision2 Debugger offers two operating modes that can be selected in the Project|Options for Target phyCORE-XC161 dialog: • The Simulator allows PC-based microcontroller simulation of most features of the 166/ST10 microcontroller family without actually having target hardware.
CPU vendor data base list. • Rename the target of your project within the Project Window – Files tab into phyCORE-XC161. • Rename the file group Source Group 1 within the Project Window – Files tab into User and add an additional file group named System Files.
Keil\C166\Monitor\Phytec pC-XC161 folder for details). 4.1.2 Setting Options for Target • Open the Project|Options for Target ’phyCORE-XC161’ menu and change the default settings to the correct values as shown in the figure below. This includes settings for the clock frequency of your phyCORE-XC161, the memory model and the off-chip memory.
Debugging 4.1.3 Preparing the Debugger • Open the Project|Options for Target ’phyCORE-XC161’ menu and select the Debug tabsheet. • Enable the checkboxes Keil Monitor–166 Driver, Load Application at Startup and Go till main(). • Click on the Settings button in the upper right-hand corner of the Debug tabsheet.
Debugging Resetting the Debugger and the phyCORE-XC161 Debugger in Monitor mode: The monitor kernel runs on the target hardware. A debugger reset sets the IPC to zero and performs other initialization routines if no user application was started. This type of reset is not as complete as a hardware-reset (pressing push button S2 on the Development Board).
Page 76
XC161CJ QuickStart Instructions • Open the Project|Options for Target ’phyCORE-XC161’ menu and change the settings for off-chip memory to the new values as shown in the figure below. The start address for RAM, accessed via Chip Select signals /CS1, is 0x200000 which is also configured in the BUSCON1 register (see start_pC-XC161.a66...
µVision2 software tool chain. 5.1 FlashTools 3 Flash is a highly functional means of storing non-volatile data. One of its advantages is the possibility of on-board programming. Flash programming tools for the phyCORE-XC161 are provided in the form executable binary files...
C:\PHYBasic\pC-XC161\Tools\Startup\Keil. The properties of the external bus interface are already configured for the phyCORE-XC161. You may want to change the values for the Chip Select Unit. To accommodate the startup code to the needs of your application copy it from the directory described above to your project directory.
Page 82
The external use of the Chip Select signals is predefined by the hardware in the following way: • Flash Bank uses /CS0 (up to 2 MByte Flash) • RAM Bank uses /CS1 (up to 512 kByte RAM) The default configuration of the phyCORE-XC161 has 1 MByte Flash (/CS0) kByte fast...
Page 84
Flash bank and RAM bank. Remember that you will have multiple additional mirrors of the physical devices actually mounted on the phyCORE-XC161 if their capacity is less than the maximum value of 1 MByte. For instance if you have 512 kByte of RAM mounted on the phyCORE-XC161 you will have one additional mirror image of the RAM within the reserved 1 MByte range.
5.5 Demo for the Optional Ethernet Controller CS8900A-CQ As an option, the Crystal LAN CS8900A-Q Ethernet Controller can populate the phyCORE-XC161 at position U16. The PHYTEC Spectrum-CD, included in the phyCORE-XC161 Rapid Development Kit, contains an example program that demonstrates the use of a tiny webserver.
Need help?
Do you have a question about the phyCore-XC161 and is the answer not in the manual?
Questions and answers