Page 1
QuickStart Instructions Using PHYTEC FlashTools for Windows and the Keil µVision2 Software Evaluation Development Tool Chain Note: The PHYTEC Spectrum CD includes the electronic version of the English nanoMODUL-164 Hardware Manual Edition: May 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 nanoMODUL-164..........3 1.5 The µVision2 Software Evaluation Development Tool Chain..6 Getting Started..................9 2.1 Installing Rapid Development Kit Software.........9 2.2 Interfacing the nanoMODUL-164 to a host-PC ......16 2.3 Downloading Example Code............18 2.3.1 Starting PHYTEC FlashTools for DOS ......18 2.3.2 Downloading Example Code with FlashTools for DOS ................20...
Page 4
In Line Assembler ............75 4.6 Single Stepping................76 4.6.1 Memory Window............77 4.6.2 Watch Window.............. 78 4.7 Resetting Simulator and the nanoMODUL-164......79 Advanced User Information............. 81 5.1 FlashTools .................. 81 5.1.1 FlashTools for DOS ............81 5.1.2 FlashTools for Windows ..........82 5.2 Start164.a66................
Introduction 1 Introduction to the Rapid Development Kit This tutorial provides: • general information on the PHYTEC nanoMODUL-164 Single Board Computer • an overview of Keil’s µVision2 software evaluation development tool chain, and • instructions on how to run example programs on the nanoMODUL-164, mounted on the PHYTEC Development Board, in conjunction with µVision2.
1.3 System Requirements Use of this ‘Rapid Development Kit’ requires: • the PHYTEC nanoMODUL-164, • the PHYTEC Development Board with the included DB-9 serial cable and AC adapter supplying 8-12 V / min. 500 mA., • the PHYTEC Spectrum CD, •...
PHYTEC FlashTools for Windows enable easy on-board download of user code to the external Flash device. The nanoMODUL-164 is fitted with one RS-232 transceiver, an I²C RTC and a CAN-bus interface. All controller signals and ports extend to pin rows aligning two edges of the board. These pins provide a 16- bit bi-directional I/O port and 64 free port lines, including 8 analog inputs with 10-bit resolution.
• requires only +5V/300 mA power source in a temperature range of 0 to 70 degree C The PHYTEC Development Board, in EURO-card dimensions (160 x 100 mm.) is completely equipped with all mechanical and electrical components necessary for the speedy and secure insertion and subsequent programming of the PHYTEC nanoMODUL series Single Board Computer.
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 the Flash on the PHYTEC nanoMODUL-164 target board. µVision2 consists of the following executables: • C Compiler c166.exe...
Page 12
There are no other than these restrictions, the tool set works exactly as the full version does. This allows you to completely evaluate the features and power of Keil products on the PHYTEC target board. The full version has no restrictions and is completely ANSI compliant.
PC to the external Flash-Memory using FlashTools 2.1 Installing Rapid Development Kit Software When inserting 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
QuickStart Instructions All software and tools for this nanoMODUL-164 Kit 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 doc.
QuickStart Instructions 2.2 Interfacing the nanoMODUL-164 to a host-PC Connecting the nanoMODUL-164, mounted on the PHYTEC Development Board, to your computer is simple: • If the nanoMODUL is not already pre-installed, mount it pins- down onto the Development Board’s receptacle footprint (X3) as shown in the Figure below.
Boot (S2) switch. This sequence of pressing and releasing the Reset (S1) and Boot (S2) switches renders the nanoMODUL-164 into the Bootstrap mode. FlashTools for Windows must always be operated in this mode. See section 5.1.1 for more details. Ensure that the terminal program flasht.exe is always invoked only after first resetting the board.
SBC to a host-PC enables the software portion of FlashTools to recognize and communicate with the firmware portion. If you have a nanoModul-164 with 1 MB SRAM or 1 MB Flash you must use the three files from the subdirectory FlashtMx in the Flasht directory.
Page 23
Development Kit|nanoMODUL-164 program group. We always recommend to use the installed icons. If you have a nanoModul-164 with 1 MB SRAM or 1 MB Flash use the icons FlashTools Max (COM1) or FlashTools Max (COM2). • You can also start FlashTools by running the executable from within a DOS box by typing flasht br(9600) x.
Which icon to choose depends on the serial port used to connect to the target system. If you have a nanoModul-164 with 1 MB SRAM or 1 MB Flash use the icons FlashTools Max (COM1) or FlashTools Max (COM2).
FlashTools window as it transmits via the RS-232 connection from the host to the on-board Flash: If you have a nanoModul-164 with 1 MB SRAM or 1 MB Flash use the Demo file at the default location C:\PHYBasic\nM164\Demos\Keil\Hello\HelloMx\hello.h86).
QuickStart Instructions The demo application within the file hello.h86 initializes the serial port of your nanoMODUL-164 to 9600 baud. The initialization values are based on the assumption that the microcontroller runs at a 20 MHz internal clock frequency. Please note that the nanoMODUL-164 is populated with an oscillator with a frequency of just 5 MHz.
Page 35
Enter the correct drive and path to the demo file and press <Enter> (default location C:\PHYBasic\nM164\Demos\Keil\Blinky\blinky.h86). If you have a nanoModul-164 with 1 MB SRAM or 1 MB Flash use the Demo file at the default location C:\PHYBasic\nM164\Demos\Keil\Blinky\BlinkyMx\BlinkyMx.h86).
2.3.3 Downloading Example Code with FlashTools for Windows • Start FlashTools for Windows by double-clicking on the FlashTools for Windows icon or by selecting FlashTools for Windows from within the Programs|PHYTEC FlashTools for Windows program group. • The Connect tab of the FlashTools for Windows Worksheet window will now appear.
Page 45
COM parameters and the RS-232 connection. The demo application within the file hello.h86 initializes the serial port of your nanoMODUL-164 to 9600 baud. The initialization values are based on the assumption that the microcontroller runs at a 20 MHz internal clock frequency.
2.1. You can also manually install µVision2 by executing setup.exe from within the \Software\Keil\Ek166 directory of your PHYTEC Spectrum CD. Start the tool chain by selecting µVision2 from within the Programs program group.
Page 51
• Now use from the menu Project|Select Device for Target and double click on Siemens as manufacturer for the CPU. The nanoMODUL-164 is equipped with a C164 CPU. Choose this controller type from the list as shown below. This selection sets...
Which icon to choose depends on the serial port used to connect to the target system. If you have a nanoModul-164 with 1 MB SRAM or 1 MB Flash use the icon´s FlashTools Max (COM1) or FlashTools Max (COM2).
Start: 0x0 Size: 0x3FFF RAM: Start: 0x80000 Size: 0x3FFF If you have a nanoModul-164 with 1 MB SRAM or 1 MB use the following external memory spaces: - 0x3FFF 0x100000 - 0x3FFF • Modify the default options for the output file by selecting the...
Choose the icon that corresponds to the serial port used on your host-PC to connect to the target system. If you have a nanoModul-164 with 1 MB SRAM or 1 MB Flash use the icon´s FlashTools Max (COM1) or FlashTools Max (COM2).
• Resetting the Development Board (at S1) 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 Disconnection icon • Close the HyperTerminal program...
Page 76
Description section on the right side. If you have a nanoModul-164 with 1 MB SRAM or 1 MB select Phytec nM164 1MB from the Monitor Configuration listbox. • Select the right COM-Port in the PC Port Settings.
‘infinite loop‘ in which your program might be stuck. With reset, you start again at address 0. • The PHYTEC Development Board does not have a hardware NMI button. A NMI is the most reliable way to stop a running program.
Programming tools for the Flash device are delivered with the nanoMODUL-164 in the form a set of executable and binary files to run under DOS. This tools make use of the Bootstrap mode to transfer executable code to the nanoMODUL-164 that, in turn, download user code into the Flash.
QuickStart Instructions If you have a nanoModul-164 with 1 MB SRAM or 1 MB Flash the memory model is different: RAM from 0x000000 to 0x0FFFFF, ROM from 0x1000000 to 0x1F7FFF). Using the Bootstrap mode to transfer the required microcontroller firmware to the nanoMODUL-164 the FlashTools maintains its independent Flash programming capability.
Advanced User Information If you have a nanoModul-164 with 1 MB SRAM or 1 MB Flash the Memory-Model is different: RAM from 0x000000 to 0x0FFFFF, ROM from 0x1000000 to 0x1F7FFF). Using the Bootstrap mode to transfer the required microcontroller firmware to the nanoMODUL-164 the FlashTools maintains its independent Flash programming capability.
Page 89
It is required that all xDATA and xDATA0 classes segments are located to any internal RAM of the C164 or any external RAM of the nanoMODUL-164. Also all xCODE and xCONST classes must be located to any internal non-volatile memory (e.g. Flash, OTPROM) of the C164 or any external Flash-Memory of the nanoMODUL-164.
This typically leads to variables containing not their assigned value, functions returning bad results and modified code. If you have a nanoModul-164 with 1 MB SRAM or 1 MB Flash use the files from the default location: C:\PHYBasic\nM164\Tools\Mon\MonMx To obtain information about the memory requirements of the Monitor, the corresponding memory map file monitor.m66 is made available...
Page 91
Flash bank 1 and RAM bank 1. Remember that you will have multiple additional mirrors of the physical devices actually mounted on the nanoMODUL-164 if their capacity is less than the maximum value of 1 MB. For instance if you have 256 kByte of RAM mounted on the nanoMODUL-164 you will have one additional mirror of the RAM within the reserved 512 kByte range.
Need help?
Do you have a question about the nanoModul-164 and is the answer not in the manual?
Questions and answers