Pages: 1 [2]   Go Down
Author Topic: Arduino Single Channel Logic Analyser  (Read 3763 times)
0 Members and 1 Guest are viewing this topic.
nr Bundaberg, Australia
Online Online
Tesla Member
Karma: 129
Posts: 8600
Scattered showers my arse -- Noah, 2348BC.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Most of them look pretty close, it dies on SPI and 1-wire by the looks of it. But the SPI is 2MHz isn't it? No chance there.


Rob Gray aka the GRAYnomad

Norfolk UK
Offline Offline
Faraday Member
Karma: 70
Posts: 2582
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1-wire is pretty rubbish but with SPI you can at least see some structure. I think the ISR is taking to long and missing fine detail. Maybe the code can be optimized to improve this or maybe add a separate high speed capture mode.

Offline Offline
Full Member
Karma: 0
Posts: 186
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've been experimenting with the Input Capture Mode of the timers for fast capturing of a single boolean signal and wrote an article about it. You can capture pulse-widths of 3µs with an accuracy of 65ns with the sketch attached to the article.

The article itself is in German, but the screenshots and the code (with english comments) should be enough to understand how it works:

Here the direct link to the code for the Arduinos
For Uno, Leonardo and other ATmega328 based Arduinos: HighSpeedCaptureAtmegaTimer
For the Arduino Mega2560: HighSpeedCaptureAtmegaTimerATmega2560

« Last Edit: July 13, 2013, 04:02:21 pm by Mike T » Logged

Atlanta, USA
Offline Offline
Edison Member
Karma: 55
Posts: 1812
AKA: Ray Burne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If one does not need the high refresh rate - that is, an update every few seconds would suffice - and if you need logging (Excel or notepad) then my USB HID logger may be your answer.  Plus, it picks up the analog, too. 

If you do not wish to mess with V-USB, use a Leonardo.


Pages: 1 [2]   Go Up
Jump to: