element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs Make a Logic Analyzer from your Dev Kit Part 1: Arduino UNO
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 13 Mar 2015 9:40 PM Date Created
  • Views 8038 views
  • Likes 6 likes
  • Comments 3 comments
  • i2c
  • sketch
  • spi
  • uart
  • logic_analyzer
  • protocol
  • logic_sniffer
  • arduino
  • feature_tutorial
Related
Recommended

Make a Logic Analyzer from your Dev Kit Part 1: Arduino UNO

Jan Cumps
Jan Cumps
13 Mar 2015

Yes, your Arduino Uno can be turned into a logic analyzer.

Andrew Gillham has created a sketch that turns the UNO into a 6 channel SUMP compatible analyzer.

 

image

 

The maximum sample speed is 4 MHz. You can get 256 µS worth of samples for that frequency. At 500 kHz you can sample 2 ms.

At the lowest rate of 10 kHz you can sample 102 seconds worth of signal.

 

The picture below shows a 25 kHz signal sampled at 1 MHz.

 

1Mhz.png

 

Although you can get up to 4 MHz captures, using it at that frequency is a bit of a stretch. The trigger logic isn't up to the mark at that speed. The lag between the trigger detection and the sample start is too big.

But at 1MHz and below it works just fine.

As client, I use the Logic Sniffer from jawi (OLS). I've tested it on Windows 8.x and on Ubuntu 12. It works fine in both configurations.

image

The above capture is showing the signals of the Arduino ShiftOut example, where the values of 'DS In' are shifted into a register by the clock on line 2, and the output on Q0 -> Q2 can be seen after the latch up at line 3.

In the image above, I'm shifting in the values 1, 2 and 3 - each of them followed by a latch.

The Logic Sniffer has a set of protocol decoders, e.g I2C, UART and SPI.

image

*channel 5

Channel 5 is on the same pin as the LED13. You have to be careful if you want to use it as an input channel for the logic analyzer.

The signal that you connect to that pin will be loaded by the led and its series resistor. It's best to use it on a not-so-sentive signal.

If you want to disable that channel, follow the instructions in the sketch and disable a line of code:

 

/* Comment out CHAN5 if you don't want to use the LED pin for an input */
#define CHAN5 13
 

 

 

 

I've tested the sketch with a UNO and a Duemilanove. I have worked with someone who got it to work on a Mega (where it has more capabilities).

I couldn't get it to work on my Yún. The sketch compiles and runs on the Yún, but the connection between the Arduino ond the Logic Sniffer software hangs halfway sampling.

 

In the next part, I'm using a Papilio FPGA development board (with Xilinx Spartan 6) as analyzer. We'll jump up to 32 channels and loads of MHz there.

 

Related Blog
Make a Logic Analyzer from your Dev Kit Part 1: Arduino UNO
Make a Logic Analyzer from your Dev Kit Part 2: Papilio FPGA
Make a Logic Analyzer from your Dev Kit Part 3: Level Translator and Buffer
  • Sign in to reply

Top Comments

  • Former Member
    Former Member over 7 years ago +1
    Awesome. I am gathering the parts right away for the build.
  • clem57
    clem57 over 7 years ago +1
    How about using a Arduino compatible that runs at say 80 Mhz? Would that be fast enough to notice improved sampling? Oh where can I find the next part? Clem
  • Jan Cumps
    Jan Cumps over 7 years ago in reply to clem57 +1
    clem57 , yes, but you'd still end up with a marginally useful analyser when using a microcontroller - it's,not the right tool to do that front end sampling. FPGA is a better choice to capture the signals…
  • Jan Cumps
    Jan Cumps over 7 years ago in reply to clem57

    clem57, yes, but you'd still end up with a marginally useful analyser when using a microcontroller - it's,not the right tool to do that front end sampling.

     

    FPGA is a better choice to capture the signals. I've used a Papilio board with a Xilinx Spartan 6:

    Make a Logic Analyzer from your Dev Kit Part 2: Papilio FPGA

    That board, with an input buffer to translate logic levels, is an already decent tool to capture digital traffic.

    I still wouldn't consider this a mature logic analyser - the front end isn't versatile enough to deal with many commercial digital signals that go negative or go above 5 volts, the trigger possibilities are at best 'beginner worthy', but with the right software it's a good protocol analyser.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • clem57
    clem57 over 7 years ago

    How about using a Arduino compatible that runs at say 80 Mhz? Would that be fast enough to notice improved sampling?

    Oh where can I find the next part?

    Clem

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 7 years ago

    Awesome. I am gathering the parts right away for the build.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube