Allen-Bradley 1784-KTXD Reference guide

Type
Reference guide

This manual is also suitable for

1784KTx Scanner
(Catalog Nos. 1784-KTX, -KTXD, and -KTS)
Reference Manual
Allen-Bradley Parts
Because of the variety of uses for the products described in this
publication, those responsible for the application and use of this control
equipment must satisfy themselves that all necessary steps have been taken
to assure that each application and use meets all performance and safety
requirements, including any applicable laws, regulations, codes and
standards.
The illustrations, charts, sample programs and layout examples shown in
this guide are intended solely for purposes of example. Since there are
many variables and requirements associated with any particular
installation, Allen-Bradley does not assume responsibility or liability
(to include intellectual property liability) for actual use based upon the
examples shown in this publication.
Allen-Bradley publication SGI-1.1, Safety Guidelines for the Application,
Installation, and Maintenance of Solid State Control (available from your
local Allen-Bradley office), describes some important differences between
solid-state equipment and electromechanical devices that should be taken
into consideration when applying products such as those described in this
publication.
Reproduction of the contents of this copyrighted publication, in whole or
in part, without written permission of Allen-Bradley Company, Inc., is
prohibited.
Throughout this manual we use notes to make you aware of safety
considerations:
ATTENTION: Identifies information about practices or
circumstances that can lead to personal injury or death, property
damage or economic loss.
Attention statements help you to:
identify a hazard
avoid the hazard
recognize the consequences
Important: Identifies information that is critical for successful application
and understanding of the product.
Important User Information
About This Manual P1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Objectives of This Manual P1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Audience P1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Conventions P1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About the Examples P1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Related
Publications
P2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Understanding I/O Scanner Concepts 11. . . . . . . . . . . . . . . .
Chapter Preview 11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How Does the Scanner Relate to I/O 11. . . . . . . . . . . . . . . . . . . . . .
I/O Addressing 13. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What the Scanner Does 16. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operating Modes 17. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dualport
RAM
17. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Host
Responsibilities
18. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What's
Next
19. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Startup and Shutdown 21. . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter Preview 21. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the KTx Memorymapped Hardware 21. . . . . . . . . . . . . . . . . .
Running Diagnostics on the KTx Card 23. . . . . . . . . . . . . . . . . . . . .
Running
the Host Compatibility T
est 27. . . . . . . . . . . . . . . . . . . . . . .
Loading the Protocol File 210. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Initialization 212. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Shutdown 214. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What's
Next
214. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Programming Overview 31. . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter Preview 31. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dualport Layout 31. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adapter
Status T
able 31. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I/O Image Tables 32. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Command Interface 32. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Confirmation Handshaking 33. . . . . . . . . . . . . . . . . . . . . . . . . . .
Handling Host Interrupts 34. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing and Enabling the Interrupt 35. . . . . . . . . . . . . . . . . . . . . . .
Writing the Interrupt Service Handler 36. . . . . . . . . . . . . . . . . . . . . .
What's
Next
38. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents
Allen-Bradley Parts
Table of Contentsii
Issuing Scanner Management Commands 41. . . . . . . . . . . . .
Chapter Preview 41. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Basic Command and Confirmation Structures 41. . . . . . . . . . . . . . . .
Host Commands 42. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What's
Next
412. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Issuing Blocktransfer Commands 51. . . . . . . . . . . . . . . . . . .
Chapter Preview 51. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How Block Transfer Works 51. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adapter Decide Length (ADL) 52. . . . . . . . . . . . . . . . . . . . . . . . . . .
Host BT Write 52. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Host BT Read 56. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Time
to Completion
59. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Unsolicited Block Transfer 510. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What's
Next
510. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reporting KTx Scanner Status 61. . . . . . . . . . . . . . . . . . . . . .
Chapter Preview 61. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operating Status Word 62. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adapter
Status T
able 63. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KTx Hardware Status Register 66. . . . . . . . . . . . . . . . . . . . . . . . . .
Using the LEDs as Status Indicators 66. . . . . . . . . . . . . . . . . . . . . .
Exception/Error Handling 66. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What's
Next
69. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Understanding Discrete I/O 71. . . . . . . . . . . . . . . . . . . . . . . .
Direct Image Table Access 71. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
To access a single input terminal, 72. . . . . . . . . . . . . . . . . . . . . . . .
To
set a single output terminal,
72. . . . . . . . . . . . . . . . . . . . . . . . . .
To reset (clear) a terminal is a little trickier; 72. . . . . . . . . . . . . . . . . .
Timing
of Discrete I/O
73. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input Change of State (COS) Detection 76. . . . . . . . . . . . . . . . . . . .
Interrupt at End of Scan List 77. . . . . . . . . . . . . . . . . . . . . . . . . . . .
What's
Next
77. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dualport Layout A1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix Preview A1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Programming Examples B1. . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix Preview B1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About the Examples B2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents iii
KTx Hardware Registers C1. . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix Preview C1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Glossary D1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix Preview D1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Support Services 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Allen-Bradley Parts
Preface
P-1
About This Manual
Use this document to understand, program, and employ the scanner
function of the 1784-KTX, 1784-KTXD, and 1784-KTS Communication
Interface cards.
In this document, we refer to the 1784-KTX, 1784-KTXD, and 1784-KTS
cards collectively as “1784-KTx” or “scanner.”
To use this product effectively, you must be familiar with:
C programming
Allen-Bradley programmable controllers
We wrote this document for application programmers.
We use these conventions in this manual:
command names look like this: Set Mode
variables and function names look like this: get_scan_list
program constants and macros look like this: SUCCESS or
INIT_IN_PROGRESS
We designed the examples in this manual to introduce the application
programmer to the host-to-KTx interface and commands. The examples
demonstrate all of the host-to-KTx commands as well as other common
tasks, such as:
reading and writing the I/O image tables
reading the status table
start-up and shutdown
watchdog timer
Unlike a typical application program, these example programs are not
designed to take advantage of the KTxs ability to interrupt the host when a
host-to-KTx command reaches completion. Some commands, such as
block transfers, are given 4 seconds by the KTx to complete their tasks
before the KTx declares a timeout error. For most applications it would be
impractical to suspend processing for this length of time.
Objectives
of This Manual
Audience
Conventions
About the Examples
Preface
About This Manual
P-2
Source code for an interrupt service routine has been included to
demonstrate how an application might handle KTx interrupts. The interrupt
service routine has not been integrated with the rest of the example source
code. That task has been left to the application programmer.
Publication Title Pub. No.
1784KTx Dualport Interface Specification Reference Manual
17846.5.21
1784KTx Communication Interface Card User Manual 17846.5.22
1784CP12 Cable Packing Data 17842.41
1784CP13 Cable Packing Data 17842.44
I/O Concepts Manual for Industry Bus Products 6008-6.5.1
Data Highway/Data Highway Plus/Data Highway II/
Data Highway485 Cable Installation Manual
17706.2.2
Related
Publications
Allen-Bradley Parts
Chapter
1
1-1
Understanding I/O Scanner Concepts
This chapter explains basic concepts and provides an overview of the
operation of the PC I/O scanner. After reading this chapter you should
understand how:
information moves between your program and the outside world
your program can issue commands to affect operation of the scanner
The scanner uses the remote I/O protocol to communicate with
Allen-Bradley I/O modules. You don’t have to know the specifics of the
protocol to use the scanner with the I/O modules, but you do need to know
a few terms.
The scanner is an Allen-Bradley communication card, which requires a
16-bit backplane, that you install in a compatible host computer (or host).
PC Hardware
Host
PC
I/O Protocol
1784KTx
I/O Hardware
Processor
(e.g., 80486)
Remote I/O
Module
Chapter
Preview
How Does the Scanner
Relate to I/O
Chapter 1
Understanding I/O Scanner Concepts
1-2
I/O modules sit in one or more chassis. An I/O chassis is a housing that
holds one adapter and as many as 16 I/O modules. The adapter is the
communication interface between the scanner and the chassis. The scanner
communicates with the adapter through Allen-Bradley-approved cable.
In turn, the adapter monitors and controls the I/O modules through the
backplane of the chassis. You can combine chassis in any way that results
in as many as 32 adapter addresses.
Host
KTx Scanner
Remote I/O Cable
Adapter
I/O Chassis
14652
Processor
Adapter
Adapter
Adapter
I/O Chassis
I/O Chassis
I/O Chassis
I/O chassis can contain 8bit, 16bit, or 32bit
discrete I/O modules, analog, and/or intelligent
I/O modules.
EISA/ISA Bus
We can divide I/O, and therefore I/O modules, into discrete and
intelligent modules.
Allen-Bradley Parts
Chapter 1
Understanding I/O Scanner Concepts
1-3
Discrete I/O is characterized by one terminal (or point) per I/O image table
bit. Your program handles discrete I/O through I/O image tables, where
each input or output terminal corresponds to one of the 4096 input and
4096 output image table bits (256 x 16 bits = 4096 bits).
The input image table is an area of memory that monitors the terminals of
discrete input modules. When an input switch is closed, the corresponding
bit is set to 1. The output image table is an area of memory that controls
output terminals of output modules. After a bit is set to 1, the
corresponding switch is closed or the terminal is energized.
A standard-density module is a discrete input or output module that has 4,
6, or typically 8 input or output terminals. A high-density module is a
discrete input or output module that has 16 input or output terminals. A
quad-density module is a discrete input or output module that has 32 input
or output terminals.
Intelligent I/O is characterized by the transmission of one or more 16-bit
words in a particular format to or from an I/O module. A block transfer
(BT) is the transmission of data to or from an intelligent I/O module.
A BT read transfers information (typically analog input and status data)
from the module to the host; a BT write transfers data (typically analog
output and configuration data) from the host to the module.
You assign each adapter an I/O rack number (0 – 31) by setting switches
on the adapter. A logical rack may be a single chassis; or two to four
chassis may comprise one rack number; or a single chassis can be
addressed as two racks. It is not necessary to assign rack numbers
sequentially: for instance, you could have a full rack 0, half a rack in rack
3, and a quarter rack in groups 6-7 of rack 7.
For addressing purposes, each rack is equivalent to a block of 8 I/O groups
in the I/O image table. Groups within a rack are numbered 0 through 7.
An I/O group is two 16-bit words, one from the output image table and one
from the input image table, with the same address. Refer to the I/O
Concepts Manual, publication 6008-6.5.1, for more information. In most
applications, only the input word or only the output word is used in any
given I/O group.
I/O Addressing
Chapter 1
Understanding I/O Scanner Concepts
1-4
Here is an example layout of the output image table showing the first
8 racks:
Group
word #
(hex) rack
0 1 2 3 4 5 6 7
00-07 0 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
08-0F 1 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
10-17 2 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
18-1F 3 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
20-27 4 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
28-2F 5 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
30-37 6 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
38-3F 7 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
The word numbers above can be used as subscripts. (We’ll look closely at
that in chapter 6, Discrete I/O.) Each 16-bit word corresponds to 16
discrete I/O terminal positions, terminal 17 octal (15 decimal) to the
high-order bit and terminal 00 to the low-order bit.
Just as each I/O group has an address, so does each adapter. Adapter
addresses are used in the scan list (see page 1-6, What the Scanner Does).
The adapter address is the address of the first I/O group covered by the
adapter, divided by 2. This is numerically the same as (rack x 4) + (starting
group / 2), where the rack and group are both numbered from 0 through 7
as shown above. If you prefer, you can think of 1/4 racks being numbered
from 0 through 3, and then the adapter address is (rack x 4) + (quarter).
A slot is a position in an I/O chassis for one I/O module. In 1-slot
addressing, an I/O group represents a single slot. In 2-slot addressing,
an I/O group represents two slots.
Logical Rack / Starting Quarter and Link Addresses
Adapter link addresses are composed of a rack number concatenated with a
starting quarter for a given rack. The two low-order bits of the address are
the starting quarter of the rack, and the next 5 bits are the rack address.
The high bit is always zero when using the KTx.
Example: rack 7, starting quarter 3 has a link address of 00011111binary,
or 1F hexadecimal. In viewing the binary representation, the address
breaks down as follows: 0 – 00111 – 11. The high order bit is 0, the rack
address is 00111, and the starting quarter is 11.
Examine the examples on page 1-5.
Allen-Bradley Parts
Chapter 1
Understanding I/O Scanner Concepts
1-5
This
physical rack assumes 2 link addresses and
contains 3/4 of logical rack 2 and 1/4 of logical rack 3.
Rack 2 Rack 2 Rack 2 Rack 3
Quarter 2 Quarter 3 Quarter 4 Quarter 1
Link address
09H
Link address
0CH
Full rack starting in first I/O group" 1
(second quarter) of rack number 2,
using 2slot addressing.
Here
2 physical racks, each with a link address,
comprise 3/4 of logical rack 4.
Link address
10H
Link address
11H
Rack 4
Quarter 1
Rack 4
Quarter 2
Rack 4
Quarter 3
Quarter rack starting in first I/O group" 0
(first quarter) of rack number 4, using
2slot addressing.
Half rack starting in first I/O group" 1
(second quarter) of rack number 4.
This
physical rack assumes 2 link addresses and
contains 2 full logical racks, 7 and 8.
Rack 7 Rack 7 Rack 8 Rack 8
Quarter 1,2 Quarter 3,4 Quarter 1,2 Quarter 3,4
Link address
1CH
Link address
20H
Full
rack starting in first I/O group" 0
(first quarter) of rack number 7, using
1slot addressing
Chapter 1
Understanding I/O Scanner Concepts
1-6
Address Conversion
You can use the following macros to quickly perform conversions between
link and logical addresses and back again. The parentheses are necessary
to ensure operations are performed in the right order.
Link-to-Logical Address Conversion
To convert a link address to a logical address, shift right twice.
#define LINK_TO_LOGICAL(link,logical) ((logical)=((link)>>2))
Logical-to-Link Address Conversion
To convert a logical address to a link address, shift left twice and add the
starting quarter.
#define LOGICAL_TO_LINK(link,logical,sq) ((link)=(((logical)<<2)+sq))
Address Range
The 1784-KTx scanner will service as many as 32 logical racks (32
physical node addresses) with a maximum of 4096 discrete inputs and
4096 discrete outputs.
The scanner runs asynchronously in relation to the host, a personal
computer. When either one wants to get the others attention, it must issue
a hardware interrupt. Information is exchanged through dual-port RAM.
Both the host and the scanner can postpone servicing an interrupt if in the
middle of another interrupt-driven task.
The scanner maintains a scan list, which is a list of adapters to be serviced
by the scanner. A given adapter may appear once, several times, or not at
all in the scan list. The scan list is empty until you perform the scanner
commands to
Autoconfigure or Set Scan List.
An exchange (or an adapter scan) is the scanners interchange of
information with one adapter. During an exchange, the scanner may
receive data or status information from the adapter or send data or
commands to the adapter, or both. Both block transfers and discrete I/O
transfers can be done during the same exchange if the adapters chassis
contains both kinds of I/O modules.
The host issues commands by writing to the dual port. The scanner
services commands as they arrive. If the current operating mode allows,
the scanner executes the command. If the scanner has a confirmation of
this command or of a previously executed command, it puts the
confirmation in the dual-port RAM and interrupts the host.
What
the Scanner Does
Allen-Bradley Parts
Chapter 1
Understanding I/O Scanner Concepts
1-7
The scan list is circular: each time the scanner reaches the end of the scan
list it starts again at the beginning. An I/O scan (sometimes called just a
scan) is one complete cycle by the scanner through the scan list, from any
point to the same point. Thus you can be certain that the I/O image tables
are refreshed once per cycle through the scan list.
The scanner has three modes of operation: Program, Test, and Run modes.
Discrete inputs are read in all three modes.
In Program mode, no discrete outputs are sent to the adapters, and the
adapters are instructed to hold all discrete outputs reset (zero).
The scanner holds any block transfer requests in its queue without
servicing them.
In Test mode, the adapters are still instructed to hold discrete outputs
reset, but the scanner sends discrete information to them. Block transfers
can proceed in test mode, but their outputs will be held reset.
In Run mode, discrete output information is sent to the adapters, and the
adapters are permitted to update the output modules. Block transfers
may be performed.
No link activity occurs until you send an
Autoconfigure or Set Scan List
command. Then, when your program begins scanner operation, the scanner
is in Program mode. Your program must issue a command to change to
Run mode.
Dual-port RAM gives you almost 100% access to the interface at all times,
therefore your entire operation runs more quickly. The only time you will
be denied access is when the host and the KTx try to access the same
memory location at exactly the same time.
DATA
ADDRESS
DATA
ADDRESS
Host
processor
Dualport
RAM
2K
memory
KTx
processor
KTx card
Operating
Modes
Dualport RAM
Chapter 1
Understanding I/O Scanner Concepts
1-8
The KTx scanner has built-in collision detection; an arbitrator governs
traffic in the dual-port RAM. When the KTx processor and the host
processor try to access the same dual-port RAM location simultaneously,
the processor that made the first request receives access.
The host has two primary responsibilities; it:
changes and monitors the flow of discrete data
issues scanner commands
Data Flow and Data Paths
Here is the path followed by a discrete input bit:
An external device causes an input terminal of a discrete input module
to turn “on.”
When next asked by the adapter, the input module reports the new input
information. The adapter updates its internal input image table by
setting the bit corresponding to the particular input point.
When next scanned by the scanner, the adapter reports the new input
information. The scanner updates the input image table in the dual-port
RAM by setting the bit corresponding to the particular input point.
Host may read the dual port (discrete data) at any time.
The path of an output bit is essentially the reverse of the input path:
Your program sets a bit in its output image table. Your program knows
that this bit maps to an output terminal on a particular output module.
When the scanner next scans the adapter controlling the particular
output module, it tells the adapter to update its output image table with
the new information.
The adapter tells the discrete output module to update its outputs with
the new information.
The discrete output module turns on the output. Any external device
attached to the output module then becomes active.
For timing information, see Timing of Discrete I/O in chapter 7,
“Understanding Discrete I/O.”
Host
Responsibilities
Allen-Bradley Parts
Chapter 1
Understanding I/O Scanner Concepts
1-9
Scanner Commands
As its second primary responsibility, the host issues these types of
scanner commands:
management commands
block-transfer commands
A management command affects the operation of the scanner itself. There
are five management commands:
Command Action
Set
Mode
changes the scanner's operating mode to Program,
Test, or Run mode
Autoconfigure goes on the link to see what devices are attached
Set Scan List changes the order in which adapters are scanned,
and their relative frequency
Get Scan List obtains a copy of the current scan list
Set Fault Dependent Group designates one or more groups of adapters such
that, if one adapter in a group is faulted, the
scanner instructs the others to be faulted also
The command/confirmation buffers are used to transfer scanner
management commands to the scanner and provide status information to
the host. In addition, this area of the dual-port RAM is used for block
transfers between the host and intelligent I/O devices in the I/O system.
Refer to chapter 4 for information about management commands.
There are two block-transfer (BT) commands:
Command Action
Host BT Read reads data from an intelligent I/O module and
returns data to the host
Host BT Write writes data supplied by the host into an intelligent
I/O module
Refer to chapter 5 for information about block transfers.
Chapter 2 describes scanner start-up and shutdown procedures.
What's
Next
Chapter
2
2-1
Startup and Shutdown
This chapter describes the start-up and shutdown phases of operation,
including:
using the KTx memory-mapped hardware
running diagnostics on the KTx card
running the host compatibility test (M16 diagnostics)
loading the protocol file
initialization
shutdown
Before you begin building your driver, you must be familiar with the KTx
card’s memory-mapped hardware. The following sections describe
memory-mapped hardware bytes :0800h through :080Fh, which may be
needed by your driver.
Assert (Release) Z80 (byte :0802h)
Write a 01h to this address to assert (release) the Z80 and begin execution
of the loaded binary file. Subsequent writes to this address while the Z80
is asserted will have no effect.
Deassert (Reset) Z80 (byte :0803h)
Write a 01h to this address to de-assert (reset) the Z80 and halt execution
of the loaded binary file. Subsequent writes to this address while the Z80
is de-asserted will have no effect.
Chapter
Preview
Using the KTx
Memorymapped Hardware
Allen-Bradley Parts
Chapter 2
Startup and Shutdown
2-2
KTx Status Register (byte :0804h)
Important: This is a read-only byte.
This byte reports the status of several properties of the KTx card.
This table describes what each bit contains.
Bit Status Code Meaning
7 0 = Z80 is deasserted
1 = Z80 is asserted
6 0 = Z80 is in the halt state
1 = Z80 is not in the halt state
5 0
4 0
3 0
2 0
1 0
0 0 = no hardware interrupt is currently asserted
1 = a hardware interrupt is currently asserted
(stays active till host writes 0x1 to 808)
Host Interrupt Acknowledge (byte :0808h)
Write a 01h to this address to acknowledge an interrupt from the KTx.
This will reset bit 0 of the status register.
Card Control Write Register (byte :080Ah)
Important: This is a write-only register.
Bit Status Code Meaning
7 unused
6
5
4
3
2
1 1 = puts the KTx into E/ISA 16bit mode; will not work
with 8bit devices in the same 128K block of memory
0 = extended 16bit mode; can mix 8 and 16bit devices;
0 is the default.
0 1 = E/ISAlevel interrupts
0 = edgetriggered interrupts; 0 is the default.
Chapter 2
Startup and Shutdown
2-3
Card Control Read Register (byte :080Ch)
Important: This is a read-only register.
Bit Status Code Meaning
7 state of LED
1 = on
0 = off
6 color of LED
1 = red
0 = green
5 blink state of LED
1 = blink
0 = no blink
4 reserved
3 baud rate
00 = 230.4K baud
01 57 6K baud
2
01 = 57.6K baud
10 = 115.2K baud
11 = 230.4K baud
1 1 = puts the KTx into E/ISA 16bit mode; will not work
with 8bit devices in the same 128K block of memory
0 = extended 16bit mode; can mix 8 and 16bit devices;
0 is the default.
0 1 = E/ISAlevel interrupts
0 = edgetriggered interrupts; 0 is the default.
When you cold boot the host PC, you also restart the KTx card and place it
in a reset state. At this point, the KTx card is ready for your driver to start
the power-on self-diagnostic tests before loading the protocol binary file to
the KTx card.
Important: Since the self-diagnostic tests execute from the dual port,
you must run the dual-port functionality test before you run any of the
self-diagnostic tests.
Dualport Functionality Test
To check the functionality of the dual-port interface, follow these steps:
1. Clear the dual-port memory by writing 00h to dual-port locations
:0000h through :07FFh.
2. Read and check :0000h through :07FFh for compliance.
Running
Diagnostics
on the KTx Card
Allen-Bradley Parts
Chapter 2
Startup and Shutdown
2-4
3. Write FFh to dual-port locations :0000h through :07FFh.
4. Read and check :0000h through :07FFh for compliance.
Three Poweron Selfdiagnostic Tests: RAM, CTC, and SIO
Your driver must run these three power-on self-diagnostic tests (and they
must be performed in this order):
1. Random Access Memory (RAM) Test — file KTXST0.BIN
This test performs a pattern write to all of RAM and verifies this with
a read cycle. The test order is RAM1, RAM0, Dual-port RAM.
2. Counter Timer Circuit (CTC) Test — file KTXST1.BIN
This program performs a timing test on all KTx card CTC channels.
3. Serial Input Output (SIO) Test — file KTXST2.BIN
This program performs a loopback test on the KTx card SIO.
Table 2.A shows the diagnostics memory map associated with these tests.
Table 2.A
Diagnostics
Memory Map of Dual Port
Host Dualport Address Dualport Contents
:0000h - :07FDh
KTXST0.BIN or
KTXST1.BIN or
KTXST2.BIN
:07FEh Status Code
:07FFh Done
These bytes are memory-mapped hardware addresses:
:0800h Reserved
:0801h Interrupt KTx by writing a 1
:0802h Assert (Release) Z80
:0803h Deassert (Reset) Z80
:0804h KTx status register
:0805h - :0807h Reserved
:0808h Ack KTx interrupt by writing a 1
:080Ah Card Control Write Register
:080Ch Card Control Read Register
RAM
CTC
SIO
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112
  • Page 113 113
  • Page 114 114
  • Page 115 115
  • Page 116 116
  • Page 117 117
  • Page 118 118
  • Page 119 119
  • Page 120 120
  • Page 121 121
  • Page 122 122
  • Page 123 123
  • Page 124 124
  • Page 125 125

Allen-Bradley 1784-KTXD Reference guide

Type
Reference guide
This manual is also suitable for

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI