Software Serial Port for ROM/RAM Monitor



Similar documents
Quick Start Tutorial. Using the TASKING* Software Development Tools with the Intel 8x930 Family Evaluation Board

Hardware and Software Requirements

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

Programming and Using the Courier V.Everything Modem for Remote Operation of DDF6000

Programming Flash Microcontrollers through the Controller Area Network (CAN) Interface

In-System Programmer USER MANUAL RN-ISP-UM RN-WIFLYCR-UM

Introduction: Implementation of the MVI56-MCM module for modbus communications:

Using HiTOP with the HOT16x Hands-On Training Materials

Serial Communications

Using the HCS12 Serial Monitor on Wytec Dragon-12 boards. Using Motorola s HCS12 Serial Monitor on Wytec s Dragon-12 boards

RN-XV-RD2 Evaluation Board

ET-BASE AVR ATmega64/128

MANUAL FOR RX700 LR and NR

Developing an Application on Core8051s IP-Based Embedded Processor System Using Firmware Catalog Drivers. User s Guide

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

Modbus Communications for PanelView Terminals

Lab Experiment 1: The LPC 2148 Education Board

SUDT AccessPort TM Advanced Terminal / Monitor / Debugger Version 1.37 User Manual

National CR16C Family On-Chip Emulation. Contents. Technical Notes V

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

PCMCIA 1 Port RS EDITION OCTOBER 1999

LINDY ELECTRONICS LIMITED & LINDY-ELEKTRONIK GMBH - SECOND EDITION

ISHIDA BC Scale to Scale Communications

RS-232 Baud Rate Converter CE Model 232BRC Documentation Number 232BRC-3903 (pn5104-r003)

Programming the On-Chip Flash on a phycore-xc161 phycore-xc167

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

Keep it Simple Timing

applicomio Profibus-DP

Objectives. Basics of Serial Communication. Simplex vs Duplex. CMPE328 Microprocessors (Spring ) Serial Interfacing. By Dr.

1-Port R422/485 Serial PCIe Card

T3 Mux M13 Multiplexer

PC Base Adapter Daughter Card UART GPIO. Figure 1. ToolStick Development Platform Block Diagram

Serial Communications

LOW COST GSM MODEM. Description. Part Number

PCAN-ISA. CAN Interface for ISA. User Manual

APPLICATION NOTE. AT07175: SAM-BA Bootloader for SAM D21. Atmel SAM D21. Introduction. Features

Chapter 5 Cubix XP4 Blade Server

(Cat. No SI) Product Data

Vicon Flash Upgrade Software

Elettronica dei Sistemi Digitali Costantino Giaconia SERIAL I/O COMMON PROTOCOLS

Operating Systems 4 th Class

Using IDENT M System T with Modbus/TCP

USBSPYDER08 Discovery Kit for Freescale MC9RS08KA, MC9S08QD and MC9S08QG Microcontrollers User s Manual

Block 3 Size 0 KB 0 KB 16KB 32KB. Start Address N/A N/A F4000H F0000H. Start Address FA000H F8000H F8000H F8000H. Block 2 Size 8KB 16KB 16KB 16KB

An Introduction to MPLAB Integrated Development Environment

RS-422/485 Multiport Serial PCI Card. RS-422/485 Multiport Serial PCI Card Installation Guide

Z8 Encore! XP F64xx Series Flash Microcontrollers. In-Circuit Emulator. User Manual UM

ARM Thumb Microcontrollers. Application Note. Software ISO 7816 I/O Line Implementation. Features. Introduction

Freescale Semiconductor, I

A RF18 Remote control receiver MODULE

H ARDWARE C ONSIDERATIONS

Alcatel-Lucent OmniPCX Enterprise Communication Server TA-MMK (MMK V2)

Operating Systems. Lecture 03. February 11, 2013

THE EASY WAY EASY SCRIPT FUNCTION

HC08 Welcome Kit. Hardware- Version User Manual

8051 MICROCONTROLLER COURSE

UMBC. ISA is the oldest of all these and today s computers still have a ISA bus interface. in form of an ISA slot (connection) on the main board.

