User's Manual

PMAC Dual-Ported RAM User Manual
14 Dual-Ported RAM Automatic Functions
Servo Fixed Data Buffer
PMAC can provide key motor servo data to the DPRAM where it can be accessed easily and quickly by
the host computer. PMAC copies data from key motor registers into fixed registers in the DPRAM. The
copying is attempted every I19 servo cycles, and is done for motors 1 through n, where n is determined by
variable I59. Setting I48 to 1 and issuing the GATHER command enables this feature.
General Description
In operation, every I19 servo cycles, PMAC tests to see if the Host-Busy flag at 0x0024 (Y:$D009) Bit 0 is
set (=1). If it is, PMAC skips this update of the buffer. If the flag is clear (=0), PMAC first sets the
PMAC-Busy flag at 0x0026 (X:$D009) Bit 15 to 1, then it updates the buffer with the information from
the specified motors (#1 to #{I59}), then updates the servo time at 0x0026 (X:$D009) Bits 0-14, and
finally clears the PMAC-Busy flag by setting 0x0026 (X:$D009) Bit 15 to 0.
When the host wishes to read the buffer it must make sure that the PMAC-Busy flag is clear. First set the
Host-Busy flag at 0x0024 (Y:$D009) Bit 0 to 1 (So PMAC stops updating and doesn't write as the host
reads). Then poll the PMAC-Busy flag. If the host finds that this flag is set, it may test the flag some
more times – the number of tests should always be limited – or it can decide to skip this cycle
immediately. The host then reads the information it desires, and finally clears the Host-Busy flag to permit
PMAC to start the next update.
The data format in the DPRAM is the same as for the Data Gathering to the Dual Port Format. 24-bit
values are sign-extended to 32-bits. 48-bit values are treated as 2 24-bit values: each half is sign-extended
to 32 bits, for a total of 64 bits. The data is provided in Intel format, with the low address containing the
least significant word.
I19 determines the rate at which this buffer is updated by the PMAC in units of servo cycles. I59
determines the highest motor number that will be updated. For example, I59 = 1 means only Motor 1
information will be updated; I59 = 5 means information will be updated for Motors 1, 2, 3, 4, and 5. I59 =
0 means there will be no update of buffers.
On-line commands GATHER and ENDGATHER enable and disable the Servo data reporting buffer, but do
not affect the Background data reporting buffer. If the GATHER command is issued with I48=0, the data
gathering function will start instead of this servo data reporting function. This data gathering function
could be storing data either in PMAC's main memory, or the DPRAM, depending on the setting of I45.
It is possible to execute both the servo data reporting function and the data gathering function
simultaneously. After setting I48 to 1, the first GATHER command activates the servo data reporting
function described here. The second GATHER command also activates the data gathering function that
uses I20 to I44 to determine what data is to be gathered. The ENDGATHER command stops the function
started by the most recent GATHER command. If both functions are running, two ENDGATHER commands
must be issued to stop them both.
To enable this function:
1. Set I19 = update period (in servo cycles).
2. Set I59 = highest motor number (1 - 8).
3. Set I48 = 1.
4. Issue GATHER command.
To disable this function:
1. Issue ENDGATHER command, or
2. Set I19 = 0, or
3. Set I48 = 0, or
4. Set I59 = 0 (this will also disable the Background Fixed Data Buffer).