User`s manual
Exp-A/D12
66 s Software Reference
Expansion Board Addresses
The 12-bit address of a particular Exp-A/D12 is determined by the
encoding of PAL U7 and by jumpers on header J1. Sixteen different PALs
are available and J1 can be set four different ways, giving 64 unique
addresses in the form
000p 10px ppRy
where
R = 0 for register S3A, 1 for register S3B
y = 1 when J1 pins 34 are not connected
x = 1 when J1 pins 12 are not connected
and pppp is determined by the PAL. PALS are numbered FP04600 for
pppp = 0000 through FP046F0 for pppp = 1111.
The address can be placed on the bus using 4-bit addressing. The func-
tions set12adr, read12data, and write12data (in DRIVERS.LIB) use
12-bit bus addresses.
When using these, and certain other functions, swap the first and third
nibbles of the address before passing the address to the function. For
example, if the address is 0x125, pass 0x521.
For a given board, the R bit selects one of two hardware registersS3A or
S3Bcoded on the PAL chip. S3A is a MUX control register that
selects one of the boards eight input channels. S3B is the serial commu-
nication control register, which controls signals SDA, SCLK, ADI, and
/ADCS that connect the PAL at U8 with the A/D converter chip and the
EEPROM.
The library functions select register S3A and S3B automatically. There is
no need to write code to do so, unless there is a specific need.
Logical Addresses
Exp-A/D12s have 64 logical addresses with possible values of 063.
The formula mapping the physical address to logical address is
logical address = pppp × 4 + xy
where pppp (PAL encoding), x, and y (jumper bits) were defined above.
For example, an Exp-A/D12 with the FP04650 PAL (pppp = 0101) and J1
pins 3 and 4 connected (xy = 10) has a physical address of
000p 10px ppRy = 0000 1011 0100 = 0x0B4
for register S3A (R = 0).
The Exp-A/D12s logical address is
0101
B
× 4 + 10
B
= 22 = 0x1C.
Certain library functions expect a logical Exp-A/D12 address.