element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
  • Settings
Arduino
  • Products
  • More
Arduino
Documents Tutorial FRDM-KL25Z: Turning the Freescale Freedom Board into a Logic Analyzer
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: FreescaleTools_and_Software
  • Date Created: 11 Feb 2013 11:03 AM Date Created
  • Last Updated Last Updated: 1 Nov 2016 9:21 PM
  • Views 818 views
  • Likes 2 likes
  • Comments 0 comments
Related
Recommended

Tutorial FRDM-KL25Z: Turning the Freescale Freedom Board into a Logic Analyzer

This tutorial was extracted from Erich Styger blog http://mcuoneclipse.wordpress.com with his agreement.

image image

 

 

I think the most important tool for a firmware engineer is a Logic Analyzer. I always have one on my desk. Working in different locations, sometimes I forget to carry it with me. And for sure I would need it. To buy another one to compensate my laziness? Or maybe there is another solution? And here I stumbled over an article about the Logic Sniffer project recently: it is about an open source logic analyzer hardware and firmware project. What a cool idea! Why not using my FRDM-KL25Z Freedom board as a Logic Analyzer? Heck, that would be awesome :-)

 

 

I2C Capture with Decoder

Logic Analyzer with the KL25Z Freedom Board

  

 

 

After some nights of plumbing and research, I finally have it working. And here is all the information to do the same with your Freedom Board…

 

:idea:While this post is using the Freedom board, it is not limited to that board. Actually the software works with any other microcontroller :-)

  

 

Architecture

 

LogicSniffer is an OLS-client alternative software client for the Open Bench Logic Sniffer hardware produced by DangerousPrototypes. It is using the original SUMP protocol and an extension of it.

 

 

Architecture

Architecture

 

 

The architecture is rather simple: on the Freedom board I have an application running which uses input pins to record the logic signals and stores it into a RAM buffer. The application communicates with the host over COM (Virtual COM, OpenSDA USB CDC in my case) with the SUMP protocol. On the host there is a client implemented in Java running which does all the presentation. Simple as that :-) .

 

 

CodeWarrior Project

 

A CodeWarrior for MCU10.3 project is available on GitHub. This project implements a Logic Analyzer probe. It is using the OpenSDA USB CDC port to communicate with the client. I have configured the SCI to communicate with 115200 baud.

 

 

Logic Analyzer Components

Logic Analyzer Components

   

   

Once running the probe, the Freedom blinks the red RGB LED:

   

 

Flashing Red LED

Flashing Red LED

 

 

Connecting to Signals

 

The Freedom board headers can be used to connect to the external signals. Be aware that GND needs to be connected, and that the FRDM board is 3.3V. So do *not* :!: connect to higher voltages as this might destroy the board!

 

 

Installing OLS Client

 

I use the Logic Sniffer OLS client, written in Java (cross-platform). I downloaded it from http://www.lxtreme.nl/ols/. Installation is easy: unzip it to a folder on the host machine:

 

 

OLS client installed

OLS client installed

 

 

The client is using configuration files for all the different probes supported I have prepared a configuration file for the  FRDM-KL25ZFRDM-KL25Z board Download the file ols.profile-FRDM-KL25ZLogicLogger.cfg from GitHub and place it inside the plugins folder of the client:

 

 

KL25Z profile file inside plugins folder of client

KL25Z profile file inside plugins folder of client

 

 

Run the client with the ‘run.bat’ in the client software root folder. This opens a DOS shell and the Java client.

 

 

Logic Analyzer Client Main Window

Logic Analyzer Client Main Window

 

 

As device, I use the OpenBench LogicSniffer device:

 

 

OpenBench Logic Analyzer Device Setting

OpenBench LogicSniffer Device Setting

 

 

To start capturing, press the ‘Capture’ button:

 

 

Start Capturing

Start Capturing

 

 

This opens a dialog with the port settings. In the CodeWarrior project I’m using a serial port with 11500 baud:

 

 

Port Settings

Port Settings

 

 

To verify if communication with the works properly, the ‘Show device metadata’ button is used:

 

 

Show Device Metadata

Show Device Metadata

 

 

Make sure that the Freedom board is selected as device:

 

 

FRDM-KL25Z LogicLogger as Selected Device

FRDM-KL25ZFRDM-KL25ZLogicLogger as Selected Device

 

 

:!: It is important to select the correct device, as the configuration file defines the buffer size. If device/configuration does not match, then communication will fail.

 

Pressing the ‘Capture’ button will start getting the data from the KL25Z:

 

 

Capture

Capture

 

  

The captured data will show up:

 

 

Captured Data

Captured Data

 

 

Possible Enhancements

 

The application on the  FRDM-KL25ZFRDM-KL25Z is a combination of C code and Processor Expert components I would love to create a Processor Expert component for the firmware(buffer settings sampling rate etc as any of these changes need a manual change of the configuration file I could generate that configuration file from the Processor Expert component to make things easier Additionally I do not support triggers yet(that would be great And a more flexible probe pin assignments would be good too(I’m using now 8bit/pins of PTC port

 

 

Summary

 

I still love my Saleae Logic Analyzer: the software and hardware is simply superb! But for hobby projects I have now an open source alternative based on the Freedom board :-) . I cannot have the 50 MHz sampling as with the Saleae, but works well for many of my needs.

 

 

Freedom KL25Z used as Logic Analyzer on an S08 Board

Freedom KL25Z used as Logic Analyzer on an S08 Board

 

 

Happy Analyzing :-)

  • avr
  • microchip
  • cortex-m0+
  • kl25
  • freescale
  • Cortex-M
  • cortex
  • frdm-kl25z
  • stm32
  • kinetis-l
  • cortex-m0
  • logic_analyzer
  • nxp
  • st
  • arm
  • freedom
  • pic
  • atmel
  • lpc
  • Share
  • History
  • More
  • Cancel
  • Sign in to reply
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 © 2025 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