mirror of
https://github.com/gillham/logic_analyzer.git
synced 2026-05-07 00:01:09 +03:00
Compare commits
5 Commits
agla_v0_15
...
agla_v0_16
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
739144d57e | ||
|
|
0b2651864e | ||
|
|
71b7c4790d | ||
|
|
016eabdc12 | ||
|
|
1cdc52febc |
22
LICENSE
Normal file
22
LICENSE
Normal file
@@ -0,0 +1,22 @@
|
||||
Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021 Andrew Gillham
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY ANDREW GILLHAM ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL ANDREW GILLHAM BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
105
README
105
README
@@ -1,105 +0,0 @@
|
||||
SUMP compatible logic analyzer for Arduino
|
||||
==========================================
|
||||
|
||||
This Arduino sketch implements a SUMP protocol compatible with the standard
|
||||
SUMP client as well as the alternative client from here:
|
||||
http://www.lxtreme.nl/ols/
|
||||
|
||||
The alternative client version is highly recommended. Download version
|
||||
"ols-0.9.7" or newer for built-in device profiles.
|
||||
NOTE: The latest officially released version of ols (0.9.7.2) does not work
|
||||
with modern Java runtimes. You will need to build it yourself.
|
||||
Follow the build instructions here: https://github.com/jawi/ols
|
||||
|
||||
This SUMP protocol compatible logic analyzer for the Arduino board supports
|
||||
5 channels consisting of digital pins 8-12, which are the first 5 bits (0-4)
|
||||
of PORTB. Arduino pin 13 / bit 5 is the Arduino LED, bits 6 & 7 are the
|
||||
crystal oscillator pins.
|
||||
|
||||
Uncomment CHAN5 below if you want to use the LED pin as an input and have
|
||||
6 channels.
|
||||
|
||||
On the Arduino Mega board 8 channels are supported and 7k of samples.
|
||||
Pins 22-29 (Port A) are used by default.
|
||||
|
||||
To use this with the original or alternative SUMP clients,
|
||||
use these settings:
|
||||
|
||||
Sampling rate: 4MHz (or lower) (no 2MHz on ATmega168)
|
||||
Channel Groups: 0 (zero) only
|
||||
Recording Size:
|
||||
ATmega168: 532 (or lower)
|
||||
ATmega328: 1024 (or lower)
|
||||
ATmega2560: 7168 (or lower)
|
||||
Noise Filter: doesn't matter
|
||||
RLE: disabled (unchecked)
|
||||
|
||||
Triggering is still a work in progress, but generally works for samples
|
||||
below 1MHz. 1MHz works for a basic busy wait trigger that doesn't store
|
||||
until after the trigger fires.
|
||||
Please try it out and report back.
|
||||
|
||||
Debugging
|
||||
=========
|
||||
|
||||
You can uncomment the '#define DEBUG_MENU' line to add some diagnostic menu
|
||||
options for capturing or dumping the capture buffer.
|
||||
You can uncomment the '#define DEBUG' and '#define DEBUG_MENU' for a couple
|
||||
extra menu options and logging of the received commands. The DEBUG option
|
||||
is generally only useful for development, while the DEBUG_MENU option is
|
||||
good for troubleshooting when the logic_analyzer sketch isn't working for you.
|
||||
Both are disabled by default to conserve RAM for improved stability.
|
||||
|
||||
CLI compiling
|
||||
=============
|
||||
|
||||
If you want to use the 'arduino-mk' package (on Debian for example ) to compile
|
||||
this using the Makefile, you'll need to make a couple of changes since the
|
||||
Makefile only supports a single .ino file. Basically you just need to append
|
||||
the other two files to the main .ino and then remove them.
|
||||
|
||||
$ cat logic_analyzer_inline_4mhz.ino >> logic_analyzer.ino
|
||||
$ cat logic_analyzer_inline_2mhz.ino >> logic_analyzer.ino
|
||||
$ rm logic_analyzer_inline_4mhz.ino logic_analyzer_inline_2mhz.ino
|
||||
$ make
|
||||
|
||||
This will make GIT unhappy so if you need to revert it to run 'git pull' do
|
||||
this:
|
||||
$ git reset --hard origin/master
|
||||
|
||||
|
||||
Older Notes
|
||||
===========================================================================
|
||||
NOTE: With v0.11 you can now sample at 4MHz & 2MHz rates in addition to the
|
||||
previous 1MHz and lower rates. This is done via unrolled loops which
|
||||
makes the source code huge and the binary takes much more of the flash.
|
||||
v0.11 is just slightly to big for an ATmega168's flash. You can comment
|
||||
out either captureInline2mhz() or captureInline4mhz() and it will fit.
|
||||
[ The code automatically skips the 2MHz code now, this isn't needed. ]
|
||||
|
||||
NOTE: v0.09 switched the channels BACK to pins 8-13 for trigger reliability.
|
||||
Please report any issues. Uncomment USE_PORTD for pins 2-7.
|
||||
|
||||
NOTE: The device profiles should be included with this code. Copy them to the
|
||||
'plugins' directory of the client. The location varies depending on the
|
||||
platform, but on the mac it is here by default:
|
||||
/Applications/LogicSniffer.app/Contents/Resources/Java/plugins
|
||||
[ These are included in ols-0.9.7 or newer so do not copy them. ]
|
||||
|
||||
NOTE: If you are using the original SUMP client, then you will get a
|
||||
"device not found" error.
|
||||
You must DISABLE the Arduino auto reset feature to use this logic analyzer
|
||||
code. There are various methods to do this, some boards have a jumper,
|
||||
others require you to cut a trace. You may also install a *precisely*
|
||||
120 Ohm resistor between the reset & 5V piins. Make sure it is really
|
||||
120 Ohm or you may damage your board. It is much easier to use the
|
||||
alternative SUMP client referenced above.
|
||||
[ This is not needed with ols-0.9.7 or newer. ]
|
||||
[ DO NOT use this resistor unless absolutely necessary on old clients. ]
|
||||
|
||||
NOTE: This master branch now supports Arduino 1.0 only.
|
||||
Checkout branch logic_analyzer_v0_5 for Arduino 22 support.
|
||||
|
||||
|
||||
Release: v0.15 December 21, 2021.
|
||||
|
||||
131
README.md
Normal file
131
README.md
Normal file
@@ -0,0 +1,131 @@
|
||||
SUMP compatible logic analyzer for Arduino
|
||||
==========================================
|
||||
|
||||
This Arduino sketch implements a SUMP protocol compatible logic analyzer.
|
||||
This implementation is compatible with the standard SUMP client as well as
|
||||
an alternative OLS client. More recently support has been added to Sigrok.
|
||||
|
||||
This logic analyzer for Arduino supports 6 channels consisting of digital
|
||||
pins 8-13, which are the first 6 bits (0-5) of PORTB.
|
||||
Arduino pin 13 / bit 5 is the Arduino LED, bits 6 & 7 are the crystal
|
||||
oscillator pins. Comment out CHAN5 if you don't want to use the
|
||||
LED pin for an input.
|
||||
|
||||
On the Arduino Mega board 8 channels are supported and 7k of samples.
|
||||
Pins 22-29 (Port A) are used by default.
|
||||
|
||||
Client Software
|
||||
===============
|
||||
|
||||
Sigrok support via the 'ols' device configuration has been added. This
|
||||
mostly involved returning the capture buffer in the reverse order.
|
||||
|
||||
Use the `logic_analyzer_sigrok` sketch. Since the OLS alternative client
|
||||
mentioned below has some issues with newer Java versions, Sigrok is currently
|
||||
the only practical way to use this logic analyzer. If you use an older machine
|
||||
with an older operating system and older Java you can probably use the OLS client.
|
||||
|
||||
Sigrok support seems to work fairly well so I would currently recommend it for
|
||||
anyone interested in trying this sketch.
|
||||
|
||||
Run PulseView like this on Linux: (I'll add Windows options after more testing)
|
||||
```
|
||||
PulseView --driver=ols:conn=/dev/ttyUSB0 --dont-scan
|
||||
```
|
||||
|
||||
It may be necessary to exit and relaunch PulseView to get it to recognize the device.
|
||||
An easy way to test the device is using the `sigrok-cli` utility. The command below
|
||||
samples channel 2 at 1MHz. If you get a device not found error, but /dev/ttyUSB0 exists,
|
||||
run this command a couple times and usually it will start working. Due to the way opening
|
||||
the serial port resets the Arduino there are some issues/bugs to work out yet.
|
||||
```
|
||||
sigrok-cli --driver=ols:conn=/dev/ttyUSB0 --config samplerate=1Mhz --config pattern=External --samples 1024 --channels 2
|
||||
```
|
||||
|
||||
The OLS alternative client hasn't had an official release recently so you will
|
||||
need to compile it yourself.
|
||||
|
||||
Follow the build instructions here: https://github.com/jawi/ols
|
||||
|
||||
|
||||
Older details on the OLS client is available at the project page:
|
||||
https://lxtreme.nl/projects/ols/
|
||||
|
||||
Direct link to older releases of the OLS alternative client:
|
||||
http://www.lxtreme.nl/ols/
|
||||
|
||||
The alternative client version is highly recommended. You can tried the older
|
||||
release ols-0.9.7.2 but most likely need to build it yourself. Use "ols-0.9.7"
|
||||
or newer for built-in device profiles.
|
||||
|
||||
To use this with the original or alternative SUMP clients,
|
||||
use these settings:
|
||||
```
|
||||
Sampling rate: 4MHz (or lower) (no 2MHz on ATmega168)
|
||||
Channel Groups: 0 (zero) only
|
||||
Recording Size:
|
||||
ATmega168: 532 (or lower)
|
||||
ATmega328: 1024 (or lower)
|
||||
ATmega2560: 7168 (or lower)
|
||||
Noise Filter: doesn't matter
|
||||
RLE: disabled (unchecked)
|
||||
```
|
||||
|
||||
Using the Logic Analyzer
|
||||
========================
|
||||
Triggering is still a work in progress, but generally works for samples
|
||||
below 1MHz. 1MHz works for a basic busy wait trigger that doesn't store
|
||||
until after the trigger fires.
|
||||
|
||||
Please try it out and report back. Please provide a detailed bug report
|
||||
if you file an issue.
|
||||
|
||||
Debugging
|
||||
=========
|
||||
|
||||
You can uncomment the `#define DEBUG_MENU` line to add some diagnostic menu
|
||||
options for capturing or dumping the capture buffer.
|
||||
You can uncomment the `#define DEBUG` and `#define DEBUG_MENU` for a couple
|
||||
extra menu options and logging of the received commands. The DEBUG option
|
||||
is generally only useful for development, while the DEBUG_MENU option is
|
||||
good for troubleshooting when the logic_analyzer sketch isn't working for you.
|
||||
Both are disabled by default to conserve RAM for improved stability.
|
||||
|
||||
CLI compiling
|
||||
=============
|
||||
|
||||
If you want to use the `arduino-cli` tool to compile this using the Makefile,
|
||||
you'll need to install the tool first following instructions here:
|
||||
https://arduino.github.io/arduino-cli/
|
||||
|
||||
Once installed you can simple type `make` and you should get some simple help:
|
||||
```bash
|
||||
$ make
|
||||
---> run 'make build' to compile for Arduino Duemilanove
|
||||
---> run 'make upload' to upload to /dev/ttyUSB*
|
||||
```
|
||||
|
||||
|
||||
Other Notes
|
||||
===========================================================================
|
||||
```
|
||||
NOTE: Starting with v0.11 you can sample at 4MHz & 2MHz rates in addition to the
|
||||
previous 1MHz and lower rates. This is done via unrolled loops which
|
||||
makes the source code huge and the binary takes much more of the flash.
|
||||
v0.11 is just slightly too big for an ATmega168's flash. The code
|
||||
automatically skips the 2MHz code on ATmega168
|
||||
|
||||
NOTE: v0.09 switched the channels BACK to pins 8-13 for trigger reliability.
|
||||
Please report any issues. Uncomment USE_PORTD for pins 2-7.
|
||||
|
||||
NOTE: If you are using the original SUMP client, then you will get a
|
||||
"device not found" error.
|
||||
You must DISABLE the Arduino auto reset feature to use this logic analyzer
|
||||
code. There are various methods to do this, some boards have a jumper,
|
||||
others require you to cut a trace. You may also install a *precisely*
|
||||
120 Ohm resistor between the reset & 5V piins. Make sure it is really
|
||||
120 Ohm or you may damage your board. It is much easier to use the
|
||||
alternative SUMP client referenced above.
|
||||
[ This is not needed with ols-0.9.7 or newer. ]
|
||||
[ DO NOT use this resistor unless absolutely necessary on old clients. ]
|
||||
```
|
||||
22
logic_analyzer/LICENSE
Normal file
22
logic_analyzer/LICENSE
Normal file
@@ -0,0 +1,22 @@
|
||||
Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021 Andrew Gillham
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY ANDREW GILLHAM ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL ANDREW GILLHAM BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -2,7 +2,7 @@
|
||||
*
|
||||
* SUMP Protocol Implementation for Arduino boards.
|
||||
*
|
||||
* Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021 Andrew Gillham
|
||||
* Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023 Andrew Gillham
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -62,7 +62,7 @@
|
||||
* until after the trigger fires.
|
||||
* Please try it out and report back.
|
||||
*
|
||||
* Release: v0.15 December 21, 2021.
|
||||
* Release: v0.16 October 3, 2023.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -949,7 +949,7 @@ void get_metadata() {
|
||||
Serial.write('0');
|
||||
Serial.write('.');
|
||||
Serial.write('1');
|
||||
Serial.write('5');
|
||||
Serial.write('6');
|
||||
Serial.write((uint8_t)0x00);
|
||||
|
||||
/* sample memory */
|
||||
|
||||
22
logic_analyzer_leonardo/LICENSE
Normal file
22
logic_analyzer_leonardo/LICENSE
Normal file
@@ -0,0 +1,22 @@
|
||||
Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021 Andrew Gillham
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY ANDREW GILLHAM ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL ANDREW GILLHAM BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -2,7 +2,7 @@
|
||||
*
|
||||
* SUMP Protocol Implementation for Arduino boards.
|
||||
*
|
||||
* Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021 Andrew Gillham
|
||||
* Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023 Andrew Gillham
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -62,7 +62,7 @@
|
||||
* until after the trigger fires.
|
||||
* Please try it out and report back.
|
||||
*
|
||||
* Release: v0.15 December 21, 2021.
|
||||
* Release: v0.16 October 3, 2023.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -918,7 +918,7 @@ void get_metadata() {
|
||||
Serial.write('0');
|
||||
Serial.write('.');
|
||||
Serial.write('1');
|
||||
Serial.write('5');
|
||||
Serial.write('6');
|
||||
Serial.write((uint8_t)0x00);
|
||||
|
||||
/* sample memory */
|
||||
|
||||
22
logic_analyzer_sigrok/LICENSE
Normal file
22
logic_analyzer_sigrok/LICENSE
Normal file
@@ -0,0 +1,22 @@
|
||||
Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021 Andrew Gillham
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY ANDREW GILLHAM ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL ANDREW GILLHAM BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
14456
logic_analyzer_sigrok/logic_analyzer_inline_2mhz.ino
Normal file
14456
logic_analyzer_sigrok/logic_analyzer_inline_2mhz.ino
Normal file
File diff suppressed because it is too large
Load Diff
14456
logic_analyzer_sigrok/logic_analyzer_inline_4mhz.ino
Normal file
14456
logic_analyzer_sigrok/logic_analyzer_inline_4mhz.ino
Normal file
File diff suppressed because it is too large
Load Diff
1109
logic_analyzer_sigrok/logic_analyzer_sigrok.ino
Normal file
1109
logic_analyzer_sigrok/logic_analyzer_sigrok.ino
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user