mirror of
https://github.com/gillham/logic_analyzer.git
synced 2026-05-07 08:22:55 +03:00
Compare commits
5 Commits
aglan_alph
...
agla_v0_11
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e7a780577 | ||
|
|
51df725ee8 | ||
|
|
d7c1bf52a8 | ||
|
|
69de405dd5 | ||
|
|
8c7db04e3c |
12
README
12
README
@@ -1,7 +1,13 @@
|
||||
SUMP compatible logic analyzer for Arduino
|
||||
==========================================
|
||||
|
||||
NOTE: NOTE: v0.09 switches the channels BACK to pins 8-13 for trigger reliability.
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
This Arduino sketch implements a SUMP protocol compatible with the standard
|
||||
@@ -37,7 +43,7 @@ platform, but on the mac it is here by default:
|
||||
To use this with the original or alternative SUMP clients,
|
||||
use these settings:
|
||||
|
||||
Sampling rate: 1MHz (or lower)
|
||||
Sampling rate: 4MHz (or lower)
|
||||
Channel Groups: 0 (zero) only
|
||||
Recording Size:
|
||||
ATmega168: 532 (or lower)
|
||||
@@ -54,5 +60,5 @@ Please try it out and report back.
|
||||
This master branch now supports Arduino 1.0 only.
|
||||
Checkout branch logic_analyzer_v0_5 for Arduino 22 support.
|
||||
|
||||
Release: v0.09 June 22, 2013.
|
||||
Release: v0.11 August 3, 2013.
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* NOTE: v0.09 switches the channels BACK to pins 8-13 for trigger reliability.
|
||||
* 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.
|
||||
*
|
||||
* This Arduino sketch implements a SUMP protocol compatible with the standard
|
||||
@@ -63,7 +63,7 @@
|
||||
* To use this with the original or alternative SUMP clients,
|
||||
* use these settings:
|
||||
*
|
||||
* Sampling rate: 1MHz (or lower)
|
||||
* Sampling rate: 4MHz (or lower)
|
||||
* Channel Groups: 0 (zero) only
|
||||
* Recording Size:
|
||||
* ATmega168: 532 (or lower)
|
||||
@@ -78,7 +78,7 @@
|
||||
* until after the trigger fires.
|
||||
* Please try it out and report back.
|
||||
*
|
||||
* Release: v0.09 June 22, 2013.
|
||||
* Release: v0.11 August 3, 2013.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -246,6 +246,31 @@ void setup()
|
||||
pinMode(ledPin, OUTPUT);
|
||||
#endif
|
||||
#endif /* Mega */
|
||||
|
||||
#if 0
|
||||
|
||||
/*
|
||||
* This sets up timer2 at 100KHz to toggle a pin. This is useful
|
||||
* for debugging as it gives an internally precise signal source.
|
||||
* This doesn't work on the Arduino Mega. Use on the Uno or older.
|
||||
* We're using the same clock source for the timer & our sampling.
|
||||
*/
|
||||
|
||||
/* Set OC2A (digital pin 11) to output so we can toggle it. */
|
||||
pinMode(11, OUTPUT);
|
||||
|
||||
/* reset timer to zero */
|
||||
TCNT2 = 0;
|
||||
TCCR2A = 0;
|
||||
TCCR2B = 0;
|
||||
OCR2A = 0;
|
||||
|
||||
/* Set CTC mode and toggle on compare. */
|
||||
TCCR2A = _BV (COM2A0) | _BV (WGM21);
|
||||
/* 79 = 100KHz, 15 = 500KHz, 7 = 1MHz */
|
||||
OCR2A = 79;
|
||||
TCCR2B = _BV (CS20);
|
||||
#endif
|
||||
}
|
||||
|
||||
void loop()
|
||||
@@ -283,7 +308,16 @@ void loop()
|
||||
* so in that case (delayTime == 1 and triggers enabled) use
|
||||
* captureMicro() instead of triggerMicro().
|
||||
*/
|
||||
if (useMicro) {
|
||||
|
||||
if (divider == 24) {
|
||||
/* 4.0MHz */
|
||||
captureInline4mhz();
|
||||
}
|
||||
else if (divider == 49) {
|
||||
/* 2.0MHz */
|
||||
captureInline2mhz();
|
||||
}
|
||||
else if (useMicro) {
|
||||
if (trigger && (delayTime != 1)) {
|
||||
triggerMicro();
|
||||
}
|
||||
@@ -457,7 +491,7 @@ void getCmd() {
|
||||
*/
|
||||
|
||||
void captureMicro() {
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
/*
|
||||
* basic trigger, wait until all trigger conditions are met on port.
|
||||
@@ -482,6 +516,7 @@ void captureMicro() {
|
||||
* Arduino digital pin 8 is being used here.
|
||||
*/
|
||||
DEBUG_ENABLE;
|
||||
#ifdef DEBUG
|
||||
DEBUG_ON;
|
||||
delayMicroseconds(20);
|
||||
DEBUG_OFF;
|
||||
@@ -490,6 +525,7 @@ void captureMicro() {
|
||||
delayMicroseconds(20);
|
||||
DEBUG_OFF;
|
||||
delayMicroseconds(20);
|
||||
#endif
|
||||
|
||||
if (delayTime == 1) {
|
||||
/*
|
||||
@@ -571,7 +607,7 @@ void captureMicro() {
|
||||
* this basic functionality.
|
||||
*/
|
||||
void captureMilli() {
|
||||
int i = 0;
|
||||
unsigned int i = 0;
|
||||
|
||||
if(rleEnabled) {
|
||||
/*
|
||||
@@ -637,7 +673,7 @@ void captureMilli() {
|
||||
*
|
||||
*/
|
||||
void triggerMicro() {
|
||||
int i = 0;
|
||||
unsigned int i = 0;
|
||||
|
||||
logicIndex = 0;
|
||||
triggerIndex = 0;
|
||||
@@ -657,6 +693,7 @@ void triggerMicro() {
|
||||
* Arduino digital pin 8 is being used here.
|
||||
*/
|
||||
DEBUG_ENABLE;
|
||||
#ifdef DEBUG
|
||||
DEBUG_ON;
|
||||
delayMicroseconds(20);
|
||||
DEBUG_OFF;
|
||||
@@ -665,6 +702,7 @@ void triggerMicro() {
|
||||
delayMicroseconds(20);
|
||||
DEBUG_OFF;
|
||||
delayMicroseconds(20);
|
||||
#endif
|
||||
|
||||
if (delayTime == 1) {
|
||||
/*
|
||||
@@ -868,8 +906,8 @@ void get_metadata() {
|
||||
Serial.write((uint8_t)0x02);
|
||||
Serial.write('0');
|
||||
Serial.write('.');
|
||||
Serial.write('0');
|
||||
Serial.write('9');
|
||||
Serial.write('1');
|
||||
Serial.write('1');
|
||||
Serial.write((uint8_t)0x00);
|
||||
|
||||
/* sample memory */
|
||||
@@ -890,12 +928,12 @@ void get_metadata() {
|
||||
Serial.write((uint8_t)0x14);
|
||||
#endif /* Mega */
|
||||
|
||||
/* sample rate (1MHz) */
|
||||
/* sample rate (4MHz) */
|
||||
Serial.write((uint8_t)0x23);
|
||||
Serial.write((uint8_t)0x00);
|
||||
Serial.write((uint8_t)0x0F);
|
||||
Serial.write((uint8_t)0x42);
|
||||
Serial.write((uint8_t)0x40);
|
||||
Serial.write((uint8_t)0x3D);
|
||||
Serial.write((uint8_t)0x09);
|
||||
Serial.write((uint8_t)0x00);
|
||||
|
||||
/* number of probes (6 by default on Arduino, 8 on Mega) */
|
||||
Serial.write((uint8_t)0x40);
|
||||
@@ -991,3 +1029,7 @@ void debugdump() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
14455
logic_analyzer_inline_2mhz.ino
Normal file
14455
logic_analyzer_inline_2mhz.ino
Normal file
File diff suppressed because it is too large
Load Diff
14455
logic_analyzer_inline_4mhz.ino
Normal file
14455
logic_analyzer_inline_4mhz.ino
Normal file
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,7 @@ device.clockspeed = 16000000
|
||||
# Whether or not double-data-rate is supported by the device (also known as the "demux"-mode).
|
||||
device.supports_ddr = false
|
||||
# Supported sample rates in Hertz, separated by comma's
|
||||
device.samplerates = 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 200000, 500000, 1000000
|
||||
device.samplerates = 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 200000, 500000, 1000000, 2000000, 4000000
|
||||
# What capture clocks are supported
|
||||
device.captureclock = INTERNAL
|
||||
# The supported capture sizes, in bytes
|
||||
@@ -39,7 +39,7 @@ device.capturesize.bound = false
|
||||
device.channel.numberingschemes = DEFAULT
|
||||
|
||||
# Is a delay after opening the port and device detection needed? (0 = no delay, >0 = delay in milliseconds)
|
||||
device.open.portdelay = 1500
|
||||
device.open.portdelay = 2000
|
||||
# The receive timeout for the device (in milliseconds, 100 = default, <=0 = no timeout)
|
||||
device.receive.timeout = 100
|
||||
# Does the device need a high or low DTR-line to operate correctly? (high = true, low = false)
|
||||
|
||||
@@ -11,7 +11,7 @@ device.clockspeed = 16000000
|
||||
# Whether or not double-data-rate is supported by the device (also known as the "demux"-mode).
|
||||
device.supports_ddr = false
|
||||
# Supported sample rates in Hertz, separated by comma's
|
||||
device.samplerates = 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 200000, 500000, 1000000
|
||||
device.samplerates = 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 200000, 500000, 1000000, 2000000, 4000000
|
||||
# What capture clocks are supported
|
||||
device.captureclock = INTERNAL
|
||||
# The supported capture sizes, in bytes
|
||||
|
||||
Reference in New Issue
Block a user