SCANALOGIC
ikalogic's
easy to build high performance logic analyzer
By Ibrahim
Kamal
Last update:
4/9/09
NEW
: Follow the development of SCANALOGIC
2 here!
Your comments, ideas, and
remarks are important to us and will be taken into consideration!
|
Here is one project we are really proud of,
and we hope that its simple design will encourage you to build
your own, and use the provided software to obtain your own
logic analyzer for less than 10$.
This device can help you in most of your projects, it's an
essential measuring device when it comes to digital electronics.
Those pages will discuss all what you need to know to understand
how it works, and build your own, and use it. |
|
1.What
is a Logic Analyzer?
 |
You could read the definition
on wikipedia,
but as you may already know, I have my way of explaining things
to beginner!
I would say that a logic analyzer is a device used to view the
voltage of "logic" electric signals that are usually
too fast to be measured by a voltmeter. A logic analyzer it not
exactly like an oscilloscope, as it cannot measure analog voltages.
Actually, it can only measure the logic state of a signal, see
if it's a 1 or a 0. '0' being Zero volts and '1' being 5V (for
classic TTL logic devices).
The main keypoint that makes a logic analyzer better than another
is the sampling rate, or the maximum number of samples that can
be recorded by second.
From a functional point of view, a logic analyzer records the
states of logic signals, usually after some 'triggering
condition' is met, then, recorded signals are displayed on
a screen for in depth analysis.
2.
Introducing Scanalogic
 |
Scanalogic is a simple,
yet effective logic analyzer specially designed to be easily built
by beginners, so that it can be used for debugging and analyzing
their projects.
It can be used at sampling rates as high as 4
Million Samples per second. It has only 4 channels,
but that is more than enough for most hobby projects,
further more, most communication buses nowadays have very
few transmission lines, ranging from 2 to 4, so decided
4 was more than enough.
Scanalogic is a combination of a hardware (figure 2.a)
and software application (figure 2.c). As you will see
later, the hardware is as simple as it can get: An ATMEGA16
micro controller and a NAND gate! The code to be loaded
in the micro controller is provided at the end of this
page. |
Figure 2.a |
The
hardware records the samples at the desired sampling rate,
then send them to the PC application via the UART port
of the microcontroller and the RS232 port of the PC. If
your PC doesn't have an RS232 port, as mine, you can still
use a USB-RS232 converter cable, as shown in figure 2b.
|
Figure 2.b |
The
software is made with visual basic. A setup file is included
at the end of the page. It is compatible with windows
ME all the way up to XP (or maybe Vista, can someone confirm?).
The Scanalogic software controls the hardware (as you
can see, there are no buttons on the hardware) It allows
you to setup the triggering conditions, to start sampling,
to receive sampled signals, display them, analyze them,
and even store them for later analysis. |
Figure 2.c |
NOTE:
The software is actually in beta testing, more functions
are coming in next versions like:
- SPI, I2C, UART Decoding
- Saving Screen-shot to JPG file
- Post triggering data sampling.
|
3.
Building the hardware
 |
There are no secrets held for the hardware, as
the real power of this logic analyzer comes from the innovating
source code, loaded inside the ATMEGA16 microcontroller.
As
you can see in figure 3.b, there are only a microcontroller,
and a NAND gates IC and all of it resides in an old CDROM
power supply box. The DB9 connector for serial communication
is firmly glued to the box with an epoxy resin. The whole
is powered from the RTS line of the RS232 connection (pin
number 4), so there is no need for external power supply
(but you may as well use any 5V power supply if |
Figure 3.a |
your serial port cannot deliver the required current).
As you can see in the schematic below, there are no level shifting
IC like the MAX232, but believe or not, most if not 100% of current
serial communication hardware is compatible with the approach
below, where the signals are simply 'inverted', but not shifted
to +/- 12V. (Originally, in the RS232 protocol, a logic 1 is represented
with -12v, and a logic 0 is represented by +12V).
Pin 4 of the DB9 connector is used to power the device, as it
rises to +12V (theoretically) when a communication is being carried
out. The Diode D3 makes sure no negative power supply is applied
to the device, and the 5.1V zener diode D4 prevent supply voltage
from rising above 5.1 volts. Using the handshaking signals as
a power supply is far from being my invention, it have been used
in a lot of devices like mice and old external keypads...
Figure 3.b |
The probes are directly connected to micro controller.
A better approach would be to add buffers to protect the micro
controller but, for simplification, I didn't include one.
The crystal oscillator X1 can be anything from 1Mhz to 16Mhz,
but remember that the clock frequency of the microcontroller directly
affects the maximum sampling rate, according to the following
equation:
Max_Sampling_rate
= Clock_frequency/4 |
That is simply because, the most efficient code I could ever write,
needs at least 4 clock cycles to sample and store new signals.
D1 is simply a red LED, used to signal if the device is powered
up and correctly functioning.
Download
the hex file to be loaded into the ATMEGA16 for different
crystal frequencies:
-
8 MHz
- 12
MHz
- 16
MHz
(Need hex files for other frequencies? request
for it in the forum) |
4.
Downloading and using the PC side software
 |
