Go Down

Topic: SUMP compatible logic analyzer code for Arduino. (Read 116430 times) previous topic - next topic

tibe

Hi,
   just wanted to say that your code works like a charm. Loaded on a Mega 2560 using additional resistor. OLS cient 0.9.7 under Windows 7.
Amazing stuff. Thank you for sharing with the community !

Tibia

gillham

Cool. I'm glad it is working for you.  You shouldn't need the resistor to disable auto-reset with OLS 0.9.7.   Try it without it and see if it works ok.  Just make sure you select one of the Arduino device types and then try 'show device metadata'.  It should work.

karlitos

#77
Sep 27, 2014, 04:11 pm Last Edit: Sep 27, 2014, 04:35 pm by karlitos Reason: 1
Hello,

first of all let me thank you for your great work on the Arduino logic analyzer. I was able to set-up the logic analyzer with my Arduino board and the OLS cient 0.9.7  under Linux Mint 17.

I am able to see the digital signal I would like to examine. However I am still a little bit confused how should I set up the OLS client.

I am not sure if I understand the "trigger" function right. I thought, using the "trigger" only the repeated part of the signal will be shown (as I know it from an oscilloscope).

The signal I am interrested in has a certain "preamble" constisting from a "low" state for about a 5ms, than "high" state for about a 1,5ms and then a pattern 010101010101. How should I set-up the the OLS client to be able to trigger the signal ?

My settings are:
Sampling rate: 10,000 kHz
Recording size: Maximum

The signal(s) I would like to investigate are in manchester-code. There is a option in the tools-menu on the OLS client called "Line decoder".  How can I use it so it shows me the decoded data ?

Screenshot of the signal is here:

gillham

Hi, I'm glad you're able to use the code.

Regarding triggering, the Arduino logic analyzer supports basic parallel triggers where it looks at the state of each pin and if they match the enabled trigger's values, it starts the capture.  What you're thinking of is a serial trigger where it samples the same pin repeatedly and compares the trigger pattern with the last N samples.  At least that is my understanding.  The Arduino logic analyzer doesn't support serial triggers.  The Open Workbench Logic Sniffer (OLS), available for $50 from Seeedstudio, supports serial triggers as well as more complex triggers.

