mirror of
https://github.com/gillham/logic_analyzer.git
synced 2026-05-06 05:45:28 +03:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0f81002bde | ||
|
|
fb3aca55a0 | ||
|
|
851b7e0735 | ||
|
|
b1a43e57c7 | ||
|
|
1f418098b2 | ||
|
|
34aea7435d | ||
|
|
f51d0bbb96 | ||
|
|
3a6329775c | ||
|
|
3c69ec10a1 | ||
|
|
7173e83e14 | ||
|
|
5ec7aa1b51 | ||
|
|
ebbc1fb945 | ||
|
|
bc32e9fde6 | ||
|
|
6396054c16 | ||
|
|
d8cd29d86a |
7
README
7
README
@@ -37,7 +37,7 @@ use these settings:
|
||||
Sampling rate: 1MHz (or lower)
|
||||
Channel Groups: 0 (zero) only
|
||||
Recording Size:
|
||||
ATmega186: 532 (or lower)
|
||||
ATmega168: 532 (or lower)
|
||||
ATmega328: 1024 (or lower)
|
||||
ATmega2560: 7168 (or lower)
|
||||
Noise Filter: doesn't matter
|
||||
@@ -48,5 +48,8 @@ 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.
|
||||
|
||||
Release: v0.04 August 3, 2011.
|
||||
This master branch now supports Arduino 1.0 only.
|
||||
Checkout branch logic_analyzer_v0_5 for Arduino 22 support.
|
||||
|
||||
Release: v0.07 February 8, 2013.
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: logic_analyzer.pde,v 1.17 2011-08-04 02:31:01 gillham Exp $
|
||||
* $Id: logic_analyzer.ino,v 1.21 2012/02/27 20:19:44 gillham Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
* Sampling rate: 1MHz (or lower)
|
||||
* Channel Groups: 0 (zero) only
|
||||
* Recording Size:
|
||||
* ATmega186: 532 (or lower)
|
||||
* ATmega168: 532 (or lower)
|
||||
* ATmega328: 1024 (or lower)
|
||||
* ATmega2560: 7168 (or lower)
|
||||
* Noise Filter: doesn't matter
|
||||
@@ -78,7 +78,7 @@
|
||||
* until after the trigger fires.
|
||||
* Please try it out and report back.
|
||||
*
|
||||
* Release: v0.04 August 3, 2011.
|
||||
* Release: v0.07 February 8, 2013.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -147,19 +147,19 @@ void debugdump(void);
|
||||
#define SUMP_SELF_TEST 0x03
|
||||
#define SUMP_GET_METADATA 0x04
|
||||
|
||||
/* ATmega186: 532 (or lower)
|
||||
/* ATmega168: 532 (or lower)
|
||||
* ATmega328: 1024 (or lower)
|
||||
* ATmega2560: 7168 (or lower)
|
||||
*/
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
||||
#define DEBUG_CAPTURE_SIZE 7168
|
||||
#define CAPTURE_SIZE 7168
|
||||
#elif defined(__AVR_ATmega328__)
|
||||
#define DEBUG_CAPTURE_SIZE 1024
|
||||
#define CAPTURE_SIZE 1024
|
||||
#define DEBUG_CAPTURE_SIZE 7168
|
||||
#define CAPTURE_SIZE 7168
|
||||
#elif defined(__AVR_ATmega328P__)
|
||||
#define DEBUG_CAPTURE_SIZE 1024
|
||||
#define CAPTURE_SIZE 1024
|
||||
#else
|
||||
#define DEBUG_CAPTURE_SIZE 532
|
||||
#define CAPTURE_SIZE 532
|
||||
#define DEBUG_CAPTURE_SIZE 532
|
||||
#define CAPTURE_SIZE 532
|
||||
#endif
|
||||
|
||||
#define DEBUG
|
||||
@@ -239,10 +239,10 @@ void loop()
|
||||
break;
|
||||
case SUMP_QUERY:
|
||||
/* return the expected bytes. */
|
||||
Serial.print('1', BYTE);
|
||||
Serial.print('A', BYTE);
|
||||
Serial.print('L', BYTE);
|
||||
Serial.print('S', BYTE);
|
||||
Serial.write('1');
|
||||
Serial.write('A');
|
||||
Serial.write('L');
|
||||
Serial.write('S');
|
||||
break;
|
||||
case SUMP_ARM:
|
||||
/*
|
||||
@@ -513,7 +513,7 @@ void captureMicro() {
|
||||
* is done for any triggers, this is effectively the 0/100 buffer split.
|
||||
*/
|
||||
for (i = 0 ; i < readCount; i++) {
|
||||
Serial.print(logicdata[i], BYTE);
|
||||
Serial.write(logicdata[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -549,7 +549,7 @@ void captureMilli() {
|
||||
delay(delayTime);
|
||||
}
|
||||
for (i = 0 ; i < readCount; i++) {
|
||||
Serial.print(logicdata[i], BYTE);
|
||||
Serial.write(logicdata[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -682,6 +682,12 @@ void triggerMicro() {
|
||||
if (logicIndex >= readCount) {
|
||||
logicIndex = 0;
|
||||
}
|
||||
else {
|
||||
/* pad the same number of cycles as the above assignment (needs verification) */
|
||||
__asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t");
|
||||
}
|
||||
delayMicroseconds(delayTime - 3);
|
||||
__asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
|
||||
/* PORTD = B10000000; */
|
||||
}
|
||||
PORTD = B00000000; /* debug timing measurement */
|
||||
@@ -693,7 +699,10 @@ void triggerMicro() {
|
||||
* This needs adjustment so that we have the right spacing between the
|
||||
* before trigger samples and the after trigger samples.
|
||||
*/
|
||||
delayMicroseconds(delayTime);
|
||||
delayMicroseconds(delayTime - 2);
|
||||
__asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t");
|
||||
__asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t");
|
||||
__asm__("nop\n\t""nop\n\t""nop\n\t");
|
||||
|
||||
/* keep sampling for delayCount after trigger */
|
||||
PORTD = B10000000; /* debug timing measurement */
|
||||
@@ -728,7 +737,7 @@ void triggerMicro() {
|
||||
if (logicIndex >= readCount) {
|
||||
logicIndex = 0;
|
||||
}
|
||||
Serial.print(logicdata[logicIndex++], BYTE);
|
||||
Serial.write(logicdata[logicIndex++]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -764,54 +773,69 @@ void setupDelay() {
|
||||
*/
|
||||
void get_metadata() {
|
||||
/* device name */
|
||||
Serial.print(0x01, BYTE);
|
||||
Serial.print('A', BYTE);
|
||||
Serial.print('G', BYTE);
|
||||
Serial.print('L', BYTE);
|
||||
Serial.print('A', BYTE);
|
||||
Serial.write((uint8_t)0x01);
|
||||
Serial.write('A');
|
||||
Serial.write('G');
|
||||
Serial.write('L');
|
||||
Serial.write('A');
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
||||
Serial.print('M', BYTE);
|
||||
Serial.write('M');
|
||||
#endif /* Mega */
|
||||
Serial.print('v', BYTE);
|
||||
Serial.print('0', BYTE);
|
||||
Serial.print(0x00, BYTE);
|
||||
Serial.write('v');
|
||||
Serial.write('0');
|
||||
Serial.write((uint8_t)0x00);
|
||||
|
||||
/* sample memory (1024) */
|
||||
Serial.print(0x21, BYTE);
|
||||
Serial.print(0x00, BYTE);
|
||||
Serial.print(0x00, BYTE);
|
||||
/* firmware version */
|
||||
Serial.write((uint8_t)0x02);
|
||||
Serial.write('0');
|
||||
Serial.write('.');
|
||||
Serial.write('0');
|
||||
Serial.write('7');
|
||||
Serial.write((uint8_t)0x00);
|
||||
|
||||
/* sample memory */
|
||||
Serial.write((uint8_t)0x21);
|
||||
Serial.write((uint8_t)0x00);
|
||||
Serial.write((uint8_t)0x00);
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
||||
Serial.print(0x1C, BYTE);
|
||||
/* 7168 bytes */
|
||||
Serial.write((uint8_t)0x1C);
|
||||
Serial.write((uint8_t)0x00);
|
||||
#elif defined(__AVR_ATmega328P__)
|
||||
/* 1024 bytes */
|
||||
Serial.write((uint8_t)0x04);
|
||||
Serial.write((uint8_t)0x00);
|
||||
#else
|
||||
Serial.print(0x04, BYTE);
|
||||
/* 532 bytes */
|
||||
Serial.write((uint8_t)0x02);
|
||||
Serial.write((uint8_t)0x14);
|
||||
#endif /* Mega */
|
||||
Serial.print(0x00, BYTE);
|
||||
|
||||
/* sample rate (1MHz) */
|
||||
Serial.print(0x23, BYTE);
|
||||
Serial.print(0x00, BYTE);
|
||||
Serial.print(0x0F, BYTE);
|
||||
Serial.print(0x42, BYTE);
|
||||
Serial.print(0x40, BYTE);
|
||||
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);
|
||||
|
||||
/* number of probes (5 by default on Arduino, 8 on Mega) */
|
||||
Serial.print(0x40, BYTE);
|
||||
Serial.write((uint8_t)0x40);
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
||||
Serial.print(0x08, BYTE);
|
||||
Serial.write((uint8_t)0x08);
|
||||
#else
|
||||
#ifdef CHAN5
|
||||
Serial.print(0x06, BYTE);
|
||||
Serial.write((uint8_t)0x06);
|
||||
#else
|
||||
Serial.print(0x05, BYTE);
|
||||
Serial.write((uint8_t)0x05);
|
||||
#endif /* CHAN5 */
|
||||
#endif /* Mega */
|
||||
|
||||
/* protocol version (2) */
|
||||
Serial.print(0x41, BYTE);
|
||||
Serial.print(0x02, BYTE);
|
||||
Serial.write((uint8_t)0x41);
|
||||
Serial.write((uint8_t)0x02);
|
||||
|
||||
/* end of data */
|
||||
Serial.print(0x00, BYTE);
|
||||
Serial.write((uint8_t)0x00);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -848,7 +872,7 @@ void debugprint() {
|
||||
}
|
||||
else {
|
||||
Serial.print(savebytes[i], HEX);
|
||||
Serial.print(' ', BYTE);
|
||||
Serial.write(' ');
|
||||
}
|
||||
}
|
||||
Serial.println("done...");
|
||||
@@ -877,3 +901,6 @@ void debugdump() {
|
||||
#endif /* DEBUG */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ device.description = Arduino Generic Logic Analyzer
|
||||
# The device interface, SERIAL only
|
||||
device.interface = SERIAL
|
||||
# The device's native clockspeed, in Hertz.
|
||||
device.clockspeed = 100000000
|
||||
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
|
||||
@@ -39,13 +39,15 @@ 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 = 500
|
||||
device.open.portdelay = 1500
|
||||
# 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)
|
||||
device.open.portdtr = true
|
||||
# Which metadata keys correspond to this device profile? Value is a comma-separated list of (double quoted) names...
|
||||
device.metadata.keys = "AGLAv0"
|
||||
|
||||
# In which order are samples sent back from the device? true = last sample first, false = first sample first
|
||||
device.samples.reverseOrder = false
|
||||
# In which order are samples sent back from the device? false = last sample first, true = first sample first
|
||||
device.samples.reverseOrder = true
|
||||
|
||||
###EOF###
|
||||
|
||||
@@ -7,7 +7,7 @@ device.description = Arduino Mega Logic Analyzer
|
||||
# The device interface, SERIAL only
|
||||
device.interface = SERIAL
|
||||
# The device's native clockspeed, in Hertz.
|
||||
device.clockspeed = 100000000
|
||||
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
|
||||
@@ -39,13 +39,15 @@ 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 = 1000
|
||||
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)
|
||||
device.open.portdtr = true
|
||||
# Which metadata keys correspond to this device profile? Value is a comma-separated list of (double quoted) names...
|
||||
device.metadata.keys = "AGLAMv0"
|
||||
|
||||
# In which order are samples sent back from the device? true = last sample first, false = first sample first
|
||||
device.samples.reverseOrder = false
|
||||
# In which order are samples sent back from the device? false = last sample first, true = first sample first
|
||||
device.samples.reverseOrder = true
|
||||
|
||||
###EOF###
|
||||
|
||||
Reference in New Issue
Block a user