1
\$\begingroup\$

I'm trying to reverse engineer the communication between two modules, a master and a slave, but I couldn't figure out the used protocol. The communication with the sensor All of the signs use 5V. The blue sign's frequency is 400 kHz. This sequence is polled periodically, with 100 Hz.

My first guess was SPI, with connected MISO and MOSI (green line on the first picture), but if I disconnect the slave, the master only sends the first 2 or 3 bytes. (I guess 3, because the delay after it is changing back and forth with time). After this the slave should send the result back on the same line, where the MISO would be 0xFF, because without that the SCK wouldn't be there. The communication without the sensor My target is to use a microcontroller (STM32F4) to communicate with the slave. When I've tried that, the slave couldn't pull down the data sign. Can't pull down Any suggestions?

UPDATE: Some of you've asked for a zoomed in image of the first few bytes. In my opinion, it's not I2C, because there isn't any ACK sign, and there are only 8 SCK pulses, rather than 9. First bytes

The first 3 bytes are always fixed: 0xAA,0xE5,0xFF, after that, the output of the slave changes. The slave is an unbranded 8-pin SOIC, which probably measures the magnetic field or it's angle.

\$\endgroup\$
  • 1
    \$\begingroup\$ It looks like I2C because of the rounded rising edges on the yellow trace. The lack of additional bytes when you disconnect things would be because there is not slave responding to the address. However, there is obviously more going on than just straight I2C, because there are too many signals. \$\endgroup\$ – crj11 Mar 12 '18 at 19:42
  • \$\begingroup\$ @crj11 At first I also thought it's I2C. However, in I2C both SDA (data) and SCL (clock) idle high. In this case, data idles high and clock idles low. The I2C hypothesis may be valid, but it also needs more investigation. \$\endgroup\$ – Nick Alexeev Mar 12 '18 at 19:45
  • \$\begingroup\$ It would help if you could zoom the display to about 2 bytes to look for I2C start and stop bits. 400 KHz is more likely to be I2C than SPI \$\endgroup\$ – EE_socal Mar 12 '18 at 19:45
  • \$\begingroup\$ Do you have any information on the slave module? What is its function and is there a data sheet? \$\endgroup\$ – EE_socal Mar 12 '18 at 19:47
  • \$\begingroup\$ It looks like a wired or bus like I2C but it could be any protocol even home grown. \$\endgroup\$ – Trevor_G Mar 12 '18 at 20:33
0
\$\begingroup\$

My target is to use a microcontroller (STM32F4) to communicate with the slave. When I've tried that, the slave couldn't pull down the data sign.

It looks like I2C signalling to me - the data line is pulled up using a resistor and this means that if there are data clashes then it's not an output fighting another output but an open-collector output situation.

If you look at the data line you can see that it returns to logic 1 quite slowly compared with the clock signal and this is also another indication of I2C signalling.

\$\endgroup\$
  • \$\begingroup\$ It's I2C-like, but it's not I2C. It's more like I2C SDA with a SPI SCK. My guess is that it's a homegrown "I2C-like" protocol. Used to see those a lot pre-2006, when people were trying to avoid licensing fees... \$\endgroup\$ – Annie Mar 13 '18 at 0:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.