Essentially you would set a trigger on your data pin by clicking the 'Mask' checkbox for that pin and leaving the value unchecked.  Assuming the pin is pulled high by default. (I don't see the screenshot) That will trigger when that pin is low.  Unfortunately that is all you can easily do.  Once it triggers it will begin sampling until it runs out of buffer.  At 10KHz sample rate that would be about 100ms buffer.  That should get ~93ms of your Manchester encoded data.  If you use an Arduino Mega you can get about 7x that hopefully due to the larger memory for sampling.  The OLS hardware has 24Kbytes of buffer.

Regarding the line decoder, I have only messed with it with the "test device" generated sample.  It seems to generate on channel 2.  If you use the line decoder, setting it to manchester and channel 2, and click analyze, it should generate data on channel 0 and clock on channel 1.   Then set it to non return to zero and tell it data is on channel 0 and clock on channel 1 and hit analyze.  It should decode the data.  I've never tried it with data decoded from the Arduino logic analyzer, but I would be interested in your results or even the data capture out of the OLS client.

karlitos

Hello,

thank you very much for clarification. By "triggering" I ment the serial trigger as you described it. If I click the "Begin Capture" button in the OLS client and go to the "Triggers" tab in the OLS Capture Window I can set Mode to Serial. As I understand it this (serial triggering) will only work on devices supportin this feature. Will the Logic Pirate support the serial triggering ?

Anyhow I am wondering why you can not see the screenshot I put in my previous post. Please look here: http://s7.directupload.net/images/140927/nj3fcyqo.png

I am still little bit confused with the OLS client and the arudino logic analyzer. The Pin 8 on the Arduinop device represents the channel 0. If I connect the data wire to the Pin 8 I get following output: http://s14.directupload.net/images/140928/5pi2t7gw.png

When I connect the wire to the Pin 10 (channel 2) I can see additional signal on channels 1 and 3 : http://s7.directupload.net/images/140928/f6pg5kt2.png
But after hitting the "Repeat capture with current device settings" button the additional data dissapears. Then it looks like:
http://s7.directupload.net/images/140928/8n6u858c.png

Then I selected the "Line decoder", slected channel 2 for data, left the rest unchecked/empty and clicked analyze. Now I can see this: http://s7.directupload.net/images/140928/kky5ki9r.png

For me it seems, that the original signal is "altered" changed. Also, I thought that the encoded Manchaster code has half the frequency of the original signal.

Sorry for the long post, I hope you can find the screenshots I made.

Thank you for all your help - K

gillham

I'm not sure the Logic Pirate supports more than basic triggering.  I think it just triggers if any of the trigger enabled pins change state.  I believe via a pin state change interrupt.  While it has a very nice sized buffer at 256k, you have to decide if you need large buffer or more sophisticated triggering.  If you just want a large buffer some of the continuous read over USB types like the Saleae Logic might be better with a capture size limited only by your computer's storage capacity.

The Open Workbench Logic Sniffer (OLS) supports most of the triggering capabilities of an HP (now Agilent) 16550A logic analyzer according to this post. http://dangerousprototypes.com/forum/viewtopic.php?f=23&t=1711#p16505 For serious use I do recommend the OLS and a couple of the probe cables.

Of course an Arduino is a good tool for some basic logic analyzer work as long as you work within the limitations.  Client side issues (with decoders for example) will be the same with whatever hardware you use.  Though if some of the issues are related to capture precision the better hardware will help.

Regarding phantom signals I think that is generally some noise / cross talk on the pins issues with the chip.  You can put a 1k or 10k resistor to ground on pins you're not using to pull them down.  You could also use weak pull-down (or up) resistors (say 1M ohm) on all pins, even ones used for data, to help stabilize the signal.  Of course you also might want some current limiting resistors between the Arduino pins and the signal you're measuring as well. 

Your signal does look slightly different after the line decoder pass.  You might try using the clock recovery feature in that decoder if you know the clock rate on your signal.  I don't know that much about the decoders' inner workings as I have only used a couple of them a few times.  If you capture your original signal and save the data and PM me I can take a look at it though I'm definitely not an expert on the client.


BordIng

Hallo Gilham,

your project sounds interesting. I tried to download the arduino code to my borad (Arduino Uno, ATMega 328P-PU), but I got a compiler error before I can download. I have windows 7 64bit and an Arduino software 1.5.6-r2.

Code: [Select]
logic_analyzer_inline_4mhz:13: error: stray '\' in program
logic_analyzer_inline_4mhz:13: error: stray '\' in program
logic_analyzer_inline_4mhz.ino:285:46: error: invalid suffix "fcf79a7c74b59c6a49b95b5dac7dc0" on integer constant
logic_analyzer_inline_4mhz:501: error: missing terminating " character


any clue why I have this trouble?

Best regards
BordIng

jotapeh

#82
Dec 08, 2014, 08:52 pm Last Edit: Dec 08, 2014, 08:58 pm by jotapeh
It doesn't seem to be mentioned anywhere - it looks as though everyone is using this with raw Arduino inputs.

Would it be wise to create probe leads with, eg. 1MΩ input impedance (with 10pf cap in parallel)? It seems like that is the standard for scopes/logic analyzers in general.

Is there a property of the Arduino that makes this unnecessary?

EDIT: The answer is yes there is a special property of the Arduino that makes it unnecessary, and I apologize for posting this rather silly question! For those curious like I was, ATMega pins are by default "high impedance" equivalent to 100MΩ resistance. See: Arduino - Digital Pins

sergiofink

Hi people,

I have a problem with the logic sniffer. I´m trying to use the logic analyzer, but when I click the button SHOW DEVICE METADATA is shown the message DETECTION FAILED NULL. My Arduino board  is MEGA2560. I´m using the logical_analyze_agla_v0_10 and the Ols-0.9.7.1 versions. In the Arduino IDE, I compiled and uploaded the firmware in the Arduino board succesfuly. I used the serial monitor in the IDE, and after to digit 1, appeared the messages below:

readCount = 7168
delayCount = 0
logicIndex = 0
triggerIndex = 0
rleEnabled = 0
Bytes:
done...

I believe that the serial port of my board is ok. what may I do to resolve this problem? Can you tell me the steps?

Best Regards

Sergio Fink

sergiofink

Hi people,

I have a problem with the logic sniffer. I´m trying to use the logic analyzer, but when I click the button SHOW DEVICE METADATA is shown the message DETECTION FAILED NULL. My Arduino board  is MEGA2560. I´m using the logical_analyze_agla_v0_10 and the Ols-0.9.7.1 versions. In the Arduino IDE, I compiled and uploaded the firmware in the Arduino board succesfuly. I used the serial monitor in the IDE, and after to digit 1, appeared the messages below:

readCount = 7168
delayCount = 0
logicIndex = 0
triggerIndex = 0
rleEnabled = 0
Bytes:
done...

I believe that the serial port of my board is ok. what may I do to resolve this problem? Can you tell me the steps?

Best Regards

Sergio Fink

sergiofink

Hi gillham,

How are you?

I tryed to do your experience. I´m using the arduino MEGA2560 board, the ols 0.0.7.1 and logical_analyzer_agla_v0_10 versions. I compiled  and uploaded in the arduino board succesfuly. I used the serial monitor in the IDE. I digited 1 and appeared the message below:
readCount = 7168
delayCount = 0
logicIndex = 0
triggerIndex = 0
rleEnabled = 0
Bytes:
done...

After this, I runed the logic analyzer client. In the Capture ==> Begin Capture, when I click SHOW DEVICE METADATA, the error message appears: DETECTION FAILED NULL.

Can you help me to resolve this problem?
Best Regards
Sergio Fink

gillham

Code: [Select]
logic_analyzer_inline_4mhz:13: error: stray '\' in program
logic_analyzer_inline_4mhz:13: error: stray '\' in program
logic_analyzer_inline_4mhz.ino:285:46: error: invalid suffix "fcf79a7c74b59c6a49b95b5dac7dc0" on integer constant
logic_analyzer_inline_4mhz:501: error: missing terminating " character

Sorry, I haven't been checking this forum too often and don't seem to be getting email notices on updates.  Did you ever resolve this issue?  It seems like a bad download / corrupt file.  Download it again or use git to check it out locally.

gillham


It doesn't seem to be mentioned anywhere - it looks as though everyone is using this with raw Arduino inputs.

Would it be wise to create probe leads with, eg. 1MΩ input impedance (with 10pf cap in parallel)? It seems like that is the standard for scopes/logic analyzers in general.

Is there a property of the Arduino that makes this unnecessary?

EDIT: The answer is yes there is a special property of the Arduino that makes it unnecessary, and I apologize for posting this rather silly question! For those curious like I was, ATMega pins are by default "high impedance" equivalent to 100MΩ resistance. See: Arduino - Digital Pins
It is still a good idea to use a current limiting resistor on your inputs as well as pulling unused inputs to ground via a resistor, but it isn't strictly necessary.  You'll see stray values on unused pins when the nearby pin has a signal or random high values, etc.  It is a matter of a bit of noise during the sample.  Pull the pins low (or high if you like) that you're not using will clean that up.

A prototyping shield is a good way to mount the bits.  You can even add jumpers for each line to pull it down and a row of inputs for a cable like this one:  http://www.seeedstudio.com/depot/Logic-Shrimp-probe-cable-p-837.html (5 pins) or this one: http://www.seeedstudio.com/depot/Open-logic-sniffer-probe-cable-p-619.html (9 pins)

gillham

Hi gillham,

How are you?

I tryed to do your experience. I´m using the arduino MEGA2560 board, the ols 0.0.7.1 and logical_analyzer_agla_v0_10 versions.
Make sure you are using the latest AGLA code, either the 'master' branch or agla_v0_12.  Also make sure you're using the OLS client version 0.9.7 or newer (SP2 recommended)

Quote
I compiled  and uploaded in the arduino board succesfuly. I used the serial monitor in the IDE. I digited 1 and appeared the message below:
readCount = 7168
delayCount = 0
logicIndex = 0
triggerIndex = 0
rleEnabled = 0
Bytes:
done...

After this, I runed the logic analyzer client. In the Capture ==> Begin Capture, when I click SHOW DEVICE METADATA, the error message appears: DETECTION FAILED NULL.

Can you help me to resolve this problem?
Best Regards
Sergio Fink
On the dialog box where you set the serial port and can click "show device metadata", select one of the arduino types before clicking show device metadata.  Either one should work, once you read the metadata it should switch to the Arduino Mega Logic Analyzer automatically.   The reason for this is that the Arduino needs special treatment due to the auto-reset feature.  So if you use any of the other device types you won't get the right info back due to interaction with the auto-reset.

Since you can talk to it via serial that part looks good, it should just be a matter of selecting one of the arduino profiles prior to requesting the metadata.

Let me know if you have already solved this problem or not.  Also you can open issues on the github project page ( https://github.com/gillham/logic_analyzer/issues ) and I will see them for sure.

I'll try to check this forum more often but I think I have said that before. :)

dpdigital

#89
Jan 16, 2015, 07:00 pm Last Edit: Jan 16, 2015, 07:13 pm by dpdigital
Can someone tell me what I am doing wrong?

I cannot get the software to recognize my Arduino UNO.  It doesn't show up in the devices list.

I have checked that the Arduino compiled successfully by using the serial monitor and I get:

readCount = 1024
delayCount = 0
logicIndex = 0
triggerIndex = 0
rleEnabled = 0
Bytes:
done...

When I go to the devices list under the capture menu, I only see:

Generic I/O
OpenBench LogicSniffer
Test Device

OLS Version says 0.9.7.2

Any ideas?

Edit:  Nevermind, I think I got it figured out....selected OpenBench and the info was there to select the Arduino.

Go Up