Pages: [1]   Go Down
Author Topic: Arduino Single Channel Logic Sniffer  (Read 1593 times)
0 Members and 1 Guest are viewing this topic.
Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2203
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A few projects people undertake on here are in need of some form of logic analyser/sniffer but paying $50+ can be expensive so I decided to attempt a free simple single channel solution. It needs no extra hardware beyond a basic UNO and for software only needs the freely available processing that works on Linux, Mac & PC platform.
Up until about one week ago I had never seen/used processing so the code I wrote leaves a lot to be desired and is still classed as 'work in progress'. The project is not perfect and fails with really fast signals but for stuff like serial, I2C & IR remote it seems to work fine.

To use, you need to upload the sketch to your UNO and then connect the signal you want to capture to pin 2 (The usual disclaimer here about ensuring the signal is suitable to connect to the arduino pin).

Load the processing project and run it, if it detects the arduino and the sketch it's running then you should get a window open with a little red circle top left. Next to the red circle is a blue square then a green square and then a couple of numbers. Below all of this is an up and down yellow line that is the sampled data. The initial sample you see is loaded on startup so you can just see something but when you start sampling it will be delete and replace by your capture data.
The red circle is the record button, pressing this starts the arduino ready to start capturing data.
The blue square is the stop button and will stop the arduino from capturing any more data.
The green square is the trigger direction button that toggles between 0 (low) and 1 (high). When you start recording by pressing the red circle the arduino does not start sending data until the capture pin (pin 2) changes to match the trigger.
The two numbers show the offset from the beginning of the captured data and the scale of the displayed data. You use the UP/DOWN cursor keys to alter the scale and the LEFT/RIGHT cursor keys to move back and forth along the captured data. Pressing 'Enter' will reset the position and scale back to there default values.

Attached are the latest versions of the Arduino and Processing sketch's


* Logic2.jpg (45.64 KB, 1276x356 - viewed 59 times.)
* Logic_Scanner.ino (8.12 KB - downloaded 46 times.)
* Logic2.pde (8.85 KB - downloaded 31 times.)
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2203
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Some good sample captures.
I2C, Serial, IR remote & Manchester.


* I2C AL.jpg (44.97 KB, 1016x356 - viewed 37 times.)

* Serial 9600 AL.jpg (61.77 KB, 1016x356 - viewed 25 times.)

* IR Remote AL.jpg (56.72 KB, 1275x356 - viewed 30 times.)

* Manchester AL.jpg (88.05 KB, 1016x356 - viewed 25 times.)
« Last Edit: April 04, 2013, 07:15:27 am by Riva » Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2203
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Some not so good sample captures with what they should have looked like.
1-Wire & SPI clock


* 1-Wire AL.jpg (69.67 KB, 1016x356 - viewed 35 times.)

* 1-Wire LA.jpg (76.08 KB, 1240x466 - viewed 48 times.)

* SPI CLK AL.jpg (36.84 KB, 1016x356 - viewed 25 times.)

* SPI CLK LA.jpg (30.24 KB, 1240x466 - viewed 27 times.)
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Pages: [1]   Go Up
Jump to: