MICRONOTES
================================================================================
Note 16.0                  KXT11-CA Development Tools                 No replies
JAWS::KAISER                                        388 lines  25-MAR-1985 09:21
--------------------------------------------------------------------------------
     +---------------+					  +-----------------+
     | d i g i t a l |					  |  uNOTE # 016    |
     +---------------+					  +-----------------+


     +----------------------------------------------------+-----------------+
     | Title:  KXT11-CA Software Development Tools	  | Date: 16-OCT-84 |
     +----------------------------------------------------+-----------------+
     | Originator: Scott Tincher			  | Page 1 of 7	    |
     +----------------------------------------------------+-----------------+


     The KXT11-CA is a single board computer (SBC) which executes the PDP-11
     instruction set.  It may be utilized as a stand-alone SBC or interfaced
     to	 the  Q-bus  as	 a  peripheral	processor  or  as an intelligent I/O
     processor	 (IOP).	 This  article	will  describe	the  software  tools
     available to develop applications in either the stand-alone mode or the
     IOP mode.

     The KXT11-CA features:

	     o	T11  Microprocessor  which  implements the PDP-11
		instruction set

	     o	32K bytes of on-board static RAM

	     o	Two  28-pin  sockets  for  up  to  16K	bytes  of
		additional RAM or 32K bytes of ROM

	     o	Three serial line units:

		 o  One asynchronous DL compatible line (RS232)
		 o  One	 synch/asynch  line  with  modem  control
		    (RS449)
		 o  One	 synch/asynch  with  data and timing only
		    (RS449)

	     o	20 programmable parallel I/O lines

	     o	Three 16-bit programmable interval timers

	     o	2-channel DMA controller

	     o	Q-bus interface

	     o	Four diagnostic LEDs

     The  Q-bus	 interface  of	the KXT11-CA allows up to 14 KXT11-CAs to be
     added  to	a  traditional Q-bus system.  As a slave device the KXT11-CA
     offloads the arbiter CPU's processing activities by providing real-time
     I/O data buffering, preprocessing, and high speed communications.

     The  KXT11-CA  is	especially  suited  for	 applications  with critical
     interrupt latency requirements or applications that must service a high
     frequency	of  interrupts.	   The	KXT11-CA  may  also  be	 used  as  a
     computational  engine in applications where it is possible to partition
     the application to run in parallel.


								      Page 2

     The   software   development  environment	for  systems  which  utilize
     KXT11-CAs	is  slightly  different	 from  that of the traditional Q-bus
     system.	The  system programmer must develop application programs for
     each  KXT11-CA in	the system in addition to the application code which
     runs  on  the  arbiter  CPU.   Different software application tools are
     available	for  the  arbiter and "onboard" environments.  (When used in
     stand-alone mode only the onboard environment need be considered.)


     THE ARBITER ENVIRONMENT

     The  arbiter  system  may	run  under  any	 of  the following operating
     systems:

	     o	MicroPower/Pascal

	     o	RT-11

	     o	RSX-11M

	     o	RSX-11M-PLUS

     Each  of  these  operating	 systems  offers  a  device  handler for the
     two-port  RAM  of	the  KXT11-CA  as  well	 as  a	utility	 for loading
     application   programs   across   the  Q-bus  into	 the  KXT11-CA.	   A
     MicroPower/Pascal	application  may  be  coded  in Pascal and MACRO-11.
     RT-11 and RSX-11 applications will be coded in MACRO-11 or a high level
     language,	such  as  FORTRAN,  which  is  capable of issuing programmed
     requests (RT-11) or QIO directives (RSX-11).


     USING A MICROPOWER/PASCAL ARBITER SYSTEM

     If	 the  arbiter  system  controlling  the	 application is running in a
     MicroPower/Pascal	environment  there  are	 KXT11-CA specific functions
     available to aid in program development.  The first component is the KX
     device  handler.	 This handler provides the arbiter-side interface to
     the  two-port  RAM	 of  the KXT11-CA.  The KX handler supports up to 14
     KXT11-CAs	on the Q-bus.  Two functions are supplied which simplify the
     interface	between	 the  application program and the KX handler.  These
     functions are:

	     o	KX_write_data:	  Transfer  data  from an arbiter
		buffer	 to  a	KXT11-CA  process  and	return	a
		completion-status value.

	     o	KX_read_data:	 Transfer  data	 from  a KXT11-CA
		process	  to  an  arbiter  buffer  and	return	a
		completion-status value.

     MicroPower/Pascal	 also	provides   a   function	 which	transfers  a
     MicroPower/Pascal	.MIM  file  from  the  arbiter	to a KXT11-CA.	This
     function,	KXT_LOAD, reads a .MIM file from the arbiter and initiates a
     DMA  transfer using the DTC of the KXT11-CA to transfer the file to the
     KXT11-CA's	 local	memory.	 This procedure may be called at any time by
     the  arbiter's  application program - not necessarily at system startup
     time.


								      Page 3

     MicroPower/Pascal	also  supplies the symbolic debugger PASDBG.  PASDBG
     supplies the following features:

	     o	A  set	of  debugger commands and qualifiers that
		allow for control of an executing program.

	     o	Access	to  the	 symbol	 table	generated  by the
		Pascal	 compiler,   providing	symbolic  (Pascal
		language) referencing and variable access.

	     o	Access	 to   process	control	  variables   and
		structures.

	     o	Control	 of  an application system not configured
		for terminal I/O.

	     o	A  method  for	user  control  after an execution
		error.

	     o	A method for loading a program on the application
		system	 while	 PASDBG	 is  running  on  a  host
		computer.



     USING AN RT-11 OR RSX-11 ARBITER SYSTEM

     If the arbiter system controlling the application is running in a RT-11
     or	 RSX-11	 environment there are tool kits available to aid in program
     development.   They are the KXT11-C/RT-11 Peripheral Processor Tool Kit
     (QJV51) and the KXT11-C/RSX-11 Peripheral Processor Tool Kit (QJV52).

     There  are	 two  major components in each of these tool kits.  They are
     the KX device handler and the KUI utility program.

     The  KX  device handler manipulates the two-port RAM of the KXT11-CA so
     that  it  appears	to  be a standard Q-bus I/O device.  The KUI utility
     program  allows  programs to be loaded into a peripheral processor from
     the arbiter, performs debugging operations, starts execution of KXT11-C
     programs, and initiates KXT11-CA selftests.


     The  KX  handler  supplied	 with the RT-11 tool kit supports up to four
     KXT11-CAs	where each KXT11-CA appears as two logical units.  More than
     four  KXT11-CAs  may  be supported by editing, renaming, and rebuilding
     the KX handler.

     The  following  RT-11  programmed	requests  are  supported  by  the KX
     handler:

	     o	.OPEN	-  associates  a  user-specified  channel
		number	 with	a  logical  unit  number  of  the
		KXT11-CA.

	     o	.CLOSE	-  frees  a previously opened channel for
		use with another device or file.


								      Page 4

	     o	.READ	-   transfers	data  from  a  peripheral
		processor  to an arbiter buffer.  (.READ, .READW,
		.READC)

	     o	.WRITE - transfers data from an arbiter buffer to
		a   peripheral	 processor.    (.WRITE,	 .WRITEW,
		.WRITEC).


     The  KX  handler  supplied	 with  the RSX-11 tool kit supports up to 14
     KXT11-CAs.	 The  KX handler assigns a unit number for each data channel
     in	 each  KXT11-CA	 two-port  RAM.	 This handler supplies the following
     RSX-11 I/O requests:

	     o	IO.RVB	-  Read	 a virtual block of data from the
		device unit unit specified in the macro call.

	     o	IO.WVB	-  Write  a  virtual  block  of data to a
		physical device unit.

	     o	IO.ATT	- Attach a physical device to the control
		of the task which issued the request.

	     o	IO.DET	-  Detach  a  physical	device	from  the
		control of the task which issued the request.


     Included  in  the	RT-11 and RSX-11 tool kits is the KUI (KXT11-CA User
     Interface) utility program.  The KUI program has several commands which
     supply the following functions:

	     o	@  - Process commands from the specified indirect
		command file.

	     o	CLOSE  -  Close	 the  file  specified  in the LOG
		command.

	     o	EXECUTE	 -  Start  a  program  on  the	specified
		KXT11-CA.

	     o	EXIT  -	 Exit  the  KUI utility and return to the
		operating system.

	     o	LOAD  -	 Load  a  program from the arbiter's mass
		storage	 to  arbiter  memory.  Then perform a DMA
		operation  to transfer the image to the specified
		peripheral  processor's	 memory.  KUI under RT-11
		supports  the  transfer	 of  .SAV, .LDA, and .MIM
		files.	KUI under RSX-11 supports the transfer of
		.TSK and .MIM files.

	     o	LOG  -	Record	all commands, status information,
		and  messages during this terminal session in the
		specified file.	 The CLOSE command terminates the
		logging session.


								      Page 5

	     o	ODT  -	Executes  the octal debugging tool (ODT).
		This  tool  allows  the arbiter system to examine
		and  modify  the contents of registers and memory
		local  to  a  KXT11-CA.	  ODT may also be used to
		start or halt a program.

	     o	REINIT	-  Reinitialize	 the specified peripheral
		processor and reboot it's application.

	     o	RESUME	-  Causes  a  SUSPENDed	 command  file to
		continue execution.

	     o	SELFTEST   -   Causes  one  or	more  of  several
		diagnostic programs to execute.

	     o	SET  -	Specifies  a  peripheral processor as the
		target for subsequent commands.

	     o	SHOW  -	 Displays  information about the state of
		the peripheral processor.

	     o	SUSPEND	 -  Used  in  an indirect command file to
		halt  execution	 of the file.  The RESUME command
		can return control to the command file.

	     o	TRAP  -	 performs a trap emulation so that a trap
		handling routine can be tested.



     THE ONBOARD PROGRAMMING ENVIRONMENT

     The KXT11-CA may be programmed in either MACRO-11 or MicroPower/Pascal.
     MicroPower/Pascal	provides  the ability to program the onboard devices
     in	 a  high-level	language,  Pascal.   In particular MicroPower/Pascal
     provides the following device handlers:

	     o	DD:    This handler supports the TU58 tape drive.
		It allows the TU58 to be interfaced to any of the
		asynchronous I/O channels.

	     o	KK:    This  handler manipulates the two-port RAM
		from  the  KXT11-CA  side  in the KX/KK protocol.
		This  protocol	allows	the  KK	 handler  to pass
		variable length messages to the arbiter system by
		emulating  a traditional Q-bus slave device.  Two
		functions   are	  supplied   which  simplify  the
		interface  between  the	 user's	 application code
		and the KK handler.  These functions are:

		 o  KK_read_data:  transfer data from the arbiter
		    to	 a   KXT11-CA	buffer	 and   return	a
		    completion-status value.

		 o  KK_write_data:  transfer data from a KXT11-CA
		    buffer   to	  the	arbiter	  and	return	a
		    completion-status value.


								      Page 6

	     o	QD:    This  handler supports the two-channel DMA
		transfer   controller  (DTC).	 The  QD  handler
		enables	 the  DTC  to  move  data  from source to
		destination  without  the  aid	of  the CPU.  One
		location, source or destination, must be local to
		the KXT11-CA.  The QD handler may be used for the
		following functions:

		 o  Transfer data to and from Q-bus memory.

		 o  Transfer data to and from local memory.

		 o  Search for data.

		 o  Transfer to and from local I/O devices.

		 o  Access the Q-bus I/O page.

		 o  Assure access to a DMA Channel.

	     o	XL:   Supports asynchronous communications on the
		three  serial  ports  of the KXT11-CA.	The first
		port is a standard DL device.  The second port is
		channel	 A  of	the  multiprotocol  chip.    This
		channel	 is  supported	with full modem controls.
		The  third port is channel B of the multiprotocol
		chip.	 This  channel	is supported as though it
		were a standard DL device.    All  three channels
		may be operated simultaneously.

	     o	XS:   Supports synchronous operation of channel A
		of  the multiprotocol chip.  The handler provides
		the    following    bit-oriented    communication
		procedures:

		 o  Synchronization  (Flag detection)

		 o  Transparency  (Bit stuffing)

		 o  Invalid frame detection

		 o  Frame abortion detection

		 o  Frame	 check	     sequence	    (FCS)
		    checking/calculation

	     The  handler can be used by user-written software as
	     a	component  in  performing  bit-oriented protocols
	     such as X.25, HDLC, SDLC, and others.

	     o	YK:  Supports the parallel I/O port and the three
		counter-timers.	     The   handler  provides  the
		functions  of  read,  write, pattern recognition,
		DMA   read,   DMA   write,   counter-timer   set,
		counter-timer	read,  and  counter-timer  clear.
		Typical parallel port operations are:


								      Page 7
		 o  Transferring  a  series  of	 bytes	or  words
		    through a port with handshake protocol.

		 o  Setting or reading the bits of external state
		    lines.

		 o  Generating a time base to software.

		 o  Generating a waveform for external output.

		 o  Counting pulses from an external input.

     These  MicroPower/Pascal  device  handlers	 do  not  support all of the
     functions	of the onboard devices of the KXT11-CA.	 For this reason, or
     because  of  preference, the application code for the KXT11-CA may also
     be written in MACRO-11.



     RELATED DOCUMENTS

     For  further  information	pertaining to the KXT11-CA and it's software
     development tools please reference the following materials:

     KXT11-CA Single-Board Computer User's Guide	     EK-KXTCA-UG

     KXT11-C Peripheral Processor Software User's Guide	     AA-Y615A-TK