Username:    Password: Remember me
SCANALOGIC
ikalogic's easy to build high performance logic analyzer
By Ibrahim Kamal
Last update: 9/8/08


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.



Discussion (Last 15 posts preview...)
Preview of the last 15 messages discussing this page. Messages are sorted from the newest to the oldest.
Posted by:
heniug
on: 03 Jul 2009
Re: Scanalogic
['Quote ]
hi
thanks for the help and guidance
project works

Heniu
Posted by:
staregypt
on: 03 Jul 2009
Re: Scanalogic
['Quote ]
Please I wonder if anyone could help converting VB6 scanalogic PC interface of the analyzer to a newer type project of VB such as visual basic 2002/2005?

I was able to get Atmega8 on 16mhz to function; tested for three different channels of signals and a speed of about 65 khz, only 4Mhz sample mode seems to give correct display for first channel the others lack resolution, anyone could suggest to make improvment to enhance sampling resolution? I guess with 20Mhz might make a difference/

I wish if this project ported to pic18 with 48Mhz but I'm a novice on MCUs..
Posted by:
megaboy
on: 02 Jul 2009
Re: Scanalogic
['Quote ]
go back to the datasheet and see what every fusebit do then apply it .
i prefer to use another program like codevision or avrstudio to program the flash because it's easier than ponyprog.
Posted by:
heniug
on: 02 Jul 2009
Re: Scanalogic
['Quote ]

Quoting kurtoslaw: Turn off jtag, set extern. high speed crystal, and thatall i think:)


Thanks for the post
Please say who to select.


Full size image available in the full-featured forum

Posted by:
kurtoslaw
on: 02 Jul 2009
Re: Scanalogic
['Quote ]
Turn off jtag, set extern. high speed crystal, and thatall i think:)
Posted by:
heniug
on: 02 Jul 2009
Re: Scanalogic
['Quote ]
Hi

I did a project on the analyzer Atmega16L - 8MHz.
Atmega written input from the IMS PonyProg2000.
Communication on FT232RL installed new drivers to communicate with the PC to COM3 OK.
Communicating SCANLOGIC with atmega16 failed, Atmega LED - ON .
I have a few questions.
How to set the fuse-BIT in the Atmega?
Is communication with the need to program Atmega FT232RL?
Maybe you have a scheme of the design FT232RL with Atmega16L - SCANLOGIC

Yours
Heniu
Posted by:
User avatar
ikalogic

on: 01 Jul 2009
Re: Scanalogic
['Quote ]

Quoting poundy:
Quoting ikalogic:
Scanalogic 2 wil be compatible with a large number of ATMEGA's

I recomend the ATMEGA32 for the large ram memory it has. (note that the actuel scanalogic can only read 2000 samples, so it is useless, but scanalogic 2 can read a variable number of samples depending on the hardware)

excellent, thanks for the pointer. I might pick up a couple of them (or greater) in the near future to get myself ready for V2 :)


I might be providing soon on ebay professional PCB and components as kit, it will be more economic for you to buy them here than make your own single PCB and in the same time it supports ikalogic...
Posted by:
poundy
on: 01 Jul 2009
Re: Scanalogic
['Quote ]

Quoting ikalogic:
Scanalogic 2 wil be compatible with a large number of ATMEGA's

I recomend the ATMEGA32 for the large ram memory it has. (note that the actuel scanalogic can only read 2000 samples, so it is useless, but scanalogic 2 can read a variable number of samples depending on the hardware)

excellent, thanks for the pointer. I might pick up a couple of them (or greater) in the near future to get myself ready for V2 :)
Posted by:
User avatar
ikalogic

on: 01 Jul 2009
Re: Scanalogic
['Quote ]

Quoting poundy: In an ideal world, where you have none of the componentry in-stock, what MEGA would you chose to use to build a Scanalogic? And.... if V2 is in the wind, would that make you chose any differently?
thanks
Brett


Scanalogic 2 wil be compatible with a large number of ATMEGA's

I recomend the ATMEGA32 for the large ram memory it has. (note that the actuel scanalogic can only read 2000 samples, so it is useless, but scanalogic 2 can read a variable number of samples depending on the hardware)
Posted by:
poundy
on: 01 Jul 2009
Re: Scanalogic
['Quote ]
In an ideal world, where you have none of the componentry in-stock, what MEGA would you chose to use to build a Scanalogic? And.... if V2 is in the wind, would that make you chose any differently?
thanks
Brett
Posted by:
staregypt
on: 30 Jun 2009
Re: Scanalogic
['Quote ]
Please ika I would like to know when you can post info on version 2?
I'm very needy to troubleshoot SPI connection for a DAC IC and your project is just perfect if it works! :wink:
Have you thought to port the project to Atmega168? and to solve the connection to hardware issue can you plz check your implementation for Atmega8 you post it earlier?

Rgs.


(We born naked so we start from the beginning.We born wet so to be gentle. Then we cry to explore things niffy such as Atmega:mrgreen: )
Posted by:
User avatar
ikalogic

on: 30 Jun 2009
Re: Scanalogic - error "Connecting to hardware.. FAILED"
['Quote ]

Quoting sivaramreddy: Hello,

Is there a log file that we can see to see what could be wrong?

I am receiving an error message which states that "Connecting to Hardware... Failed"

Thanks


Hello i'll take that in consideration in the upcomming VERSION 2
Posted by:
sivaramreddy
on: 29 Jun 2009
Scanalogic - error "Connecting to hardware.. FAILED"
['Quote ]
Hello,

Is there a log file that we can see to see what could be wrong?

I am receiving an error message which states that "Connecting to Hardware... Failed"

Thanks
Posted by:
ezekiel181
on: 28 Jun 2009
Re: Scanalogic
['Quote ]
Has anyone got this working with an Atmega168?
Posted by:
staregypt
on: 26 Jun 2009
Re: Scanalogic
['Quote ]
I have Atmega8 that its fuses set to use external crystal of 4Mhz (for testing - I just set UBRRL = 25 on the code)
On the code that provided by ika for atmega8, I only could get the serial port to open but connection to hardware states it is failed, please what I can do to troubleshoot this problem? I used MAX232 adapter connected to atmega8.

Also how can I get the PC software side scanalogic converted to VB05 or different than VB6 format? can anyone do the conversion and send it to me??

Thank you very much...
You have to be a member to post replies.
Username: Remember me
Register now! it only takes an instant.
Forgot your password?


 
Unless mentioned, all content is written and designed by Ibrahim Kamal, copying is prohibited and unethical
ikalogic.com: Electronics and Robotics related projects.
All content on this site is provided as is and without any guarantee of any kind. We cannot be held responsible for any errors, omissions, or damages arising out of use of information available on this web site.
Creative Commons License
IMPORTANT COPYRIGHT NOTE: Electronics and Robotics Articles by Ibrahim KAMAL are licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.