Page 3 - K ADAK; TECHNICAL SUPPORT
AMX 68000 Target Guide K ADAK i TECHNICAL SUPPORT KADAK Products Ltd. is committed to technical support for its software products. Ourprograms are designed to be easily incorporated in your systems and every effort hasbeen made to eliminate errors. Engineering Change Notices (ECNs) are provided peri...
Page 4 - Copyright
ii K ADAK AMX 68000 Target Guide Copyright © 1994-2005 by KADAK Products Ltd. All rights reserved. No part of this publication may be reproduced, transmitted, transcribed,stored in a retrieval system, or translated into any language or computerlanguage, in any form or by any means, electronic, mecha...
Page 7 - The AMX; Installation; Windows; AMX Tool Guides
AMX 68000 Target Guide K ADAK 1 1. Getting Started with AMX 68000 1.1 Introduction The AMX ™ Multitasking Executive is described in the AMX User's Guide. This target guide describes AMX 68000 which operates on the Motorola MC680xx, MC683xx andall architecturally compatible processors. Throughout thi...
Page 8 - File Name
2 K ADAK AMX 68000 Target Guide 1.2 AMX Files AMX is provided in C source format to ensure that regardless of your development environment, your ability to use and support AMX is uninhibited. AMX also includes asmall portion programmed in M68000 assembly language. Figures 1.2-1, 2 and 3 summarize th...
Page 10 - AMX Nomenclature
4 K ADAK AMX 68000 Target Guide 1.3 AMX Nomenclature The following nomenclature standards have been adopted throughout the AMX TargetGuide. Numbers used in this manual are decimal unless otherwise indicated. Hexadecimalnumbers are indicated in the format 0xABCD or $ABCD . The terminology A(Table XYZ...
Page 11 - Symbol
AMX 68000 Target Guide K ADAK 5 1.4 AMX 68000 Target Specifications AMX 68000 was initially developed and tested using the Motorola MC68020, MC68040and MC68332 processors on a variety of Motorola evaluation boards. However, theAMX 68000 design criteria fully encompass the Motorola M68000 processor f...
Page 12 - Launch Requirements; Operating Mode
6 K ADAK AMX 68000 Target Guide 1.5 Launch Requirements The M68000 must be properly configured for use before AMX is launched. The mannerin which this is accomplished will depend on your target hardware implementation andon the startup code provided with your C compiler. AMX does not include bootstr...
Page 13 - Trace Controls; AMX alters the state of the status register (; Instruction and Data Caching
AMX 68000 Target Guide K ADAK rev6 7 Trace Controls AMX alters the state of the status register ( SR ) whenever it enables or disables interrupts. When AMX disables interrupts, it also clears the trace control bits ( T or T0 and T1 ) to 0. When AMX enables interrupts, the trace control bits remain u...
Page 14 - Big or Little Endian
8 K ADAK AMX 68000 Target Guide Memory Management Unit (MMU) The MC68030, MC68040, MC68LC040 and MC68060 include a Memory ManagementUnit (MMU) to support a demand-paged virtual memory environment. AMX does notsupport the M68000 memory management unit. If you are using AMX on the Motorola MC68000, MC...
Page 15 - Program Coding Specifications
AMX 68000 Target Guide K ADAK 9 2. Program Coding Specifications 2.1 Task Trap Handler AMX 68000 supports task traps for the M68000 zero divide, bounds check and overflowfaults. A zero divide fault occurs if any M68000 instruction attempts an integer divisionby zero. A bounds check fault occurs if t...
Page 16 - Task Scheduling Hooks
10 K ADAK AMX 68000 Target Guide 2.2 Task Scheduling Hooks There are four critical points within the AMX Task Scheduler. These critical pointsoccur when: a task is starteda task endsa task is suspendeda task is allowed to resume. AMX allows a unique application procedure to be provided for each of t...
Page 17 - The Processor Interrupt System; Interrupt Service Procedures
AMX 68000 Target Guide K ADAK 11 3. The Processor Interrupt System 3.1 Operation The M68000 classifies all internal and external sources of interruption as exceptions.The processor automatically determines the cause of the exception and then branchesindirectly through entries in the processor Except...
Page 18 - Default Exception Service Procedures
12 K ADAK AMX 68000 Target Guide Default Exception Service Procedures AMX provides default service procedures for most exceptions. The zero divide, boundscheck and overflow exceptions are serviced by AMX using its Task Trap Handlermechanism. All other exceptions handled by AMX are treated as fatal. ...
Page 19 - AMX Vector Table; AMX provides a set of; service procedures to allow you to dynamically access; Device Interrupts; all software traps are available for use by your application.
AMX 68000 Target Guide K ADAK 13 3.2 AMX Vector Table The M68000 processor provides an Exception Vector Table, often referred to as theAMX Vector Table, through which device interrupts are vectored and processor faults aretrapped. The position of entries in the table and the vector numbers used to r...
Page 21 - AMX Interrupt Priority and NMI; The M68000 interrupt priority mask in the status (; Non-Maskable Interrupt
AMX 68000 Target Guide K ADAK 15 3.3 AMX Interrupt Priority and NMI The M68000 family of processors offers inherent interrupt priority ordering. The AMXInterrupt Supervisor supports this feature and allows the nesting of interrupts for fastresponse to high priority events. The M68000 interrupt prior...
Page 24 - Nonconforming ISPs
18 K ADAK AMX 68000 Target Guide 3.5 Nonconforming ISPs The M68000 family of processors provides an interrupt priority ordering mechanismwhich permits the use of nonconforming ISPs within an AMX system. Sincenonconforming ISPs bypass the AMX Interrupt Supervisor, they cannot make use of anyAMX servi...
Page 25 - Processor Vector Initialization; one less
AMX 68000 Target Guide K ADAK rev7 19 3.6 Processor Vector Initialization Whenever an internal or external device interrupt occurs, the M68000 processorunconditionally vectors to a unique memory address determined by an entry in theprocessor Exception Vector Table. The code located at that address i...
Page 26 - This page left blank intentionally.
20 K ADAK AMX 68000 Target Guide This page left blank intentionally.
Page 27 - Target Configuration Module
AMX 68000 Target Guide K ADAK 21 4. Target Configuration Module 4.1 The Target Configuration Process Every AMX application must include a Target Configuration Module which defines the manner in which AMX is to be used in your target hardware environment. Theinformation in this file is derived from p...
Page 28 - Screen Layout; Figure 4.1-1 Configuration Manager Screen Layout
22 K ADAK AMX 68000 Target Guide Screen Layout Figure 4.1-1 illustrates the Configuration Manager's screen layout once you have begunto create or edit a Target Parameter File. The title bar identifies the Target Parameter Filebeing created or edited. Below the title bar is the menu bar from which th...
Page 29 - Menus; menu; menu
AMX 68000 Target Guide K ADAK 23 Menus All commands to the Configuration Manager are available as items on the menus presenton the menu bar. The File menu provides the conventional New , Open , Save and Save As... commands for creating and editing your Target Parameter File. It also provides the Exi...
Page 30 - Add, Edit and Delete Objects
24 rev8 K ADAK AMX 68000 Target Guide If you have modified some of the fields on a property page and then decide that thesemodified values are not correct, use the Undo Page command on the Edit menu or Toolbar to force the Configuration Manager to restore the content of all fields on the page to the...
Page 31 - Target Configuration Parameters; General Parameters; has no cache control, leave
AMX 68000 Target Guide K ADAK 25 4.2 Target Configuration Parameters General Parameters The General Parameter window allows you to define the general operating characteristicsof your AMX system within your target hardware environment. The layout of thewindow is shown in Figure 4.1-1 in Chapter 4.1. ...
Page 32 - Vectors in RAM; as is appropriate for such processors.; from
26 K ADAK AMX 68000 Target Guide Vectors in RAM In most cases, the processor Exception Vector Table will be located in alterable RAM ataddress 0 or at some alternate address provided by you. Therefore check this box. If your processor Exception Vector Table is in ROM, leave this box unchecked. In th...
Page 34 - Fatal Exceptions; exceptions are also serviced by AMX in order to
28 K ADAK AMX 68000 Target Guide Fatal Exceptions The Target Configuration Module defines the processor exceptions which are to beserviced by AMX and treated as fatal. These exceptions are specified by you bychecking the appropriate boxes in the Fatal Exception window. The layout of thewindow is sho...
Page 35 - conforming; To add an ISP definition, click on the; button. A new ISP with a default ISP root; button. Be careful because you cannot undo an ISP deletion.
AMX 68000 Target Guide K ADAK 29 4.3 Interrupt Service Procedure (ISP) Definitions Your Target Configuration Module must include a device ISP root for each conforming ISP which you intend to use in your application. The ISP roots are constructed for you by the AMX Configuration Builder from ISP desc...
Page 36 - ISP Type; ISP Root
30 K ADAK AMX 68000 Target Guide ISP Type At least one of your ISPs must service a clock interrupt which provides AMX with itsfundamental clock tick at the frequency and resolution defined in your AMX SystemConfiguration Module. To define your custom clock ISP , choose Clock Handler from the pull do...
Page 37 - Interrupt Handler Parameter; Prebuilt Clock ISPs
AMX 68000 Target Guide K ADAK 31 Interrupt Handler Parameter Your Interrupt Handler can be coded to receive a 32-bit parameter every time it is called.The Parameter Type field is a pull down list used to identify what kind of parameter, if any, your Interrupt Handler expects. If your Interrupt Handl...
Page 38 - Defining a Fast Clock ISP; as its; button and; as the; . Then fill in the description of the operating
32 K ADAK AMX 68000 Target Guide 4.4 Defining a Fast Clock ISP At least one of your ISPs must service a clock interrupt which provides AMX with itsfundamental clock tick at the frequency and resolution defined in your AMX SystemConfiguration Module. For many applications, your clock ISP will just be...
Page 40 - To add a null function, click on the; button. A new function named
34 K ADAK AMX 68000 Target Guide 4.5 Null Functions Occasionally, while developing an AMX application, it can be very convenient to be ableto create software functions to satisfy your program link requirements without having tocreate the final version of these functions. For example, if your AMX Sys...
Page 41 - ROM Option Parameters
AMX 68000 Target Guide K ADAK 35 4.6 ROM Option Parameters The AMX ROM Option allows the subset of AMX and its managers required by yourapplication to be linked together without any application code to form a separate AMXROM image. The resulting AMX ROM can be located anywhere in your memoryconfigur...
Page 42 - Enable ROM Option
36 K ADAK AMX 68000 Target Guide Enable ROM Option By default, the ROM Option feature is disabled. Check this box to enable the feature.You can disable the feature by removing the check from the box. ROM Address You must define the absolute physical ROM address at which the AMX ROM image is tobe loc...
Page 43 - Clock Driver Operation; Clock Startup
AMX 68000 Target Guide K ADAK 37 5. Clock Drivers 5.1 Clock Driver Operation You must provide a clock driver as part of your AMX application so that AMX canprovide timing services. AMX clock drivers are provided with AMX for the timer chipsused on the boards with which AMX has been tested. These dri...
Page 44 - Clock Interrupts; Clock Shutdown
38 K ADAK AMX 68000 Target Guide Clock Interrupts A real-time clock used with the M68000 processor will interrupt either on one of theinterrupt autovectors or on a user defined vector. In either case, the processor willautomatically dispatch through its Vector Table to your clock ISP. The clock ISP ...
Page 45 - Custom Clock Driver
AMX 68000 Target Guide K ADAK 39 5.2 Custom Clock Driver The easiest way to create a custom clock driver is by example. Assume that thecounter/timer which you intend to use for your AMX clock is characterized as follows: The I/O base address of the clock is at 0xFFA00100 . The clock interrupt is gen...
Page 46 - into your list of Restart Procedures provided in
40 K ADAK AMX 68000 Target Guide The clock initialization procedure for this custom clock driver could be coded in C asfollows. Insert procedure clockinit into your list of Restart Procedures provided in your System Configuration Module at the point at which you wish the clock to beenabled during th...
Page 47 - AMX Clock Drivers; chip support
AMX 68000 Target Guide K ADAK 41 5.3 AMX Clock Drivers AMX clock drivers are provided with AMX for the timer chips used on the boards withwhich AMX has been tested. These drivers are ready for use as described in this chapter.The clock drivers are delivered in chip support source files having names ...
Page 48 - Source code; Porting the MC68360 PIT Clock Driver
42 K ADAK AMX 68000 Target Guide 5.3.2 MC68360 PIT Clock Driver The AMX clock driver for the Motorola MC68360 Periodic Interval Timer (PIT) is readyfor use on the Motorola M68360QUADS Application Development System board. It isconfigured to operate at approximately 1 KHz (1 ms period). Source code f...
Page 51 - Appendix A. Target Parameter File Specification; utility
AMX 68000 Target Guide K ADAK A-1 Appendix A. Target Parameter File Specification A.1 Target Parameter File Structure The Target Parameter File is a text file structured as illustrated in Figure A.1-1. This filecan be created and edited by the AMX Configuration Manager, a Windows ® utility provided ...
Page 53 - A.2 Target Parameter File Directives; AMX Launch Parameters
AMX 68000 Target Guide K ADAK rev6 A-3 A.2 Target Parameter File Directives The AMX Launch Parameters are defined as follows. ...LAUNCH PERM,VNA PERM 0 if the AMX launch is temporary1 if the AMX launch is permanent VNA 0 if the AMX Vector Table entries are to be alterable1 if the AMX Vector Table en...
Page 54 - Vector Base Register
A-4 K ADAK AMX 68000 Target Guide Vector Base Register The VBR parameter is used to specify the memory address at which the Exception Vector Table is located. For most applications, the Exception Vector Table is located at address0. You can use the VBR parameter to redefine the location of the Excep...
Page 55 - Null Function Declarations
AMX 68000 Target Guide K ADAK A-5 Device I/O Delay The Target Parameter File includes a device I/O delay definition. ...DELAY CPUFREQ CPUFREQ M68000 processor instruction execution frequency (MHz) The ...DELAY directive allows you to condition the delay loop of the AMX device I/O delay procedure cjc...
Page 56 - Conforming ISP Declarations
A-6 K ADAK AMX 68000 Target Guide Conforming ISP Declarations The Target Parameter File must include a definition of an ISP root for each conformingInterrupt Service Procedure (ISP) which you intend to use in your application. The ISProot definition is provided using one of the following directives....
Page 57 - AMX Clock Handler Declaration
AMX 68000 Target Guide K ADAK A-7 AMX Clock Handler Declaration The Target Parameter File must include a definition of an ISP root for your AMX clockhandler. The clock ISP root definition must be provided using one of the followingdirectives. The clock ISP root is declared using ...CLKC if its Inter...
Page 59 - AMX ROM Option
AMX 68000 Target Guide K ADAK A-9 AMX ROM Option To use the AMX ROM option, the Target Parameter File must include the followingdirectives. ...ROMOPT ROMADR,RAMADR ...ROMSM ;Semaphore Manager ...ROMEM ;Event Manager ...ROMMB ;Mailbox Manager ...ROMMX ;Message Exchange Manager ...ROMBM ;Buffer Manage...
Page 61 - A.3 Porting the Target Parameter File; from the AMX 68000 Target Configuration
AMX 68000 Target Guide K ADAK A-11 A.3 Porting the Target Parameter File It is expected that you will use the AMX Configuration Manager to create and edit yourTarget Parameter File. If you are unable to use the AMX Configuration Manager utility,you will have to create and edit your Target Parameter ...
Page 63 - Appendix B. AMX 68000 Service Procedures; Interrupt Control (class; Processor and C Interface Procedures (class
AMX 68000 Target Guide K ADAK rev7 B-1 Appendix B. AMX 68000 Service Procedures B.1 Summary of Services AMX 68000 provides a collection of target dependent AMX service procedures for usewith the M68000 processor and compatibles and the C compilers which support them.These procedures are summarized b...
Page 65 - B.2 Service Procedures; Purpose; Setup
AMX 68000 Target Guide K ADAK rev7 B-3 B.2 Service Procedures A description of all processor dependent AMX 68000 service procedures is provided inthis appendix. The descriptions are ordered alphabetically for easy reference. Italics are used to distinguish programming examples. Procedure names and v...
Page 68 - cjcfdi
B-6 K ADAK AMX 68000 Target Guide cjcfdi cjcfdi cjcfei cjcfei Purpose Disable or Enable Interrupts Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure (cjcfdi only) Setup Prototype in file CJZZZTF.H or macro in file CJZZZCC.H . #include "CJZZZ.H"void CJ_CCPP cjcfdi(vo...
Page 69 - cjcfflagrd
AMX 68000 Target Guide K ADAK B-7 cjcfflagrd cjcfflagrd cjcfflagwr cjcfflagwr Purpose Read or Write Processor Status Register Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup Prototype in file CJZZZTF.H or macro in file CJZZZCC.H . #include "CJZZZ.H"CJ_TYFLAG...
Page 72 - cjcfin8; Prototype in file; is the address of an 8, 16 or 32-bit memory-mapped device input
B-10 K ADAK AMX 68000 Target Guide cjcfin8 cjcfin8 cjcfin16 cjcfin16 cjcfin32 cjcfin32 Purpose Read an 8, 16 or 32-Bit Input Port Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup Prototype in file CJZZZTF.H or macro in file CJZZZCC.H . #include "CJZZZ.H"CJ_T8...
Page 73 - cjcfjlong
AMX 68000 Target Guide K ADAK B-11 cjcfjlong cjcfjlong cjcfjset cjcfjset Purpose cjcfjset Sets a Mark for a Long Jumpcjcfjlong Long Jumps to that Mark These procedures are provided for AMX portability. They are notreplacements for C library procedures longjmp or setjmp although they function in a si...
Page 74 - Example; See Also
B-12 K ADAK AMX 68000 Target Guide Example #include "CJZZZ.H" void CJ_CCPP dowork(struct cjxjbuf *jbp); static struct cjxjbuf jumpbuffer; #define STACKSIZE 512 /* Stack size (longs) */ #define STACKDIR 1 /* 0=grows up; 1=grows down */ static long newstack[STACKSIZE]; #if (STACKDIR == 1)#defi...
Page 75 - cjcfmcopy
AMX 68000 Target Guide K ADAK B-13 cjcfmcopy cjcfmcopy cjcfmset cjcfmset Purpose Copy a Block of MemorySet (Fill) a Block of Memory These procedures are provided for AMX portability. They are notreplacements for C library procedures memcpy or memset . Used by n Task n ISP n Timer Procedure n Restart...
Page 76 - cjcfout8
B-14 K ADAK AMX 68000 Target Guide cjcfout8 cjcfout8 cjcfout16 cjcfout16 cjcfout32 cjcfout32 Purpose Write to an 8, 16 or 32-Bit Output Port Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup Prototype in file CJZZZTF.H or macro in file CJZZZCC.H . #include "CJZZZ....
Page 78 - cjcftag
B-16 K ADAK AMX 68000 Target Guide cjcftag cjcftag Purpose Convert a String to an Object Name Tag Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup Prototype is in file CJZZZTF.H . #include "CJZZZ.H"CJ_TYTAG CJ_CCPP cjcftag(char *tag); Description tag is a poi...
Page 79 - cjcfvol8
AMX 68000 Target Guide K ADAK B-17 cjcfvol8 cjcfvol8 cjcfvol16 cjcfvol16 cjcfvol32 cjcfvol32 cjcfvolpntr cjcfvolpntr Purpose Fetch a Volatile 8-Bit, 16-Bit, 32-Bit or Pointer Value Use these procedures to fetch the content of a volatile variable if the Ccompiler does not support the C keyword volati...
Page 81 - cjksitrap; Prototype is in file; Zero divide trap; Error status is returned.; is not a vector number for which task traps
AMX 68000 Target Guide K ADAK B-19 cjksitrap cjksitrap Purpose Install a Task Trap Handler Used by n Task o ISP o Timer Procedure o Restart Procedure n Exit Procedure Setup Prototype is in file CJZZZIF.H . #include "CJZZZ.H"CJ_ERRST CJ_CCPP cjksitrap(int trapid, CJ_TRAPPROC handler); Descrip...
Page 82 - cjksivtp
B-20 K ADAK AMX 68000 Target Guide cjksivtp cjksivtp Purpose Fetch Pointer to the AMX Vector Table Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup Prototype is in file CJZZZIF.H . #include "CJZZZ.H"void * CJ_CCPP cjksivtp(void); Interrupts o Disabled o Enabl...
Page 83 - cjksivtrd; is a pointer to storage for a copy of the Interrupt Service; None
AMX 68000 Target Guide K ADAK B-21 cjksivtrd cjksivtrd Purpose Read from the AMX Vector Table Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup Prototype is in file CJZZZIF.H . #include "CJZZZ.H"CJ_ERRST CJ_CCPP cjksivtrd(int vector, CJ_ISPPROC *oldproc); Desc...
Page 84 - is a pointer to the new Interrupt Service Procedure.
B-22 K ADAK AMX 68000 Target Guide cjksivtwr cjksivtwr Purpose Write to the AMX Vector Table Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup Prototype is in file CJZZZIF.H . #include "CJZZZ.H"CJ_ERRST CJ_CCPP cjksivtwr(int vector, CJ_ISPPROC newproc); Descri...
Page 85 - cjksivtx
AMX 68000 Target Guide K ADAK B-23 cjksivtx cjksivtx Purpose Exchange an Entry in the AMX Vector Table Used by n Task n ISP n Timer Procedure n Restart Procedure n Exit Procedure Setup Prototype is in file CJZZZIF.H . #include "CJZZZ.H"CJ_ERRST CJ_CCPP cjksivtx(int vector, CJ_ISPPROC newproc...
Page 87 - Selecting AMX ROM Options; To support an AMX ROM system, the following files are provided.
AMX 68000 Target Guide K ADAK C-1 Appendix C. AMX 68000 ROM Option An AMX system can be configured in two ways. The particular configuration is chosento best meet your application needs. Most AMX systems are linked. Your AMX application is linked with your SystemConfiguration Module, your Target Con...
Page 88 - Creating an AMX ROM
C-2 K ADAK AMX 68000 Target Guide Creating an AMX ROM The AMX ROM is created by using the AMX Configuration Generator to produce aROM Option Module which is then linked with the AMX Library to form an AMX ROMimage. The Configuration Generator combines the information in your Target Parameter Filewit...
Page 89 - Linking for AMX ROM Access
AMX 68000 Target Guide K ADAK C-3 Linking for AMX ROM Access The AMX Configuration Generator is used to produce a ROM Access Module which,when linked with your application, provides access to AMX in the AMX ROM. The Configuration Generator combines the information in your Target Parameter Filewith t...
Page 90 - Moving the AMX ROM
C-4 K ADAK AMX 68000 Target Guide Once linked, your AMX application can be downloaded into RAM memory in your targethardware configuration. Alternatively, your application can be transferred to ROM usingthe same techniques that were used to produce the AMX ROM. Regardless of themanner in which your ...