ALL-USB-RS422/485. User Manual. USB to Serial Converter RS422/485. ALLNET GmbH Computersysteme Alle Rechte vorbehalten

F2103 GPRS DTU USER MANUAL

Orbit PCI Mk 2 Network Card. User Manual. Part No Issue 4

Debugging Network Communications. 1 Check the Network Cabling

PRN_LOAD :22

GE Power Controls FIELDBUS APPENDIX PROFIBUS DP. Doc. No.: ASTAT Plus PB_Appendix-v0

Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview

MVME162P2. VME Embedded Controller with Two IP Slots

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

ROM Monitor. Entering the ROM Monitor APPENDIX

Quick Installation. A Series of Intelligent Bar Code Reader with NeuroFuzzy Decoding. Quick Installation

3.1 Connecting to a Router and Basic Configuration

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate With the Eagle System

RS232 Board datasheet

WHQL Certification Approval...2 User Interface...3 SUNIX s COMLab..4

TruePort Windows 2000/Server 2003/XP User Guide Chapter

Computer Performance. Topic 3. Contents. Prerequisite knowledge Before studying this topic you should be able to:

EMBEDDED C USING CODEWARRIOR Getting Started Manual

T-BOXN12R. First steps with T-BOXN12R. You can make it wireless. Date: Version 1.0

TP- 051 GPS RECEIVER

DRV8312-C2-KIT How to Run Guide

PC Notebook Diagnostic Card

1.1 Connection Direct COM port connection. 1. Half duplex RS232 spy cable without handshaking

AN974 APPLICATION NOTE

AVR Butterfly Training. Atmel Norway, AVR Applications Group

Ride7 for ARM. RAISONANCE Tools for the STRx and STM32 families. Overview and Getting Started

Nuvoton Nu-Link Debug Adapter User Manual

Zypcom Application Note

Table of Contents. Safety Warnings..3. Introduction.. 4. Host-side Remote Desktop Connection.. 5. Setting Date and Time... 7

WHQL Certification Approval...2 User Interface K software FIFO 4 Universal PCI Interface...5 Ready for 64-bit System...5

BIT COMMANDER. Serial RS232 / RS485 to Ethernet Converter

Software User Guide UG-461

CNC File Transfer Box. Connecting the CNC File Transfer. CNC Transfer Program

Virtual Integrated Design Getting started with RS232 Hex Com Tool v6.0

8051 hardware summary

RS-232 COMMUNICATIONS

ENET-710. ENET Ethernet Module ENET-710 JAN / 06 FOUNDATION

1. Make sure that no client accounts are open. 2. Click on Setup, then click Modem. The Modem Setup window will appear.

Unique Micro Design Advanced Thinking Products. Model S151 UMD Transfer Utility for the Nippondenso BHT Series User Manual

CSE2102 Digital Design II - Topics CSE Digital Design II

Teleservice via RS232 interface XC100/XC200

Dolphin In-Circuit programming Updating Firmware in the field

IAR C-SPY Hardware Debugger Systems User Guide. for Renesas PC7501 Emulator and ROM-monitor

Transcription:

