Protocol

The Protocol tool uses the device Digital Pattern Generator and Logic Analyzer resources to transfer data using UART, SPI, I2C, CAN, CEC, SWD protocols, Quadrature Decoder, and to program AVR MCUs.
When the Protocol tool is used the Pattern Generator and Logic interfaces show Busy state. There can be multiple instruments open and the last used takes control over the specific device resource.

When the 'Debug with Logic Analyzer' option is enabled, the Logic Analyzer can be used to investigate the signals. In this case, the Protocol instrument will not receive data, it will only send data.

With Digital Discovery only DIO 23:39 channels can be used for master as these can control the channels. For spy purposes DIO 23:39, DIN 0:15 channels and any DIO or DIN can be used for SPI Spy.

Under the View menu the following can be adjusted:


 

1. UART

The UART interface can be used to receive and to send data.
The Spy mode lets you decode the selected TX, RX lines and additional 2 lines under More menu. Here you can also specify different rate for each line.
The Send & Receive mode lets you send data over TX and receive from the selected RX line.

The UART settings contain the following:

The custom ending accepts text with printable and escape characters \x## (hex digit) \\ \a \b \e \f \n \v \t \r \' \" \?

The TX field contains a text box to type the characters to send. With Auto option, the typed characters are immediately sent, or by pressing the Send button. The enter key will send entered text and the selected line ending. Checking the Escape option will accept escape characters. The Send File button will send the file content.

The RX field contains the Receive button to receive data and the option to print the sent TX data as well. The received data is printed with black, the sent with green, and eventual errors with red. The unprintable characters codes are displayed between braces.

 

2. SPI

The SPI interface can be used to decode data transmission or as protocol master controller. It allows sending and receiving data in single, dual, and quad modes. The select signal is activated from software, therefore it does not have exact timing with the bit serialization. The larger transfers with more bits than the custom Pattern Generator or Logic Analyzer device buffer are split to separate transfers.
On the Analog Discovery, the Pattern Generator buffer size is 1k or 16k bits, and the Logic is 4k or 16k bits.

The SPI settings contain the following:

The Spy mode lets you decode SPI communication.
The Multi Select makes possible to interpret setups with multiple Chip Select signals, common Clock and Data. When enabled, it overrides the Select setting above.
The Multi MISO makes possible to interpret setups with multiple Data/MISO signals, common Select and Clock. It is supported in Three-wire (SISO) and Standard (MISO/MISO) modes. When enabled, it overrides DQ0 or DQ1.
The Mode option selects between Three-wire, Standard, Dual, Quad modes and Flash. The command option lets you specify the number of bits which are transmitted after select activation only over DQ0. The Data Bits specifies the number of bits in a data word. The Flash mode interprets flash commands.
The Command Bits is to interpret the first bits for the SPI transfer as command bits on DQ0/MOSI. In Flash mode this is implicit. The Dummy bits is to ignore the following bits. The Data Bits specifies the bit grouping to words.
The Flash mode interprets P5Q and M25P16 flash instruction codes with address and dual/quad data transfers. The gear dropdown menu contains option to enable Timestamp.

The Slave mode lets you configure a SPI slave device. The entered MISO data will be returned to the master with the given word bit length. Repeat specifies from which word the data will be continued if the transfer is longer than the data list.

The Master mode lets you create simple transmissions and contains the following options:

The Custom mode lets you write communication script with the following functions:

Under the examples menu, you can find scripts for some Pmods/ICs.
The SPI can also be controlled from the Script tool.


The Sensor mode lets you write communication script, which will be executed at precise timing with the following functions:

When the Sensor is executed, first the loop function is called to build the transmission bit sequence without performing it on the device. The bit sequence length is limited by the device Pattern or Logic buffer size. After the initialize function, the loop transmission sequence is performed for the given number of iterations, then the loop function is called to decode the received data, and finally the finish function is called.
The maximum rate at which the loop can be executed is SPI frequency / transfer length. The transfer length is the sum of number of bits plus the specified delays.
The maximum number of transferred bits in a loop is limited by the Pattern Generator device buffer. Each transfer bit takes two samples plus the specified delays, like device/configuration with 32Ki sample buffer can transfer Read(8,2047) (2047x8bits), or Read(32,511) (511x32bits), or CmdRead(32, 0x0, 0, 8, 2043) (32 + 2043x8bits)

 

3. I2C

The interface can be used to decode data transmission, as protocol master or I2C slave.
I3C SDR and HDR-DDR is under development. It is available in Spy and Custom controller functions.

The settings contain the following:

The Spy/Slave mode lets you decode I2C communication and to setup a slave I2C device.

The Slave group contains button to start a single or repeated I2C slave. The address filed expects 7bit value or to respond to any address. The WR specifies the number of write bytes acknowledge or unlimited number. Zero will NACK the address write, 1 after the first data byte... The RD field expects decimal, hexadecimal (0xAD or hAD), binary (b10101101) values separated by space, comma, dot, double dot or tab, and characters when the Format is set to ASCII.

