You need to test, we're here to help.

You need to test, we're here to help.

03 September 2015

Shaking Bugs Out of SPI Buses

Figure 1: Debugging of SPI on a Teledyne LeCroy
WaveSurfer 3000 oscilloscope
In the first post of this series, we considered some of the challenges of debugging embedded systems in general and I2C buses in particular. Modern digital oscilloscopes equipped with powerful trigger/decode software for the serial protocol in play go a long way toward easing the path to a properly functioning embedded system. Now we'll consider the particularities of the Serial Peripheral Interface and how the proper tools can make debugging SPI buses easier.

The Serial Peripheral Interface, which was developed by Motorola, is a master/slave synchronous communication system with data rates up to 50 Mb/s and typical data packet sizes of 8 to 16 bits. SPI uses four signals and four data-transfer formats. The four signals are clock (SCK), Slave Select (SS); Master Output, Slave Input (MOSI); and Master Input, Slave Output (MISO). The four formats depend on the condition of the clock polarity (SPOL) and clock phase during data transfer. The data-transfer format is set on each master or slave and the master/slave combination must have a matched data-transfer format to establish a link.

As with I2C trigger/decode software, today's SPI trigger/decode software is well tailored to the debugging requirements of designers and technicians. Referring to the bottom left of Figure 1 within the SPI dialog box, one may trigger on standard 3-wire SPI signals or use the preset Serial I/O Port (SIOP) or Simplified SPI (SSPI) settings.

In the Format field of the Trigger dialog box, timing-diagram buttons provide a choice between Clock Phase (CPHA) and Clock Polarity (CPOL) to customize triggering for specific applications. In the interest of simplicity, these formats are automatically selected when you choose between the SIOP and SSPI settings.

As with the I2C trigger/decode software, the SPI version enables you to trigger on specific data values in either binary or hex formats. Binary triggering lends the flexibility of triggering on individual bits in a pattern while hex triggering simplifies the setup of long data pattern triggers.

Next up in this series on debugging embedded-system buses is the UART format, which supports many different protocols.

No comments:

Post a Comment