Index 1. Introduction 2. Basic operation 3. Resources used by the Monitor with soft serial port 4. How to configure the soft serial routines 4.1. Changing the serial baud rate and the system clock frequency 4.2. Defining the Transmit and Timer parameters 4.3. Defining the Receive parameters 4.4. Defining the trap numbers and interrupt levels 5. ROM Monitor programming into flash 6. Project settings for the soft serial Monitor 7. Building the ROM/RAM Monitor with the Soft Serial port 8. Example Project 1 (using the RAM Monitor) 9. Example project 2 (using the ROM Monitor in flash) 10. How to order the soft serial routines? 1. Introduction When you make use of the ROM/RAM Monitor for debugging, the asynchrone serial interface from your processor is needed for the communication with your host computer. Therefore, this hardware serial port cannot be used by your application. This application note describes a software based serial port, replacing this hardware serial channel after the monitor is downloaded. This allows you to free the serial port for your own software. 2. Basic operation The soft serial port is based on two software interrupt routines that are written in assembly code. One routine is configured as a baud rate timer and is used for transmitting bits and for timing out the received frames from the input stream. The other interrupt routine records the low-to-high and the high-to-low transitions of the input stream. Every input pin which is capable of generating an interrupt on both the rising and falling edge of the signal can be used for your soft serial receive input pin. Every output pin that can be controlled by the software is suitable for your soft serial output pin. The adjustable baud rate timer is set up with one of the timers T2..T6 and can be as fast as 38K4 bits/second. Because interrupts are needed within the ROM/RAM Monitor, the Non-Maskable Interrupt trap vector (NMI) cannot be used anymore by CrossView for setting breakpoints or for single stepping. Therefore, a user defined trap vector will be used instead. When using the RAM Monitor, you must use the normal hardware serial port to download the monitor onto your target board. After that, CrossView will lose connection to the target board since the monitor will start to communicate over the soft serial interface instead. At this point, you should switch the serial interface from your host computer to this soft serial channel. For this, you can use a switchbox or simply change connectors. When using the Monitor programmed into ROM, you can simply use the soft serial interface right away. DocId: AN019-09 Copyright 2001 TASKING, Inc. Page 1 of 10

3. Resources used by the Monitor with soft serial port This chapter gives an overview of which hardware en software resources are used by the ROM/RAM Monitor when using the soft serial port. Hardware resources: -An input pin for the soft serial receive input stream. -An output pin for the soft serial transmit output stream. -One General Purpose Timer (T2..T6 configured as baud rate timer). Interrupt resources: -A user selectable software interrupt for setting breakpoints and for single stepping by CrossView (instead of the NMI vector). -A Timer interrupt, corresponding to the chosen baud rate timer (T2..T6). -A receive interrupt, corresponding to the chosen input pin. -PEC interrupt service channels 6 and 7 (highest priority interrupt level is being used within the monitor). Software resources: -Less than 3Kbyte for code sections -140 bytes RAM for data sections and user stack -Two register banks of 16 words and about 22 words data located in internal RAM See also chapter 6 Project settings for the soft serial Monitor. 4. How to configure the soft serial routines This chapter describes how you can change the default settings for the soft serial routines. The default values are as follows: Description: Default Value: Defined in File: System clock frequency 20MHz Soft_serport.h Baud rate 38K4 Soft_serport.h Transmit baud rate timer Timer 6 Soft_serport.h Transmit output pin Bit 0 of Port 3 (T0IN) Soft_serport.h Receive input pin Bit 2 of Port 3 (CAPIN) Soft_serport.h Transmit interrupt level Priority level 15, group 3 Soft_serport.c Receive interrupt level Priority level 15, group 2 Soft_serport.c Interrupt vector for CrossView Trap Number = 8 Makefile Interrupt vector for CrossView Priority level = 14 Soft_serport.c 4.1 Changing the serial baud rate and the system clock frequency The baud rate and the system clock are defined in file Soft_serport.h as follows: #define CLKFREQ 20000000 /* system clock frequency in MHz */ #define BAUDRATE 38400 /* baud rate in bits/s (max. 38K4)*/ You can change the clock frequency to meet the specifications of your target board. DocId: AN019-09 Copyright 2001 TASKING, Inc. Page 2 of 10

The maximum baud rate for the soft serial routines is 38K4. It may be necessary to slow down the communication speed when the signal distortion is too high, e.g. as a result of long cables. Note: Unlike the normal ROM/RAM Monitor, the Soft serial version does not have the auto detect baud rate feature. This means the baud rate has a fixed value, as stated above. 4.2. Defining the Transmit and Timer parameters The baud rate timer is defined in file Soft_serport.h. The parameter for the default timer is 6. You can change the baud rate timer by replacing the number 6 into one of the other timer numbers 2..5 (timer 1 cannot be used!). For example, to select timer 2, change the timer definitions as follows: #define SOFTTIMER 2 /* fill in baud rate timer nr here */ #define BdrtT T2 /* GPT Timer 2 is being used */ #define BdrtTIC T2IC /* Interrupt control register */ #define BdrtTCON T2CON /* Timer control register */ #pragma asm BdrtT LIT 'T2' ; name of timer in assembly #pragma endasm The output pin for the serial communication is set to T0IN (bit 0 from port 3) by default. If you want to change the output pin definition, you must also change the way this I/O pin is set to output and how to initialize this pin with 1. This C-code, defined with macro TXDOUTPUT_INIT, will be invoked into the initialization routine SerialInit() from file soft_serport.c. For example, to use bit 11 from Port 2 as the output pin, change the definitions as follows: /* Define transmit output pin here: */ #pragma asm TxD1 LIT 'CC11IO' ; transmit pin: port2, bit 11 #pragma endasm /* Define how to set Txd output pin to output! Start value = '1' */ #define TXDOUTPUT_INIT \ _putbit( 1, P2, 11); /* set output at '1' */ \ _putbit( 1, DP2, 11); /* P2.11 is output = TXD1 */ The name of the output pin, like T0IN or CC11IO can be found in the register file c166\include\reg167.h. 4.3. Defining the Receive parameters The input pin for the serial communication is defined as CAPIN by default in file Soft_serport.h. Every input pin which is capable of generating an interrupt on both the rising and falling edge of the signal can be used for the receive input pin. If you want to change the input pin definition, you must also change the way this I/O pin is set to input and how to initialize this bit with 1. Furthermore, you must also specify that pin will generate an interrupt on both signal transitions (falling and rising edge) and how to initialize the corresponding interrupt control register. This resulting C-code, defined with macro RXDINPUT_INIT, will be invoked into the initialization routine SerialInit() from file soft_serport.c. For example, to define bit 14 from Port 2 (EX5IN) as the input pin, change the definitions as follows: DocId: AN019-09 Copyright 2001 TASKING, Inc. Page 3 of 10

/* Define receive input pin here: */ #pragma asm RxD1 LIT 'EX5IN' ; receive I/O pin used #pragma endasm /* Define how to set RxD pin to input and set its interrupt level */ #define RXDINPUT_INIT \ _putbit( 1, P2, 13); /* set input to '1' */ \ _putbit( 0, DP2, 13); /* be sure direction is input! */ \ CC13IC = RXDprinitval; /* set up EX5IN = RxD input pin interrupt */ \ EXICON = ( 3 << 10 ); /* to generate interrupts on both tansitions */ The initialization value RXDprinitval, used for the interrupt control register CC13IC is defined in file soft_serport.c. Because all interrupt control registers for the 166-family are configured the same way, it is not very likely this value will need to be changed. The name of an input pin, such as CAPIN or EX6IN, can be found in the register file c166\include\reg167.h. Because CrossView will initialize several SFRs (special function registers) after a reset of the target board, it is necessary to skip certain initializations for SFRs being used by the receive routine. Otherwise the receive interrupts will not work anymore. Therefore, SFRs that must be skipped during initialization are stated in file Soft_serport.h as well. Two SFRs can be mentioned here, using macros SKIPSFR1 and SKIPSFR2. These macros are used in function test_hp_softserial() (see file command.c) to skip the corresponding addresses. For the example described above, SKIPSFR1 and SKIPSFR2 must be defined as follows: /* define SFRs used by the receive routine */ #define SKIPSFR1 EXICON /* SFRs being used: EXICON and CC13IC */ #define SKIPSFR2 CC13IC Finally, you should fill in the right interrupt trap number for the interrupt control register. For this, see the next chapter 4.4. 4.4 Defining the trap numbers and interrupt levels The trap number definitions can be found in file Soft_serport.h. For the transmit timer Tx, the corresponding trap number is calculated automatically by means of the macro SOFTTIMER. For the receive interrupt, you must fill in the trap number yourself in case you have changed the interrupt control register (see chapter 4.3. Defining the Receive parameters ). By default, trap number 0x27 is filled in, this corresponds to register CRIC (see your CPU manual). For the interrupt control register CC13IC, described in the example above, trap number 0x1D must be filled in: /* trap numbers for transmit timer Tx and the receive interrupt routine */ #define TXD_JUMPTABENTRY (0x20+SOFTTIMER) /* defined by macro SOFTTIMER */ #define RXD_JUMPTABENTRY 0x1D /* trap number for CC13IC */ After the Monitor is entered, the Monitor priority interrupt level will be raised to a level just below the transmit and receive interrupt levels to avoid application interrupts. By default, these transmit and DocId: AN019-09 Copyright 2001 TASKING, Inc. Page 4 of 10