The receiver can be started printing the decoder transactions in the text area or direct writing to file. The Filter option lets you specify the address and (read or write) operation which to log.
The Glitch filter enables frequency filter for reception to eliminate glitches on the signals. The specified frequency is used to filter glitches at 10%, like for 100kHz pulses shorter than 1us will be ignored.
The gear dropdown menu contains option to enable Timestamp.

The Master mode lets you create simple transmissions and contains the following options:


The Custom mode lets you write communication script with the following functions:

Under the examples menu, you can find scripts for some Pmods/ICs.


The Sensor mode lets you write communication script, which will be executed at precise timing with the following functions:

When the Sensor is executed, first the loop function is called to build the transmission bit sequence without performing it on the device. The bit sequence length is limited by the device Pattern or Logic buffer size. After the initialize function, the loop transmission sequence is performed for the given number of iterations, then the loop function is called to decode the received data, and finally the finish function is called.

 

4. CAN

The CAN settings contain the following:

The TX filed contains the following:

The RX field contains the Receive button to receive data on the selected line. Higher Bit Rate Switch options are not supported by the RX. The data can be saved to text file using the Save or Append buttons.

 

5. CEC

The HDMI CEC settings contain the following:

The TX filed contains the following:

The RX field contains the Receive button to receive data on the selected line. The optional filtering can be selected for source, destination and opcode. The data can be saved to text file using the Save or Append buttons.

The TX Send start length is 4.5ms with 3.5ms low, the bit length is 2.5ms with 0.5ms low for bit 0 and 1.5ms for 1.
The RX Spy sampling is at 1.05ms after the falling edge and minimum 3ms low pulse for start.

The RX log displays the following:

 

6. JTAG

The JTAG settings contain the following:

  • TMS: the test mode select signal.
  • TCK: the test clock signal.
  • TDI: the test data in signal.
  • TDO: the test data out signal.
  • TRST: the optional test reset signal.
    Gear menu:
  • IR First: the instruction register bit order between least and most signification bit first
  • IR Bits: the IR word size in number of bits.
  • DR First: the data register bit order between least and most signification bit first.
  • DR Bits: the DR word size in number of bits.
  • TRST Active: the active level of test reset signal.
  • The Spy field contains the enable button to receive data on the selected line. The data format can be selected between: binary, decimal and hexadecimal. The show of TDI and/or TDO data can be selected. The data can be saved to text file using the Save or Append buttons.

    The log displays the following TAP controller states: Test-Logic-Reset, Run-Test/Idle, Select-DR-Scan, Select-IR-Scan, Capture-DR, Capture-IR, Shift-DR, Shift-IR, Exit1-DR, Exit1-IR, Pause-DR, Pause-IR, Exit2-DR, Exit2-IR, Update-DR, Update-IR. The TDI/TDO data and the number of bits if this is not equal to the specified IR/DR Bits value.

     

    7. SWD

    The Serial Wire Debug settings contain the following:

  • SWDCK: the clock signal.
  • SWDIO: the data in signal.
    Similar to I2C the least significant DIOs can be selected, up to log2 of Pattern Generator device buffer size.
  • Rate: specifies the speed or bits per second.
  • Gear menu:
  • Format: selects the data representation between Binary, Decimal, Hexadecimal.
  • Turn: specifies the turnaround cycles, default 1.
  • Trail: specifies the trailing cycles, default 0.
  • Resets: specifies the reset cycles, default 52.
  • Rst Trail: specifies the trailing cycles, default 16.
  • SWDIO Idle: idle level for IO, default Z.
  • Park Drive: when checked Park bit will be driven otherwise it will wait for pullup.
  • Glitch Filter: check to filter possible signal ringing.
  • Continue on NACK: continue bit sequence interpretation even on not acknowledge.
  • State Output: enables the output of internal state bits on additional DIOs.
  • The Spy mode lets you decode SWD communication.

    The Master mode lets you create simple transmissions and contains the following options:


    The Custom mode lets you write communication script with the following functions:

     

    8. AVR

    The AVR interface lets you program AVR MCUs.
    In order to program and MCU specify the used DIO signals, press Auto Rate, Signature Read and Identify Chip. Select the firmware image you want to program and press Write to Flash.

    The Flash Size and Page Size are adjusted based on Chip selection, but it can be entered manually for unlisted MCUs. These are important for writing/programming. You can find option to perform Erase before write and Verify after programming. The supported file types for Flash read and write are Intel HEX format and binary files. The programming is performed in page access mode, when page size is larger than one. The file data pages containing only hFF bytes are skipped.

    The EEPROM Size and Page Size are also adjusted on Chip selection. You can find option to Verify after programming. The EEPROM read and write operation supports binary files. The programming is performed in page access mode, when pages size is larger than one. The bytes wrapped due to start address and/or file size are programmed byte by byte.

    The Fuse, Lock and Calibration bytes are enabled according the Chip selection or it can be selected under the Gear menu, under the Chip Erase button.

     

    9. QuadDec

    The Quadrature Decoder interface lets monitor quadrature signals.

    The measurements are the following: