element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • 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 Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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
  • Settings
Community Hub
Community Hub
Member and Staff Blogs Analog Discovery 3 - Pattern generator & logic analyzer
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Community Hub to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: kk99
  • Date Created: 30 Mar 2026 3:11 PM Date Created
  • Views 85 views
  • Likes 10 likes
  • Comments 2 comments
  • avr
  • microchip
  • Analog Discovery 3
Related
Recommended

Analog Discovery 3 - Pattern generator & logic analyzer

kk99
kk99
30 Mar 2026

image

Today, I decided to check the pattern generator and logic analyzer features of the Analog Discovery 3. I have used a Microchip development board from the Curiosity Nano series with AVR16EB32 MCU, as a device under test unit. The AVR16EB32 MCU has support for configurable custom logic, which I configured to a simple AND gate, which uses PC1 and PC2 pins as inputs, and a PC3 pin as output. At the input of this gate was provided a pattern generated by a pattern generator and the output was captured by a logic analyzer. Below there is a block diagram of the setup that was performed during this test.

image

Here is a connection setup to the Curiosity Nano board:

image

I have created a simple program in C that setup CCL in the proper mode of AND gate with the requested pins. Here is a listing of this code:

#define F_CPU 3333333UL
#include <avr/io.h>
#include <util/delay.h>

int main(void)
{
    PORTC.DIR &= ~PIN1_bm; // PC1 - LUT1 IN[0]
    PORTC.DIR &= ~PIN2_bm; // PC2 - LUT1 IN[1]
    PORTC.DIR |= PIN3_bm;  // PC3 - LUT1 output

    CCL.LUT1CTRLB = CCL_INSEL1_IN1_gc; // IO pin LUTn-IN1 input source
    CCL.LUT1CTRLC = CCL_INSEL2_IN2_gc; // IO pin LUTn-IN2 input source
    CCL.TRUTH1 = 0x40; // Configure Truth Table
    CCL.LUT1CTRLA = CCL_OUTEN_bm; // Enable LUT0 output on IO pin
    CCL.LUT1CTRLA |= CCL_ENABLE_bm; // Enable LUTs
    CCL.CTRLA = CCL_ENABLE_bm; // Enable CCL module

    PORTF.DIR |= PIN5_bm; // LED 0

    while (1) {
        PORTF.OUTSET = PIN5_bm;
        _delay_ms(500);
        PORTF.OUTCLR = PIN5_bm;
        _delay_ms(500);
    }
}

I have performed a compilation of this source with avr-gcc in version 14.2.0 under the Linux system with the following commands:

avr-gcc -mmcu=avr16eb32 -Os -o main.elf main.c
avr-objcopy -O ihex main.elf main.hex

As a utility to flash the on-chip memory of the MCU, I have used an avrdude in version 8.1. The uploading of the output hex file was done with the following command:

./avrdude_Linux_64bit/bin/avrdude -c pkobn_updi -P usb -p avr16eb32 -U flash:w:main.hex
Reading 222 bytes for flash from input file main.hex
Writing 222 bytes to flash
Writing | ################################################## | 100% 0.20 s
Reading | ################################################## | 100% 0.06 s
222 bytes of flash verified

Avrdude done.  Thank you.

In WaveForms, I have created a pattern that uses DIO 1 and DIO 0 pins. The DIO 0 was configured as a clock type with a frequency of 1 kHz, while DIO 0 as a pulse with low to high transition. The created pattern was run in infinite mode. Below is a screenshot of this configuration.

image

The logic analyzer was configured to capture the DIO 2, DIO 1 and DIO 0 pins. It was configured for single shot capture. Below there is screenshot:

image

As presented in the attached screenshot, the configured AND gate in AVR16EB32 MCU worked properly.

The pattern generator and logic analyzer available on Analog Discovery 3 gives a big flexibility in the case of quick testing of protocol or DUTs, which do not require a high speed of sampling.

  • Sign in to reply
  • genebren
    genebren 16 hours ago in reply to DAB

    I have spent a fair amount of my career in the automatic test equipment industry and there are a fair number of testers that do the majority of their digital testing by using pattern generation.  We used graycode patterns, with 15 different frequencies (and their complements) to apply a pseudo random pattern to the inputs and then collect CRC values from the outputs for testing devices.  With some effort we were able to test a wide variety of components with these simple signals.  By applying the higher frequency signals to clock and control lines, and lower frequency to other inputs, you could get some pretty good coverage (enough to find assembly defects.  This was all done in-circuit, with pogo pins on each 'net' on the board.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB 16 hours ago

    I have to admit, I have never used a pattern generator to test a chip or circuit.

    • Cancel
    • Vote Up 0 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 © 2026 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

  • X
  • Facebook
  • linkedin
  • YouTube