receive levels are set to the highest priority which is level number 15. Therefore, it is highly recommended to maintain the priority level for the monitor to level number 14. /* definitions for the MONITOR */ #define INT_LEVEL_MON 14U /* interrupt level monitor */ Note: Because interrupt level 15 with group level 2 and 3 are being used for the receive and transmit routines, you should be careful when PEC6 or PEC7 transfer is being used. This may lead to timing problems for the serial port. Pay close attention when the PEC6/7 transfer counter remains zero, the corresponding interrupt service routine will be activated which can result in a transmit or receive error. Because interrupts are needed within the ROM/RAM Monitor, the Non-Maskable Interrupt trap vector (NMI) cannot be used anymore by CrossView for setting breakpoints or for single stepping. Therefore, a user defined trap vector must be used instead. This vector is specified as a macro in the make file (called mon167\makefile), listed as DNR = n where n is corresponding to the trap number. By default, trap number 8 (vector location 20h) is listed, as follows: DNR = 8 If you want to change this trap number, edit the makefile and change the trap number. Only software traps are allowed. 5. ROM Monitor programming into flash Special attention is needed when the ROM Monitor is programmed into flash, because some modifications are needed to the files soft_mon.c and soft_vectab.asm. Two ROM Monitors are supported with the soft serial routines: the ROM Monitor using Dual Vector Table (m167d) and the ROM Monitor using Memory Switch (m167s). In file soft_mon.c the initialization of SYSCON, BUSCONx and ADDRSELx should be changed according to the hardware configuration of your target board. This is because the register init-values from the configuration file are NOT passed to the monitor by CrossView when the ROM monitor is being used. This is a restriction of CrossView. These initializations must take place before function _einit() is executed. In file soft_mon.c, the system registers are loaded with the following values: #if defined(rom_dual) defined(rom_swap) /* initialize system registers */ #pragma asm /* for ROM Monitor */ MOV SYSCON,#0080H MOV BUSCON0,#049FH ; Enable CS0, no Waitstates MOV ADDRSEL1,#0083H ; 32Kbyte RAM from 0x8000 to 0xffff MOV BUSCON1,#049FH ; Enable CS1, no Waitstates #pragma endasm #endif That means, CS0 is used to address the external flash memory and 32Kbyte of external RAM is addressed by CS1 and located from address 0x8000 to 0xffff. You can change these values to meet the hardware specifications of your target board. But you have to remember where the RAM and ROM areas for the monitor are located. See the *.map file corresponding to your monitor in directory softmon167. To achieve the maximum baudrate of 38K4, MCTC from BUSCONx is set to no wait states. This requires RAM devices with 55ns access time. If MCTC is set to a different value, the baud rate must be lowered accordingly. DocId: AN019-09 Copyright 2001 TASKING, Inc. Page 5 of 10

