42
Developing Software for the PL-A780
Document No.: 04646-01
PixeLINK PL-A780
MACHINE VISION CAMERA
SYSTEM GUIDE
Copyright © 2004 PixeLINK
All Rights Reserved
6.3 How Do 1394 Devices Communicate?
Essentially the IEEE - 1394 FireWire bus uses a memory mapped communication protocol.
1394 transactions can be considered to be a read or write of data to a specified memory
address. 1394 uses 64bits of addressing: 16 bits for bus and node addressing with each
node (or device) on the bus having 48 bits of address space. The IIDC specification defines
how the address space on an IIDC compliant camera is implemented.
NOTE:
1394 uses big-endian notation, that means that the most significant byte comes first
and the most significant bit is bit 0. The PC uses little endian notation, where the least
significant byte comes first.
6.4 Communication With a IIDC Camera
In order to begin communication with an IIDC camera it is first necessary to determine in
which portion of the address space the IIDC camera is located. To allow flexibility in device
implementation the IIDC address space is not the same between devices but can be selected
by the camera manufacturer.
The IIDC specification defines the base address of the IIDC address space as
FFFF Fxxx xxxh
where the
xxx xxxxh
is determined from the camera’s
Configuration ROM
.
6.4.1 Navigating the Configuration ROM
The IIDC specification defines the format of the
Configuration ROM
for IIDC cameras. The
offsets listed in the
Root Directory
table are all relative to the base address
FFFF F000
0000h
.
To determine the location of the
Unit Directory
the
unit_directory_offset
field must be read
from offset
0424h
(or address
FFFF F000 0424h
). This field consists of an identifying key
and a relative
quadlet offset
. The identifying key is an 8 bit value that for the unit directory
offset is
D1h
. So if the value in the
unit_directory_offset
field is
D100 0004h
then the offset
for the
unit directory
is 0424h + 4*04h =
0434h
(or address
FFFF F000 0434h
).
To determine the location of the Unit Dependent Directory the
unit_dependent_directory_offset
field must be read from offset
000Ch
of the
Unit Directory
(or address
FFFF F000 0440h
using the above example unit directory offset). The identifying
key for the unit dependent directory offset is
D4h
. So if the value in the
unit_dependent_directory_offset
field is
D400 0001h
then the offset for the unit dependent
directory is 0440h + 04h =
0444h
(or address
FFFF F000 0444h
).
The Unit Dependent Directory contains, among other things, the
IIDC Base Address
, which
can be read from the
command_regs_base
field of the Unit Dependent Directory. The
identifying key for the
command_regs_base
field is
40h
. So if the value of that field is
4034
0000h
then the offset of the IIDC address space is
00D0 0000h
or the
IIDC Base Address
is
FFFF F0D0 0000h
.
NOTE:
This sample
IIDC Base Address
will be used in all further examples in this document.
6.4.2 IIDC Command Registers
In Section 1 of the IIDC specification all Command registers (or CSRs) are defined. The
offsets for all of these registers, unless otherwise specified, are relative to the
IIDC Base
Address
. The IIDC CSRs consist of Inquiry Registers and Control Registers. The IIDC
specification is designed to support many different types of cameras with many different
features, the Inquiry registers are used by controlling software to determine which of these