Arduino MITM Logic Analyzer to USB keyboard

Hello,

I am working on a project with an end goal of a personal project and also to learn along the way. I am stuck on finding a reasoning behind the following results.

Scenario:

I currently want to use the digitalRead of the Arduino to read the Data +/Data - line of my USB keyboard and digitalWrite to output to a logic analyzer (later on this will output to some kind of system that can parse keystrokes).

My set up is as followed:

Wired keyboard (Data +/-) >> Arduino digital pins 8 and 9 as input >> Arduino digital pins 10 and 11 as output >> 2 channels on my logic analyzer

Note about the wired keyboard. It is connected to another device so it has voltage and ground already. I have spliced the Data +/- lines to my Arduino.

Now I can read the Data lines on my keyboard via the Logic Analzyer alone at 4MHz and parse out the information I need. The end goal is to have the Arduino parse this differential signaling and pass it to other devices. I want to use the logic analyzer for now to make sure the Arduino is getting the correct information needed to replicate.

The issue is when I review the results of the logic analyzer, its crazy! Differential signaling is not there and the HIGH and LOWs appear random.

Here is my code on the Arduino:

int Pin = 8; // Initializing Arduino Pin
int Pin1= 9; // Initializing Arduino Pin

int Pin2 = 10; // Initializing Arduino Pin
int Pin3 = 11; // Initializing Arduino Pin

void setup() {
  pinMode(Pin, INPUT); // Declaring Arduino Pin as an Input
  pinMode(Pin1, INPUT); // setting next pin to read 
  pinMode(Pin2, OUTPUT); // Declaring Arduino Pin as write
  pinMode(Pin3, OUTPUT); // setting next pin to write 
}

void loop() {

  
  if(digitalRead(Pin) == HIGH)
  {
    digitalWrite(Pin2, HIGH);
 //   delay(waitTime);
  }
  if(digitalRead(Pin) == LOW)
  {
  digitalWrite(Pin2, LOW);

  }
  
  if(digitalRead(Pin1) == HIGH)
 {
  digitalWrite(Pin3, HIGH);
 }

  if(digitalRead(Pin1) == LOW)
  
  {
  digitalWrite(Pin3, LOW);
  }
}

Any recommendations of libraries to look at or roadblocks I might run into.

That is a 3v signal switching at 12 MHz. Differential, so always opposite of each other. Only need to read one oh them, but 3v is almost high enough to be read is as a 1.
Is the logic analyzer looking for 5V signals?

Ok I was curious if I really needed both signals as I was able to decode the HIGH and LOWS to 1 an 0 with 1 signal anways.

So I have the logic analyzer set to 1.8v <> 3.6v. The arduino is 3.3v 8MHz mini pro.

Here is a screen shot showing me capturing the USB from the data lines to logic analyzer. (Showing when I hit the letter "a" on the keyboard)

And here it is when I add the Arduino in the middle.

I don’t know why connecting to an input would drag the signal down. It’s only a 1uA load.

You should use a differential line receiver to convert the differential signal into a logic (bipolar) one. Eventually pullup resistors have to be added to the USB signals?

Also a differential line driver should be used to propagate the Arduino output, else you risk to damage the Arduino or the USB port.