When the Monitor with Dual Vector Table is being used, the receive and transmit interrupt vectors must be filled in correctly in file soft_vectab.asm as well. These interrupt vectors must be the same as stated in file Soft_serport.h (see chapter 4.4, TXD_JUMPTABENTRY and RXD_JUMPTABENTRY). The default values are: @SET(S1TX_INT, 026H) @SET(S1RX_INT, 027H) So when you have changed the interrupt level(s) in Soft_serport.h, you should change the values here too. To rebuild the monitors, see chapter 7 Building the ROM/RAM Monitor with the Soft Serial port. Some of the flash tools need the Intel hex file format to program the monitor into flash. Please refer to chapter 7, how to generate IHEX files instead of the default Motorola S record format. Finally, program the monitor into flash following the instructions of your flash tool. 6. Project settings for the soft serial Monitor When you use the soft serial Monitor, you should reserve the Monitors memory areas when building your application. To do so, select EDE Linker/Locator Options Reserve, and fill in the values as listed in the following table at the field Reserve memory for Rom Monitor Resources. RAM Monitor (m164r, m167n, m167r, m167s): ROM Monitor Dual Vector Table (m167d) ROM Monitor using Memory Switch (m167s): 0200h-0BFFh, 0FCC0h-0FD30h 0000h-0BFFh, 0C000h-0C0FFh, 0FCC0h-0FD30h 0200h-02FFh, 8000h-89FFh, 0FCC0h-0FD30h Furthermore, you should be careful that the right values for the SYSCON, BUSCONx and ADDRSELx registers are stated in your configuration file (*.cfg). These values will depend on the hardware of your target board and the memory map of your application. Finally, set the correct communication baudrate for CrossView as listed in file Soft_serport.h (see chapter 4.1) at EDE CrossView Pro Debugger Options Baudrate. Additional Linker/Locator Options for the ROM Monitor with Dual Vector Table (m167d): Fill in the start address of your application (see label CSTART_PR in your *.map file) at EDE Linker/Locator Options Format Start address, or use the command line option saddress of ieee166. Use the VECTAB(address) control at EDE Linker/Locator Options Miscellaneous Additional Locator Controls, to locate the user vector table at the default address of 8000H. Define the memory map for your application: select EDE Linker/Locator Options Memory and fill in the ROM and RAM areas where you want to locate your application. The range of 8000h to 81ffh must be specified as ROM for locating the interrupt vector table. 7. Building the ROM/RAM Monitor with the Soft Serial port After finishing the configuration settings of the soft serial port (see chapter 4), it is time to rebuild the ROM/RAM monitors. The following monitors and boot programs are supported: DocId: AN019-09 Copyright 2001 TASKING, Inc. Page 6 of 10

Supported Monitors: Supported Boot Programs: m167s.sre memory swap b167.sre standard boot program m167n.sre NMI vector b167a.sre SAB C167 AA step m167r.sre reset vector bi_me167.sre I+ME C167C board M167d.sre Dual Vector Table b167nrb.sre no ram boot ( Phytec MM167 ) m164r.sre reset vector, Timer T4 b167snrb.sre no ram boot and Phytec memory switch First, make the softmon167 subdirectory the current working directory and type: c:\c166\bin\mk166 clean This will remove all files (*.sre, *..map, *.obj and *.ilo files) which were created before when building the monitors and boot programs. Now type: c:\c166\bin\mk166 This invocation of mk166 will execute the make file called makefile. As a result, the S-Record files (*.sre) of the boot programs and monitors are created in the softmon167 subdirectory. You must copy the boot and monitor files you want to use (as stated in your configuration file) from this subdirectory to the c166\etc directory. If you need the Intel HEX file format instead of the Motorola S record format, invoke the make utility as follows: c:\c166\bin\mk166 IHEX= As a result, the IHEX files (*.hex) of the boot programs and monitors are created in the softmon167 subdirectory. 8. Example project 1 (using the RAM Monitor) This chapter describes an example project with the RAM Monitor based on a Phytec KitCON-167 evaluation board. This board has an extra serial connector that can be used for the soft serial port. That means no additional hardware is required. The project queensh.pjt from the c166\examples\queens directory will be used to show you all the instructions needed to start CrossView with the soft serial Monitor. For this example, two serial ports are needed: one on your host PC to communicate with CrossView, and one to show you the output of the queens example using the VT100 terminal format. For this, a second serial port on your host PC with a VT100 software terminal emulator *) can be used. Step by step instructions: 1. Start EDE and open the project c166\examples\io\queensh.pjt 2. Verify which type of processor is being used on the evaluation board (e.g. 167CR) and fill in the correct CPU type at EDE Project Options CPU. Press OK to continue. 3. Select EDE Linker/Locator Options Reserve, and fill in at Reserve memory for Rom Monitor Resources : 0200h- 0BFFh, 0FCC0h-0FD30h (see chapter 5). Press OK to continue. 4. Build the project. 5. Check the clock frequency of the evaluation board (e.g. 20MHz using the default jumper settings) and verify this value is defined correctly in file Soft_serport.h. Also check if the baud rate is defined as 38400 (see chapter 4.1). Check file Soft_serport.h for the default values as stated in chapter 4. DocId: AN019-09 Copyright 2001 TASKING, Inc. Page 7 of 10

