Shop OBEX P1 Docs P2 Docs Learn Events
SPI sniffer? — Parallax Forums

SPI sniffer?

T ChapT Chap Posts: 4,223
edited 2012-05-08 11:03 in Propeller 1
I want to see what some data is doing on a third party device. If I solder some leads to the device and then connect them to a Prop, is there an object that is already suited to reading what is received and display it on a terminal? I am new to SPI and not too familiar with what is available. I assumed that the wires could be swapped from the devices data in/data out to see what is happening in each direction as separate views, or maybe even have a second cog running with the device data in on one cog, the devices data out on another? This way there could be markers for each in the terminal display.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-05-08 10:03
    It all depends on the device you're using and the speed of the I/O. There is no SPI Sniffer object, but you could take an existing SPI send / receive routine and modify it. The problem is that there's no standard SPI. Each device may use a different number of bits per item and the data contained in the items varies widely from device to device. Some devices transfer data both ways (master to slave and slave to master) at the same time, some are unidirectional and some are half duplex (one way at a time). If your SPI transfers are slow enough, you could use a Spin routine, otherwise, you'd need a PASM routine.

    You might look at Hanno's Viewport which can act as a logic analyzer to show you the data on the SPI signal lines. It's got a 30-day free trial and is worth every penny of the $29 cost for a license.
  • T ChapT Chap Posts: 4,223
    edited 2012-05-08 10:12
    That sounds great Mike, that is cheap enough to experiment with. Thanks.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-05-08 10:26
    Just a heads up, the SPI objects that come with the Prop Tool are half duplex. They do let you set all sorts of parameters like which bits are most significant, when data is valid with respect to the clock pulse and delay times.

    All these extras tack time though. I usually strip them out when I want a faster SPI object.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-05-08 10:31
    A lot of logic analyzers will sniff a SPI line for you.

    I have one of these and it's great. You tell the analyzer what SPI rules you want to apply and it displays the data along with the logic display. It's a huge time saver when debugging SPI devices.

    I'll put up a screen shot next time I use mine. (Probably later today.)
  • T ChapT Chap Posts: 4,223
    edited 2012-05-08 11:03
    I have a suspicion that I am sniffing an epoxy enclosed Nordic nRF24L01+
Sign In or Register to comment.