Delta Tau GEO BRICK LV Manuale Utente
Turbo PMAC User Manual
402
Writing a Host Communications Program
DPRAM Automatic Functions
Turbo PMAC provides many facilities for using the DPRAM to pass information back and forth between
the host computer and the Turbo PMAC. Each of these functions has dedicated registers in the DPRAM.
The following table shows each of these functions and the addresses used for it.
the host computer and the Turbo PMAC. Each of these functions has dedicated registers in the DPRAM.
The following table shows each of these functions and the addresses used for it.
Host
Address
Offset
DPRAM Function
Turbo
PMAC
Address
0x0000
Control Panel Functions (pending)
$060000
0x006A
Motor Data Reporting Buffer
$06001A
0x0676
Background Data Reporting Buffer
$06019D
0x0E9E
DPRAM ASCII Command Buffer
$0603A7
0x0F42
DPRAM ASCII Response Buffer
$0603D0
0x1046
Background Variable Read Buffer Control
$060411
0x104C
Background Variable Write Buffer Control
$060413
0x1050
Binary Rotary Program Buffer Control
$060414
0x113E
DPRAM Data Gathering Buffer Control
$06044F
0x1140 Variable-Sized
Buffers & Open-Use Space
$060450
0x3FFC
End of Small (8k x 16) DPRAM
$060FFF*
0xFFFC
End of Large (32k x 16) DPRAM
$063FFF*
*Turbo PMAC memory register Y:$3F contains the Turbo PMAC address of
the last DPRAM address, plus one ($061000 or $064000).
the last DPRAM address, plus one ($061000 or $064000).
DPRAM Data Format
Data is stored in the DPRAM in 32-bit sign-extended form. That is, each short (24-bit) from PMAC is
sign-extended and stored in 32 bits of DPRAM. The most significant byte is all ones or all zeros,
matching bit 23. Each long (48-bit) word is treated as two 24-bit words, with each short word sign-
extended to 32 bits. The host computer must re-assemble these words into a single value. The data
appears in the DPRAM in Intel format: the less significant bytes and words appear in the lower-numbered
addresses.
To reassemble a long fixed-point word in the host, take the less significant 32-bit word, and mask out the
sign extension (top eight bits). In C, this operation could be done with a bit-by- bit AND: (LSW and
16777215). Treat this result as an unsigned integer. Next, take the more significant word and multiply it
by 16,777,216. Finally, add the two intermediate results together.
To reassemble a long floating-point word in the host, treat the less significant word the same as for the
fixed-point case above. Take the bottom 12 bits of the more significant word (MSW and 4095), multiply
by 16,777,216 and add to the masked less significant word. This forms the mantissa of the floating-point
value. Now take the next 12 bits (MSW & 16773120) of the more significant word. This is the exponent
to the power of two, which can be combined with the mantissa to form the complete value.
sign-extended and stored in 32 bits of DPRAM. The most significant byte is all ones or all zeros,
matching bit 23. Each long (48-bit) word is treated as two 24-bit words, with each short word sign-
extended to 32 bits. The host computer must re-assemble these words into a single value. The data
appears in the DPRAM in Intel format: the less significant bytes and words appear in the lower-numbered
addresses.
To reassemble a long fixed-point word in the host, take the less significant 32-bit word, and mask out the
sign extension (top eight bits). In C, this operation could be done with a bit-by- bit AND: (LSW and
16777215). Treat this result as an unsigned integer. Next, take the more significant word and multiply it
by 16,777,216. Finally, add the two intermediate results together.
To reassemble a long floating-point word in the host, treat the less significant word the same as for the
fixed-point case above. Take the bottom 12 bits of the more significant word (MSW and 4095), multiply
by 16,777,216 and add to the masked less significant word. This forms the mantissa of the floating-point
value. Now take the next 12 bits (MSW & 16773120) of the more significant word. This is the exponent
to the power of two, which can be combined with the mantissa to form the complete value.
DUAL-PORTED RAM DATA GATHERING FORMATS
Byte 2
Byte 1
Byte 0
Byte 2
Byte 1
Byte 0
Byte 2
Byte 1
Byte 0
Byte 5
Byte 4
Byte 2
Byte 1
Byte 0
Byte 4
Byte 5
1
1
1
1
1
1
1
1
S S S S S S S S
S
S
1
S
S
2
1
S
S
S
2
0
7
8
15
16
23
0
7
8
15
16
23
BIT #
BIT #
DPRAM
BYTE
NO.
(RELATIVE)
0
1
2
3
1
2
3
24 BITS
PMAC WORD:
48 BITS
PMAC Y: WORD
PMAC X: WORD
PMAC X: WORD
DPRAM
BYTE
NO.
(RELATIVE)
0
1
2
3
4
5
6
7
1
2
3
4
5
6
7
(SIGN EXTENSION)
(SIGN EXTENSION)
(SIGN EXTENSION)
S = Sign bit
1
S
= First word sign bit
= Second word sign bit
= Exponent for floating point
= Second word sign bit
= Exponent for floating point
S
2
Byte 3
Byte 3
S
2
S
2
S
2
S
2
S
2
S
2
S
2
S
2
S S S S S S S S