Operation
Atlas® Digital Amplifier Complete Technical Reference
69
4
4.11 Trace Capture
Figure 4-13:
Example
Motion Trace
Capture
Trace capture is a powerful Atlas feature that allows parameters and registers to be continuously captured and stored
to the Atlas units’ trace RAM user memory space. The captured data may later be downloaded by the external
controller using standard memory buffer access commands. Data traces are useful for optimizing current loop
performance, diagnosing SPI communications, capturing signal data, or assisting with any type of monitoring where
a precise time-based record is required.
Broadly speaking, there are three phases associated with data trace operations. In the first phase, the external controller
specifies which parameters will be captured, and how the trace will be executed. In the second phase, Atlas captures
the trace data. This can occur autonomously, or under external controller control. Finally, in the third phase the
external controller retrieves the data. This can occur after the trace is complete, or concurrently with capture.
4.11.1 Trace Parameters
To start a trace the external controller must specify a number of parameters. They are:
SetBufferLength
bufferID, length
Sets the length of the specified buffer. Length is a 32-bit inte-
ger. Atlas adds length to the current buffer base address (as
set by the SetBufferStart instruction) to ensure that the buffer
will not extend beyond the addressable memory limit.
GetBufferLength
bufferID
Returns the length of the specified buffer.
SetBufferReadIndex
bufferID, index
Sets the read index for the specified buffer. Index is a 32-bit
integer in the range 0 to length-1, where length is the current
buffer length.
GetBufferReadIndex
bufferID
Returns the value of the read index for the specified buffer.
SetBufferWriteIndex
bufferID, index
Sets the write index for the specified buffer. Index is a 32-bit
integer in the range 0 to length-1, where length is the current
buffer length.
GetBufferWriteIndex
bufferID
Returns the value of the write index for the specified buffer.
ReadBuffer16
bufferID
Returns a 16-bit value from the specified buffer. The location
from which the value is read is determined by adding the base
address to the read index. After the value has been read, the
read index is incremented. If the result is equal to the current
buffer length, the read index is set to zero (0).
Command
Arguments
Description
Parameter
Description
Trace buffer
The external controller must initialize and specify the memory buffer that will be
used for the trace data storage area. See
Section 4.10, “User Memory Space &
for more information on buffers.
Trace period
Atlas can capture the value of the trace variables for every single time cycle, every
other cycle, or at any programmed frequency. This trace period of data collection
and storage must be specified.