Scanalogic
software, especially this first version is very simple and intuitive.
After you have plugged the Hardware, the configuration is simply
made via 3 steps:
1- Press F2 to chose the crystal frequency at which your microcontroller
is running, and to chose the COM port to which the hardware is
connected.
2- Press F3 to chose the sampling rate
3- Press F4 to chose the triggering condition
Then you simply need to Press F5 anytime to start the sampling.
Note that if you chose a triggering condition, the sampling will
only start when this condition is met.
Download
the installation file for SCANALOGIC
|
I hope this article was useful. Any comments and further questions
are welcome in the forum below.
Project
under construction,
register to the forum to get informed of updates by e-mail.
|
Preview of the last 15
messages discussing this page. Messages are sorted from the newest to
the oldest. |
Posted
by:
zemuro
on:
03 Feb 2010 |
Re: Scanalogic |
|
 |
Hi Ikalogic! When developing my synthesizer\controller project, I needed something to analyze MIDI data stream. After some googling I came upon Scanalogic One, developed a PCB in EAGLE, etched it and assembled the thing in no time. It didn't work at first, then I figured out that I soldered 74hc00 back to front - and after a while it was up and going perfectly. Thank you for this brilliant machine, it wonderfully expands my setup. Today I downloaded the source code for pc software, I want to implement some features like serial data analysis and rate auto-detection. Scanalogic One is very simple, but highly usable instrument, I hope all is going well with development of it's big brother, Scanalogic II. Good luck to you, Ika and all guys from this forum! Sorry for possible mistakes in my English.
Ruslan Zemlyanikin Vladivostok, Russia.
|
|
|
|
 |
 |
Posted
by:
fl_tim
on:
17 Jan 2010 |
Anyone get an atmega168 to work? |
|
 |
Quoting ezekiel181: I tried to modify the Atmega8 code that cyn posted to work with the Atmega168 with a 16mhz crystal. My "modifications" mostly consisted of changing the registers to fit the different chip.. UDR to UDR0 OCR2 to OCR2A UCSRA,B,C to UCSR0A, B C
It seems to communicate fine, sampling starts and finishes but the downloaded data is completely empty except for some junk at the end of the samples. I used the fuses H0xDF L0xDE E0x01 understanding the fuses always gives me trouble so Im not sure if thats whats causing it, or something else that needs to be changed for the different chip.
|
I am trying to get this running on my atmega168 and cannot get my setup to even communicate with the PC. My breadboarded 168 will talk to a terminal program over the serial link when I load a simple program, so I feel that things are basically connected correctly. The program that ezekiel181 posted(logic2.c) will load without errors(but with a few warnings). I am rather new to these devices, so I'm now stuck. This chip had an arduino bootloader on it, could that be a problem? And like ezekiel181, I'm not very sharp on fuses, so I have guessed there. I would appreciate any help on this, it's a really cool project?
|
|
|
|
 |
Posted
by:
ikalogic
on:
11 Jan 2010 |
Re: Scanalogic |
|
 |
| Quoting robust: visual basic not suit for this situation,DELPHI istead I wonder why no supply AVR source code? |
I have given all source codes, both for the VB program and the AVR code, just fetch on the pages of this forum
|
|
|
|
Posted
by:
ikalogic
on:
11 Jan 2010 |
Re: Scanalogic |
|
 |