6. Make the c166\examples\softmon\softmon167 subdirectory the current working directory. Type: c:\c166\bin\mk166 clean to clean this directory and type c:\c166\bin\mk166 to rebuild the soft serial boot and monitor programs. 7. Copy the boot program b167nrb.sre and the monitor program m167r.sre (as stated in file c166\etc\kc167.cfg) from the softmon167 subdirectory to the c166\etc\ directory. 8. Configure the jumpers on the KitCON-167 evaluation board. To configure CAPIN as RxD pin, and T0IN as TxD output for the serial connector P2, use the following jumper settings: JP8 closed, JP9 across 2+3, JP10 across 2+3. Note: If p3.8 and p3.9 are being used as the debug interface (new model of the KC167, see the Phytec manual), JP2 must across 2+3 also. Furthermore, p3.8 (connector X3: pin 109) must be connected to p3.2 (X3: pin 102), and p3.9 (X3: pin 113) must be connected to p3.0 (X3: pin 101) by using two additional wires. 9. Attach the power supply to the power connector of the evaluation board. Connect the serial port P1 (standard serial port) to the COM port of your host computer and reset the evaluation board. 10. Select EDE CrossView Pro Options, choose the ROM/RAM Monitor, set the baud rate to 38400 and select KitCON-167 as the evaluation board. Press OK to continue. 11. Start a debug session from EDE. The bootstrap loader and the monitor will be downloaded first. After this, the monitor will switch to the soft serial port and as a result, CrossView will loose the connection. 12. Switch the serial connector from the evaluation board from P1 to P2. Because P2 is a male connector, a simple adapter cable/connector or a switch box is necessary here, to switch from male to female connector. 13. Retry to make the connection. Now, CrossView will download the application onto the evaluation board using the soft serial connection. 14. Connect serial Port P1 to a VT100 terminal, or connect P1 to a second COM port of your PC and start a VT100 emulator program *) for this COM port, with the following settings: baudrate 9600, 8 data bits, 1 stop bit, no parity and no handshaking. 15. Start the queens example with CrossView. The output will be shown on the VT100 terminal while you can use CrossView connected to the soft serial port, for debugging. *) Such as Tera Term Pro version 2.3 (freeware) or Kermit. 9. Example project 2 (using the ROM Monitor in flash) This example describes a project using the ROM Monitor with Dual Vector Table programmed into flash, based on a Phytec KitCON-167 evaluation board. This evaluation board has an extra serial connector which can be used for the soft serial port. That means no additional hardware is required. The project queensh.pjt from the c166\examples\queens directory will be used to show you all the instructions needed to start CrossView with the soft serial Monitor. For this example two serial ports are needed: one on your host PC to communicate with CrossView, and one to show you the output of the queens example using the VT100 terminal format. For this a second serial port on your host PC with a VT100 software terminal emulator *) can be used. Step by step instructions: 1. Start EDE and open the project c166\examples\io\queensh.pjt 2. Verify which type of processor is being used on the evaluation board (e.g. 167CR) and fill in the correct CPU type at EDE Project Options CPU. Press OK to continue. 3. Select EDE Linker/Locator Options Reserve, and fill in at Reserve memory for Rom Monitor Resources : 0000h- 0BFFh, 0C000h-0C0FFh, 0FCC0h-0FD30h. Select the Miscellaneous tab, and fill in at the Additional Locator DocId: AN019-09 Copyright 2001 TASKING, Inc. Page 8 of 10

