Determining communication direction in SPI ports

Click For Summary

Discussion Overview

The discussion revolves around determining the communication direction in a two-wire SPI bus without a slave select line. Participants explore methods to decode and reverse engineer the communication, focusing on identifying which device is acting as the master and which as the slave, particularly in the context of bi-directional communication.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested

Main Points Raised

  • One participant suggests using back-to-back diodes to identify the clock line but finds determining the data line direction challenging due to potential open collector drives.
  • Another participant recommends reading the protocol and using an oscilloscope to analyze the serial data, implying that controlling the devices could simplify the debugging process.
  • A participant acknowledges understanding the protocol but emphasizes the difficulty of determining data direction without a slave select line, noting that this task is often underestimated.
  • One suggestion involves temporarily adding a small capacitance at each data pin with a series resistor to create RC rounding, which could help identify the transmitting and receiving devices.
  • A participant expresses willingness to try the suggested method involving capacitance and resistance.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best method to determine communication direction, with multiple approaches proposed and no clear agreement on their effectiveness.

Contextual Notes

The discussion highlights the complexity of the problem, particularly in the absence of documentation for the commercially available devices involved, and the potential limitations of the proposed methods.

Who May Find This Useful

This discussion may be useful for individuals involved in reverse engineering, debugging SPI communication, or working with similar bi-directional communication protocols in embedded systems.

fizz_it
Messages
29
Reaction score
0
Hi

I have to reverse engineer/decode the communication on a two wire SPI bus, there is no slave select line to help determine master and slave. How do I determine which side is communicating at any point in time? I think I can determine which side is the clock with a couple of back to back diodes. But the data line is more difficult. I have tried diodes and series resistors but I have difficultly interperating the results. The difficulty comes from probable open collector drives for the data lines.

What can I do?
 
Engineering news on Phys.org
I forgot most of SPI, read up the protocode and the interface, read the serial data with the scope and find out what's going on. Particular if you can control and send out certain command and data. I debugged interface like this before. This is a simple communication link, shouldn't be hard to figure out.
 
I understand the protocol and can list the data that comes out of the communications channel quite easily. The question is how do I determine the direction of the data without a slave select line? One side of the of the communication channel always clocks but I know that there is bi-directional communication. This is a more difficult problem than most people realize as most have never had to do this activity. The two devices are commercially available consumer level products for which there is no documentation.
 
I would temporarily put a small capacitance at each data pin, with a resistor in series between the two devices. Size the caps and resistor to give you just a little RC rounding of the edges. That will show you who is transmitting and who is receiving.
 
I'll give it a try, thanks!
 

Similar threads

Replies
3
Views
2K
  • · Replies 42 ·
2
Replies
42
Views
6K
Replies
2
Views
5K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 3 ·
Replies
3
Views
4K
Replies
2
Views
3K