I2C always responds NAK

Hi, I need to clone an H-shifter working with driving simulator.

I cannot upload pictures or more links, so I used linktree to explain my problem:

https://linktr.ee/jokolele

This is original configuration: (link 1 of my LinkTree)

I create a DIY H-shifter, so I would like to clone the signal sent from the original one.
I would like to start one gear at a time, so I'm working for first gear now.
I used a logic analyzator to sniff I2C signal, I found this: (link 2 of my LinkTree)

So I wrote this sketch https://pastebin.com/aMV6pV3G
Address is the same (0x01) and I'm sure about connections (I used logic analyzator on SCL and SDA).

Anyway, my code doesn't work. I receive NAK and data are not transmitted.
(link 3 of my LinkTree)

So, I decided to try to read with an another Arduino the signal transmitted using original shifter.
I used this sketch (link 4 of my LinkTree) and I found this (link 5 of my LinkTree)

So, I am sure address is right and connection is right. Arduino can read but it can't write.
Why? Can anyone help me?

Addresses below 8 are reserved. Use a higher address.

Sketch:

byte command[14] = {
  0x80,
  0x0C,
  0x01,
  0x01,
  0x00,
  0x80,
  0x80,
  0xC1,
  0xD8,
  0x00,
  0x00,
  0x00,
  0x00,
  0x00
};

#include <Wire.h>

void setup() {
  Wire.begin(); 
}

void sendCommand() {
  Wire.beginTransmission(0x01);
  Wire.write(command, 14);
  Wire.endTransmission();
}

void loop() {
  sendCommand();
  delay(260);  
}

Configuration:

Sniffed signal of original shifter:

Sniffed signal with 'my' sketch:

Sketch used to read signal of original shifter:

Result of Arduino reading:


It does not work

Thank you

How can the capture of the original shifter be a I2C signal ?
It is wrong in every way. There is a START and a STOP, but that's all.
Can you try to sample at a higher rate ? Or do a analog capture ?

My logic analyzer is 24MHz and it only have digital function.
Anyway my code should work, check this forum: https://www.isrtv.com/forums/topic/24532-gearbox-connector-on-base/
There are two pages. If you need any download, please send me a screenshot and I will send you

The Youtube video is removed and there is no explanation how it was done.
There is only a hint that is was working with an Arduino, but without any proof.
Then I say that no one has it working, until proven otherwise.

I suggest to just try to get a ACK on the address.
Which Arduino board do you use ?
The Arduino Uno/Nano can not go lower than about 32kHz.

Wire.begin();
Wire.setClock( 50000UL);
delay( 1000);
Wire.beginTransmission(0x01);
int error = Wire.endTransmission();
if( error == 0)
{
  Serial.println( "ACK !");
}
else
{
  Serial.println( "no response");
}

Your screendump of the original signal shows sometimes a ACK and sometimes not after the data bytes. I don't know what to think of it.

[EDIT] Changed Wire.setClok to Wire.setClock.

There is a second page of this forum

I tried both with Arduino uno and Pro Micro. Tomorrow I will try your sketch

ACK is always after data bytes, If I zoom I can see it. in the picture you can’t see ACK because of zoom

Can you give better data ?
I'm using PulseView, if you have a data format that PulseView can import then I can set a I2C decoder on the signals.

Please check Here

Thank you :smiley:

SCL is 90 kHz, that is okay.
There is a glith pulse on SDA at the last databytes before the ACK. That can often be ignored. It does not break the I2C protocol.
There are big gaps in the SCL signal. In a normal situation, it could be "clock pulse stretching" by the Slave. The Arduino Wire library supports that. The I2C data should still be valid. However, I think it is not "clock pulse stretching" by the Slave. I think they are delays by the Master software.
The Arduino Wire library can set the speed of the SCL clock, but it can not add gaps between databytes and it can not add gaps somewhere in the middle of a databyte.

Sorry, I don't know how to interface this device :cry:

Ouh, very sad :cry:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.