AMLA - Arduino MEGA Logic Analyzer

Arduino MEGA Logic Analyzer (AMLA) Project - 4th November 2011

- 2MHz sampling rate MAX (2MSps and adjustable in AVR Studio 4)
- 8K Memory Depth MAX (7936 Bytes and adjustable in AVR Studio 4)
- Single Triggering (Rise & Fall) Only.

Picture below showing 5KHz Sine Wave from a 12bit DDS Function Generator (Analog + 8bit LSB Digital shown)


Picture below showing 200KHz Square Wave from a 12bit DDS Function Generator (Analog + 8bit LSB Digital shown)


Hex File is here (created by AVR Studio 4):

I upload the hex to Arduino MEGA using this Windows Tool:

Simple PC Client Software for the AMLA is here:

If your PC can detect your Arduino MEGA, i assumed you've installed the FTDI driver correctly which is required. If not, get from their website ;)


Source code for AMLA (asm in AVR Studio 4 for atMega1280 chip):

Supporting asm files (my asm library):

Complete AVR Studio 4 project file:

Setup: Arduino MEGA's Analog Pin ANA 8 - 15 will become Logic Analyzer Input LA 7 - 0


My objective: In near future i will try to decode a 10-20KHz digital signal from some design. So i've made a quick program to see the feasibility of Arduino MEGA as a Logic Analyzer device. My finding is that the Mega is more than enough for my future project, i should slow down the 2MSps to 200KSps to get more bits from the 20Kbps signal, so i designed the asm software to be tidy, easily adjustable and quick to upload. I've seen codes using loop unwrapping method that can do 5.33MSps on this Mega, but the code is so big that will take minutes (possibly hours, i only tried uploading few KB of sampler, not full 8KB)  to upload for 8KB sampling, i dont like it, so i choose simpler, quicker and safer method since i'm not really desperate for Samples/sec. Its possible to modify the program to capture 16 to 32 channel, i've provided quick mod for 16ch 1MSps in the asm code (just comment the #define there).

It took me 4 days to complete the whole flow (ie Mega and its PC Client) to only build the basic stuff and able so see some simple usefull info, i'm in a hurry, so dont expect perfection, just yet. The PC Client only to show the retrieved data from Mega, i'm thinking to save the data to file each time its triggered, but i'm not sure if i have time any soon, i'm quite busy right now with other things, until then.

If you find this usefull, you may donate to my Paypal account so i can buy some usefull gadget ;) Cheers fella hobbyists.