Logic Analyzer output

Hi,

On the picture in the appendix, you can see some spikes on PIN 2. This spike always happens parallel to the spikes of PIN 4.

My question is: Is it possible to read this spike with an Arduino?

You can probably measure/detect the wide bars but the seeming tiny width spike could be a problem.
What is the width of the pulses?

Here you see the width.

OP's pictures:



Do you want to measure duration or simply detect the pulse?

I just want to detect it :slight_smile: in the attachment you find a example.

8 MHz, 80 M Samples [1].zip (1.77 KB)

Don’t attach ZIP files as they can be problematic.

Well, its a .logicdata file. I just can attach it, if i zip it. Sry.

If your code is written properly, you can detect 232us pulses with the Arduino.

However, not sure what the situation is or exactly what you are trying to accomplish.

Do you have any tips or instructions on how to solve the problem?
The situation is:

I have a 16x4 matrix. If PIN 1 goes LOW in this example, PIN 3 follows in synch with the impulses.

Unfortunately I cannot work with INPUT_PULLUP or DigitalWrite () because I listen to a line. If I used DigitalWrite (), I would falsify the results.

So the pulses are the only one way that i found to listen the line.

It sounds like you are quite familiar with the problem and know your hardware well.

Currently, “PIN 1 goes . . .” “PIN 3 follows. . .” means nothing to us.

We have no idea what you are doing.


Show us a good schematic of your circuit.
Show us a good image of your ‘actual’ wiring.
Give links to components.
Posting images:
https://forum.arduino.cc/index.php?topic=519037.0

Use CTRL T to format your code.
Attach your ‘complete’ sketch between code tags, use the </> icon in the posting menu.
[code]Paste your sketch here[/code]


If we told you: PIN 45 was controlled/connect to the matrix by DigitalWrite but it’s not working, would you understand what we were saying ?

In the first step i want to catch these impulses, if this is possible.

Here on page 30. I want to listen to the signals from J3 without manipulating them. i want to send the data from matrix to dart machine and arduino at the same time. If I now use DigitalWrite with an INPUT_PULLUP, I interfere with the processing of the dart machine. That is the problem.

I either see many example to read out a matrix like this

int masterLines = 8; //Change here to the number of lines of your Master Layer
int slaveLines = 8; //Change here to the number of lines of your Slave Layer
int matrixMaster[] = {13, 12, 11, 10, 9, 8, 7, 6}; //Put here the pins you connected the lines of your Master Layer 
int matrixSlave[] = {5, 4, 3, 2, A5, A4, A3, A2}; //Put here the pins you connected the lines of your Slave Layer
void setup() {     
    Serial.begin(9600);     
    Serial.println("OpenDarts"); //This line is not necessary, is just here for debug purposes
    for(int i = 0; i < slaveLines; i++){         
        pinMode(matrixSlave[i], INPUT_PULLUP);     
    }
   for(int i = 0; i < masterLines; i++){         
       pinMode(matrixMaster[i], OUTPUT);         
       digitalWrite(matrixMaster[i], HIGH);     
   } 
}
void loop() {     
    for(int i = 0; i < masterLines; i++){         
        digitalWrite(matrixMaster[i], LOW);         
        for(int j = 0; j < slaveLines; j++){             
            if(digitalRead(matrixSlave[j]) == LOW){                 
                Serial.print(j);                 
                Serial.print(",");                 
                Serial.println(i);                 
                delay(500);                 
                break;             
            }         
        }         
        digitalWrite(matrixMaster[i], HIGH);     
    } 
}

But for me it is useless, because i interrupt the Dart machine with it.

Why not listen to the signals without using INPUT_PULLUP?

On the circuit diagram (pg30) provided, the circuitry uses 5V logic with lots of 3-state buffers with 10K pullups to 5V. Is your Arduino 5V or 3.3V?

Anyways, long cables/probes can easily disturb these weak signals. Keep your connections short.

If your analyzer has analog (scope) settings for the channels, you'll get a much better picture of what's really happening to the signals.

dlloyd:
Why not listen to the signals without using INPUT_PULLUP?

On the circuit diagram (pg30) provided, the circuitry uses 5V logic with lots of 3-state buffers with 10K pullups to 5V. Is your Arduino 5V or 3.3V?

Anyways, long cables/probes can easily disturb these weak signals. Keep your connections short.

If your analyzer has analog (scope) settings for the channels, you'll get a much better picture of what's really happening to the signals.

What dou you mean with without using INPUT_PULLUP? Can you give me a example for this ?

I have a Arduino mega 2560, so its 5V.

My cables are short too.

I have following LA:

https://www.amazon.de/Saleae-Analyzer-8Channel-saleae-support/dp/B00DPCDEV2

i dont think that i have a analog setting, or i am wrong?

Example:

pinMode(matrixSlave[i], INPUT);

Note you have 2 different logic families connected together ... Arduino mega 2560 (CMOS) and 74LS244 (TTL). Check datasheets for more accurate numbers, but approximately you have:

Arduino mega 2560:
Voltage range 0 - 1.6V creates logic level 0. Voltage range 3.3 - 5V creates logic level 1.

74LS244 Buffer:
Voltage range 0V - 0.8V creates logic level 0. Voltage range 2V - 5V creates logic level 1.

Looks like you might have logic analyzer only hardware, otherwise you could setup your channels like this:

I tried following code

