User manual

PICkit™ Serial Analyzer User’s Guide
DS51647A-page 74 © 2007 Microchip Technology Inc.
EXEC manages the interface with the host. The data stream sent to PICkit™ Serial
Analyzer from the host is encoded with ECMD TAGs and the data stream returned to
the host from PICkit™ Serial Analyzer uses EDATA TAGs. Likewise, the COMM con-
troller utilizes another set of predefined TAG(s) - CCMD TAGs (outgoing scripts) and
CDATA TAGs (returning data). EXEC has no knowledge of COMM TAG(s) but simply
transports data blindly between the host and COMM using EXEC TAG(s). RAM buffers
are used as conduits to exchange data with COMM. Data destined for COMM is
queued in RAM buffer 1 (CBUF1). Data returning from COMM is funneled through RAM
buffer 2 (CBUF2).
The PICkit™ Serial Analyzer is designed to facilitate continuous ‘spooling’ of data
to/from the external serial device. Separate 255-byte circular buffers are maintained for
both outgoing data (scripts/data) and returning data. The USB interface is not permitted
to be a bottleneck in the PICkit™ Serial Analyzer operation. EXEC processes each
USB packet immediately. If data is destined for a RAM buffer, the host is responsible to
insure adequate room is available in the buffer before the data is sent to avoid a fatal
‘overrun’ error. Returning data is queued in the appropriate circular buffer until retrieved
by EXEC, tagged and sent to the host. It is possible to overrun the return buffer under
some circumstances but should be rare. EXEC can interleave EXEC data with COMM
data as necessary.
The PICkit™ Serial Analyzer maintains fixed-length blocks of data for CONTROL and
STATUS. The CONTROL_BLOCK provides ‘static’ configuration information. The
STATUS_BLOCK is a snapshot of the PICkit™ Serial Analyzer operation. Each block
is divided into three sections corresponding to EXEC, COMM (common to all protocols)
and COMM (specific to the active serial protocol).
TABLE 9-1: TAG BYTE TYPES
The other major blocks are the control memory block and the status memory block. The
control block is used to configure the PICkit™ Serial Analyzer. The control block is
divided into the following three sections:
EXEC module configuration
Generic COMM module configuration
Protocol specific communication configuration
This third section will change depending on the protocol. The Status block keeps the
status of various flags and is similarly divided into three sections.
TABLE 9-2: CONTROL BLOCK
TAG types Definition
ECMD EXEC command TAG(s) – interpreted by EXEC
EDATA EXEC data TAG(s) – generated by EXEC
CCMD COMM command TAG)(s) – interpreted by COMM
CDATA COMM data TAG(s) – generated by COMM
TAG Bytes Definition
0-7 EXEC section
8-15 Generic COMM section
16-23 Protocol specific communication section