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 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
Test & Tools
  • Technologies
  • More
Test & Tools
Blog Decode Manchester codes with Digital Discovery
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Test & Tools to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: alexwonglik1
  • Date Created: 12 May 2021 11:39 PM Date Created
  • Views 3209 views
  • Likes 5 likes
  • Comments 0 comments
  • logic analyzer
  • test
  • signal
  • python
  • digital
  • manchester_decoder
  • manchester encoding
  • measurement
  • pattern generator
  • signal processing
Related
Recommended

Decode Manchester codes with Digital Discovery

alexwonglik1
alexwonglik1
12 May 2021

This project shows you how to decode Manchester codes using the Logic Analyzer instrument Digilent Digital Discovery.

 

Digilent Digital DiscoveryDigilent Digital DiscoveryTm is a combined logic analyzer, protocol analyzer, and pattern generator instrument that was created to be the ultimate embedded development companion compatible with a wide variety of digital systems. Digital Discovery was designed to optimize channels, speed, and portability. Allows you to debug, visualize, and simulate digital signals for most embedded projects. The instrument uses a 32-channel digital logic analyzer (1.2…3.3V CMOS, 8 channels at 800MS/s*, 16 channels at 400MS/s*, and 32 channels at 200MS/s). WaveForms is a free software application for Digital Discovery and enables the use of the available instruments including Logic Analyzer, Pattern Generator, and Protocol Analyzer.

 

We also use Multisim Live to simulate the communication. Multisim Live is an online SPICE circuit simulator which gives you the ability, to create, interactively simulate, learn, and share circuit all using a web browser. You have access to numerous virtual versions of benchtop test equipment like an oscilloscope, function generator, spectrum analyzer, network analyzer, and for this project, logic analyzer.

 

Manchester Encoding

A Manchester code is a self-clocking binary code achieved by encoding every data bit with a transition from high to low, or from low to high. This type of encoding is used mainly in applications where galvanic isolation is needed, or where the number of lines available for communication is limited. There are two accepted standards of Manchester encoding: one in which HIGH values are represented by falling edges of the signal and LOW values by rising edges, and the inverse.

image

Source: https://en.wikipedia.org/wiki/Manchester_code#/media/File:Manchester_encoding_both_conventions.svg

  

The main advantage of Manchester encoding is that the resulting signal won't remain at a logic HIGH or LOW level for a longer period of time, so the signal can be AC coupled, which means that the DC component of the signal can be eliminated. AC coupling an unencoded digital signal is simulated in MultsimLive. The ambiguous voltage level (0V) can be observed every time when a longer series of HIGH or LOW bits appear. However, the data rate of Manchester encoding is only half of the bandwidth. In other words, to send one information bit, two logic states have to be sent.

image

 

 

Encode a signal using Manchester encoding scheme

Let's use the Pattern Generator instrument in Digital DiscoveryDigital Discovery. We also create the binary data in Python and save it to a CSV file. This file is imported WaveForms. Here are pseudo codes

 

Import libraries NumPy, pandas

Define parameters falling edge = 1, least significant bit transferred first =1, number of bits = 8

Input the string that will be converted into binary value

Convert the string into binary values

Double every bit to make the data signal twice slower than the clock

Convert the strings to arrays of integers

Element-wise XOR two arrays to get the Manchester code

Create a data frame

 

image

 

Decode Manchester codes with Logic Analyzer

To decode the Manchester encoded signal, open the Logic Analyzer instrument in WaveForms and add Manchester at adding channels. Set the frequency to half of the frequency of the generated signal. With the help of the respective drop-down lists, set the parameters of the encoding to the same as in the Python code. Start the instrument. Set the time base and the position in a way, to make the message visible.

image

image

 

Get all the project details and the source code for this project on the Digilent Reference Page.

  • 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