int masterLines = 16; //Change here to the number of lines of your Master Layer
int slaveLines = 4; //Change here to the number of lines of your Slave Layer
int matrixMaster[] = {26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 53, 51}; //Put here the pins you connected the lines of your Master Layer
int matrixSlave[] = { 22, 24, 49, 47 }; //Put here the pins you connected the lines of your Slave Layer


void setup() {     
  Serial.begin(9600);
}
void loop() {     

 for(int j = 0; j < slaveLines; j++)
 {             
    if (digitalRead(matrixSlave[j]) == HIGH)
    {
      for (int i = 0; i < masterLines; i++)
      {
          if (digitalRead(matrixMaster[i]) == LOW)
         {       
                Serial.print(j);
                Serial.print(" - ");
                Serial.println(i);
                delay(500);
                break;
         }
      }
    }
 }
 


}

But the problem there is, that i catch only around 80% of the datas.
The problem is: If I throw and have only a weak impact on a field, the Ardunio does not recognize the throw, but the dart machine does. Do you have an idea why or how I can fix it?

Yes seems like i have only the hardware. I just can detected the trigger points.

I tried following code

This code is incomplete ... missing the pin setup information.
Did you try just using "INPUT" for the pinMode and now your Mega 2560 has stopped interfering with the processing of the dart machine?

But the problem there is, that i catch only around 80% of the datas.

Your serial communication speed is very slow (9600). Have you tried higher baud rates?

For each matrixMaster line that's LOW, there's a 1/2 second delay added, so the code basically stops and puts on blindfolds for this duration. What if another important signal line has gone HIGH-LOW-HIGH during this time? (missed data).

int masterLines = 16; //Change here to the number of lines of your Master Layer
int slaveLines = 4; //Change here to the number of lines of your Slave Layer
int matrixMaster[] = {26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 53, 51}; //Put here the pins you connected the lines of your Master Layer
int matrixSlave[] = { 22, 24, 49, 47 }; //Put here the pins you connected the lines of your Slave Layer

void setup() {     
  Serial.begin(57600);

  for(int j = 0; j < slaveLines; j++)
  { 
      pinMode(matrixSlave[j], INPUT);
  }

  for(int j = 0; j < masterLines; j++)
  { 
      pinMode(matrixMaster[j], INPUT);
  }
  
}
void loop() {    
 for(int j = 0; j < slaveLines; j++)
 {             
    if (digitalRead(matrixSlave[j]) == HIGH)
    {
      for (int i = 0; i < masterLines; i++)
      {
          if (digitalRead(matrixMaster[i]) == LOW)
         {       
                Serial.print(j);
                Serial.print(" - ");
                Serial.println(i);
                delay(500);
                break;
         }
      }
    }
 }
}

Doesn't arduino automatically use input if nothing is specified? Anyway, I wrote it about it.

I try a higher baud rate now, still the same result. If the impact is too weak, the dart machine detect it, but not my arduino.

I knew about the delay. If the matrixslave is high and the matrixmaster is low, i have a input.
if I didn't use a delay, it would count the impact multiple times. More than 500ms pass between throws, that's why it's okay.

If the impact is too weak, the dart machine detect it, but not my arduino.

Perhaps if the impact is weak, the signal has a low duration (< 500ms), therefore the delay would still cause problems. In this case, it wouldn't matter if a weak impact repeats every minute, they still could be missed because of the delay. What does your logic analyzer show for a weak impact signal?

In your Arduino IDE, take a look at File > Examples > 02.Digital > Blink Without Delay

If you follow this method where you check if the signal value has changed state from its previous state and check this (poll) every 50ms or so, then I'm quite sure you'll never miss a signal, or get extra counts for the same event (impact).

If, for example, I now simulate a weak impact 5 times on a field, the data will not arrive 5 times. So it cannot be due to the dealy, as this point is never reached.

What I can say is that the problems come from the MatrixSlave. These 4 pins do not always jump to HIGH, but the 16 Matrixmaster pins always to LOW.

As I said, the problem is that the matrix slave is not recognized in the event of a weak impact.

I have attached a .logicdata in the appendix, here you see a weak and a strong impact. In this example, PIN 1 is the MatrixMaster pin and PIN 2 is the Matrix slave pin.

8 MHz, 80 M Samples [1].zip (1.77 KB)

Ahem, OK, thanks for the signal trace showing large and small impacts.

In this case, it looks like BOTH events could be missed by your code. The delays are preventing the ability to take measurements 99.9% of the time (highlighted in translucent red). Each 500ms, the code is allowed to execute (green tick mark), which only takes, for example 0.5ms ... now its time for another delay, etc, etc.

If you eliminate the delay, then you could consider the timeline being 99.9% green, where you could take hundreds of readings within just one of those "spikes" ... which aren't really spikes (they each measure 0.23ms in duration).

Looking at pin 2, The spacing between the small pulses is 13 to 21 ms, so (without the delay) your code could catch every one of them. Then all you'll need to add is a resettable "timeout" as to when you'll accept the next HIGH reading. As those pulses come in, each one keeps resetting your timeout, until (for example) 100ms elapses without any pulses. If this were done, the code would only count (or recognize) the 2 events correctly.

What I can say is that the problems come from the MatrixSlave. These 4 pins do not always jump to HIGH, but the 16 Matrixmaster pins always to LOW.

Most likely due to the 2 different logic families that are in use. This doesn't have to be an issue though ... pin 1 is normally high, pin 2 is normally low. The pulses for each pin line up and are identical. All this could be dealt with in your code (if you want).