Quoting Gerad: atmega 8 , ft 232 simple design , single side pcb orcad file , and the hex ( from the forum ) good work , keep it up ! greetings from romania  |
Congratulations!!!!! thanks a lot for the contribution..
|
|
|
|
Posted
by:
freddypl
on:
09 Jan 2010 |
Re: Scanalogic |
|
 |
Hi to all, I build one Scanalogic, and I want to build next one for my friend, but I have'nt ATMega16, I have many ATMega162. Is there anybody, who have hex for ATMega 162 ? Best Regards from Poland
|
|
|
|
Posted
by:
robust
on:
07 Jan 2010 |
Scanalogic |
|
 |
visual basic not suit for this situation,DELPHI istead I wonder why no supply AVR source code?
|
|
|
|
Posted
by:
gerad
on:
06 Jan 2010 |
Re: Scanalogic |
|
 |
atmega 8 , ft 232 simple design , single side pcb orcad file , and the hex ( from the forum ) good work , keep it up ! greetings from romania
|
|
|
|
Posted
by:
gerad
on:
06 Jan 2010 |
Re: Scanalogic |
|
 |
good work ika , i wait the scanalogic II every day 
this is my setup
sorry for my bad engish
|
|
|
|
Posted
by:
test4fun
on:
10 Dec 2009 |
Re: Scanalogic |
|
 |
Quoting smeck: Hello, try this: place the msstdfmt.dll file into windows folder then type this in run on start regsvr32 C:\Windows\msstdfmt.dll it helped me with this issue.
Good luck |
Thank's smeck!!! it solved my dll error problem in no time. Now i'm getting more and more excited about the release of scanalogic 2.... Very nice project.
|
|
|
|
Posted
by:
smeck
on:
10 Dec 2009 |
Re: Scanalogic |
|
 |
Hello, try this: place the msstdfmt.dll file into windows folder then type this in run on start regsvr32 C:\Windows\msstdfmt.dll it helped me with this issue.
Good luck
|
|
|
|
 |
Posted
by:
test4fun
on:
09 Dec 2009 |
Re: Scanalogic |
|
 |
I got the hardware completed last night using Atmega32 8mhz, 4050 and ftdi 232rl but i cannot get the software to run on any of my 3 Pc under win xp. the installation complet successfully but when i try to run scanlogic.exe I get error: '' Class not regisreted. You need the following file to be installed on your machine. MSSTDFMT.DLL. " I tried everything, even with the MSSTDFMT.DLL file in my system32 directory i'm having the file missing error. i tried to load the source file with VB8 and and make new exe but VB8 isn't able to upgrade the VB6 project files to VB8 format. I got win xp pro SP3, java, dotfix, all updated to last rev....still no go. Do anyone ever experiment this problem? I got no idea what's going on, I simply cannot open the software interface...looking for any sugestions.... i need help on this!!!
|
|
|
|
 |
Posted
by:
masterleous
on:
09 Nov 2009 |
Re: Scanalogic |
|
 |
Quoting ikalogic:
Quoting masterleous: Sorry i didn't see the source code of pc software. after viewing all pages i got it.
Thanks |
Thanks, you spared me the searching thought the pages to find my post.
I would be happy to see any results posted back on this forum. (a way of encouraging me to continue sharing online! ) |
Thanks for your comment, I am Naveed Murtaza from Pakistan.
I have tested your circuit with complete external power supply and with a usage of MAX232. Reason for this is that your circuit was not working with my computer as voltage levels were too low that time (Don't know why) as before connecting the whole circuit with COM port, i was getting suitable voltages, but after connection with whole circuitry, i found voltage levels of about 3.2 to 3.3 volts. I know that some Atmega8 and Atmega16 works on 3.3V, but the whole system was not working. Anyway after using external supply with MAX232 instead of NAND gate IC. It works perfectly.
|
|
|
|
 |
Posted
by:
ikalogic
on:
07 Nov 2009 |
Re: Scanalogic |
|
 |
my work on scanalogic 2 got a little delayed because i have some urgent work for a client to be done. but it's still on top of my todo list!
|
|
|
|
Posted
by:
smeck
on:
07 Nov 2009 |
|
|
You have
to be a member to post replies. |
|
|
|