Controls: VECTAB(08000h). Select the Memory tab, and fill in 08000h-0AFFFh for the ROM area, and 0B000H-0BFFFh for the RAM area (see chapter 6). Press OK to continue. 4. Select EDE CPU Configuraion syscon, and set the Write Configuration mode to WR#/BHE# is WRL#/WRH#. 5. Select EDE Bus Configuration Buscon0, and set the Memory cycle time to 0 wait states. Select the Buscon1 tab, and enable the address window. Set the External bus configuration to 16 bits demultiplexed and set the Memory cycle time to 0 wait states (see the KitCON167 documentation). Select the Addrsel1 tab, and set the range size to 32K, and fill in 08h for the range start address. The external RAM will be located from 8000h to 0FFFFh, and used for downloading the application. Press OK to continue. 6. Build the project. 7. Open file queensh.map and look for CSTART_PR, the start label of the application. Fill in this start address (8910h) at EDE Linker/Locator Options Format Start Address. (see chapter 6). Press OK to continue. 8. Make the project again, to add this start address to the IEEE output file. 9. Copy file KC167.cfg from the c166\etc directory to the project directory (c166\examples\queens). Edit file KC167.cfg to specify 32K of RAM is located from address 8000h-FFFFh: BUSCON1 = 0x49F, ADDRSEL1 = 0x0083. 10. Check the clock frequency of the evaluation board (e.g. 20MHz using the default jumper settings) and verify this value is defined correctly in file Soft_serport.h. Also check if the baud rate is defined as 38400 (see chapter 4.1). Check file Soft_serport.h for the default values as stated in chapter 4. 11. Check the initialization values for SYSCON, BUSCONx and ADDRSELx in file soft_mon.c as described in chapter 5 (CS0: 32K external flash, CS1: 32K external RAM from 08000h to 0FFFFh). Also check the default values for the interrupt vectors in file Soft_vectab.asm (see chapter 5): S1TX_INT = 26H, S1RX_INT = 27H. 12. Make the c166\examples\softmon\softmon167 subdirectory the current working directory. Type: c:\c166\bin\mk166 clean to clean this directory and type c:\c166\bin\mk166 IHEX= to rebuild the soft serial boot and monitor programs in Intel HEX format. 13. Clear the flash memory of the evaluation board and program the Monitor m167d.hex into the flash memory using the flash tools supplied with the evaluation board. 14. Configure the jumpers on the KitCON-167 board. To configure CAPIN as RxD pin, and T0IN as TxD output for the serial connector P2, use the following jumper settings: JP8 closed, JP9 across 2+3, JP10 across 2+3. Note: If p3.8 and p3.9 are being used as the debug interface (new model of the KC167, see the Phytec manual), JP2 must across 2+3 also. Furthermore, p3.8 (connector X3: pin 109) must be connected to p3.2 (X3: pin 102), and p3.9 (X3: pin 113) must be connected to p3.0 (X3: pin 101) by using two additional wires. 15. Attach the power supply to the power connector of the evaluation board. Connect the serial port P2 (soft serial port) to the COM port of your host computer. Because P2 is a male connector, a simple adapter cable/connector or a switch box is necessary here, to go over from male to female connector. Remove jumper JP2 and reset the evaluation board. The monitor in flash is executed now. 16. Select EDE CrossView Pro Options, choose the ROM/RAM Monitor, set the baud rate to 38400 and select KitCON-167 as the evaluation board. Press OK to continue. 17. Start a debug session from EDE. CrossView will download the application onto the target board using the soft serial connection. 18. Connect serial Port P1 to a VT100 terminal, or connect P1 to a second COM port of your PC and start a VT100 emulator program *) for this COM port, with the following settings: baudrate 9600, 8 data bits, 1 stop bit, no parity and no handshaking. 19. Start the queens example with CrossView. The output will be shown on the VT100 terminal while you can use CrossView connected to the soft serial port, for debugging. *) Such as Tera Term Pro version 2.3 (freeware) or Kermit. DocId: AN019-09 Copyright 2001 TASKING, Inc. Page 9 of 10

10. How to order the soft serial routines? The soft serial routines can be obtained for free when you have purchased the ROM/RAM Monitor package for toolchain V7.0R1 or when you have received previously an update for V7.0R1. Please fill in the form below and send it to TSW_logistics@tasking.nl to order the soft serial routines. They will be sent to you as a WINZIP file of about 50Kbyte in size. COMPANY: COUNTRY: NAME: E-MAIL: PRODUCT: C-Compiler C/C++ Compiler ROM/RAM Monitor *) SERIAL NR: Please send this form to: TSW_logistics@tasking.nl *) Underline your product DocId: AN019-09 Copyright 2001 TASKING, Inc. Page 10 of 10