Locale Icon
English
EngineerZone
EngineerZone
Precision Microcontrollers
  • Log In
  • User
  • Site
  • Search
OR
Ask a Question
  • Forums

    Popular Forums

    • LTspice
    • RF and Microwave
    • Video
    • Power Management
    • Precision ADCs
    • FPGA Reference Designs
    • Linux Software Drivers

    Product Forums

    • Amplifiers
    • Microcontrollers
    • Clock and Timing
    • Data Converters
    • Direct Digital Synthesis (DDS)
    • Energy Monitoring and Metering
    • Interface and Isolation
    • MEMS Inertial Sensors
    • Power Management
    • Processors and DSP
    • Switches/Multiplexers
    • Temperature Sensors
    • Voltage References
    View All

    Application Forums

    • A2B
    • Audio
    • Automated Test Equipment (ATE)
    • Condition-Based Monitoring
    • Depth, Perception & Ranging Technologies
    • Embedded Vision Sensing Library
    • Motor Control Hardware Platforms
    • Precision Technology Signal Chains Library
    • Video
    • Wireless Sensor Networks Reference Library

    Design Center Forums

    • ACE Evaluation Software
    • ADEF System Platforms
    • Design Tools and Calculators
    • FPGA Reference Designs
    • Linux Software Drivers
    • Microcontroller no-OS Drivers
    • Power Studio Designer
    • Power Studio Planner
    • Reference Designs
    • Robot Operating System (ROS) SDK
    • Signal Chain Power (SCP)
    • Software Interface Tools
    • System Demonstration Platform (SDP) Support
  • Learn

    Highlighted Webinar

    The Burning Question: How can ADI Solutions Ensure Rechargeable Device Batteries are Genuine?

    On the global stage, products and equipment using rechargeable batteries continue to proliferate exponentially, expecting to reach a staggering $170B market...

    Places

    • ADI Academy
    • ADI Webinars
    • Video Annex
    • Virtual Classroom

    Libraries

    • 3D ToF Depth Sensing Library
    • Continuous-Wave CMOS Time of Flight (TOF) Library
    • Embedded Vision Sensing Library
    • Gigabit Multimedia Serial Link (GMSL) Library
    • Optical Sensing Library
    • Precision Technology Signal Chains Library
    • Software Modules and SDKs Library
    • Supervisory Circuits Library
    • Wireless Sensor Networks Library

    Latest Webinars

    • Power Management Fundamentals II Session 6: Key Layout Considerations for Power
    • A 16T/16R X-Band Direct Sampling Phased Array Subsystem using Apollo MxFE
    • Power Management Fundamentals II Session 5: Deeper Look into Power Protection
    • Power Management Fundamentals II Session 4: Isolated Converters Explained
    • Maximize Your Power Regulator: Key Considerations for Thermal Performance
    View All Webinars
  • Community Hub

    Challenge Yourself!

      KCC's Quizzes AQQ294 about a digital phase splitter design

      1. Quote of the month: "I've learned that people will forget what you said, people will forget what you did, but people will never forget how you made...

    View All

    What's Brewing

      Read a Blog, Take this Quiz for Another Chance to Win a Gift Card!

      Important: Read the blog first . The quiz questions are all based on the content from the blog: Let's Take a Field-Bus Trip Your field-bus engines...

    View All

    Places

    • Community Help
    • Logic Lounge
    • Super User Program
    • Analog Dialogue Quiz

    Resources

    • EZ Code of Conduct
    • EZ How To Help Articles
    • Getting Started Guide
    • ADI: Words Matter
    • Community Help Videos
    View All
  • Blogs

    Highlighted Blogs

    Ethernet-APL’s Impact on Functional, Intrinsic, and Cyber Safety

    Power limitations have always plagued process sensors, whether because of intrinsic safety requirements (safety achieved through power limitation) or because...

     

    Balancing Enhanced Radar Resolution with FPGA-Based Pulse Compression

    Radar and sonar systems must balance range resolution with the energy required for reliable detection. Pulse compression resolves this by sending a long...

    Latest Blogs

    • ​​ISO 26262 Essentials: Ensuring Confidence in Your Software Tools ​
    • Step-by-Step: Implementing a Complete DSP Chain for Signal Analysis
    • Galvanic Isolation in SMPS: Ensuring Safety and Protection: Part 1 of 4
    • Mature, Not Old! The Longevity of 4 – 20 mA
    • Turning up the Noise: .NOISE Simulations in LTspice: Part 1 of 3
    Read All Blogs

    ADI Blogs

    • EZ Spotlight
    • The Engineering Mind
  • ContentZone

    Visit ContentZone

    ContentZone

    Technical articles. Blogs. Videos. Your ADI content, all in one place.

    View ContentZone

    Featured Content

    Featured Content Title

    Blurb About Content

    View Content By Industry

    • Aerospace and Defense Systems
    • Automotive Solutions
    • Consumer Technology Solutions
    • Data Center Solutions
    • Energy Solutions
    • Healthcare Solutions
    • Industrial Automation Technology Solutions
    • Instrumentation and Measurement Solutions
    • Intelligent Building Solutions
    • Wireless Communication Solutions

    View Content By Technology

    • A2B Audio Bus
    • ADI OtoSense Predictive Maintenance Solutions
    • Dynamic Speaker Management
    • Gallium Nitride (GaN) Technology
    • Gigabit Multimedia Serial Link (GMSL)
    • Industrial Vision
    • Power Solutions
    • Precision Technology
    • RF
    • Sensor Interfaces
    • SmartMesh
Precision Microcontrollers
  • Microcontrollers
Precision Microcontrollers
Documents ADuCM350 FAQ AFE Sequencer
  • Q&A
  • Docs/FAQs
  • File Uploads
  • Members
  • Tags
  • Cancel
  • +Documents
  • +ADuCM Cortex-M3: FAQ
  • +Aducm320: FAQ
  • -ADuCM350: FAQ
    • 4Wire-Isolated-Bioimpedance ADuCM350 Connections To Sensor
    • ADUCM350 DESIGN SUPPORT COMMUNITY - INTRO
    • ADuCM350 FAQ DFT / Impedance Measurement
    • ADuCM350 FAQ Debug
    • ADuCM350 FAQ Evaluation Kit Software Platform
    • AFE Transmit Stage
    • ADuCM350 FAQ GPIOs and Pinmuxing
    • ADuCM350 FAQ I2C serial interface
    • ADuCM350 FAQ Operational Supply Range / Power Supplies
    • ADuCM350 FAQ Parallel Display Interface(PDI)
    • ADuCM350 FAQ Power Consumption
    • ADuCM350 FAQ Power Management Unit
    • ADuCM350 FAQ Random Number Generator
    • ADuCM350 FAQ SDK Driver Specific FAQs
    • ADuCM350 FAQ SPI
    • ADuCM350 FAQ Switch Matrix
    • ADuCM350 FAQ System Clocks
    • ADuCM350 FAQ System Integrity
    • ADuCM350 SDK v2.3.0.0 now available
    • Bioimpedance Measurement Using ADuCM350
    • Optimizing RCAL,RTIA,CTIA and DAC voltage of ADuCM350 for 4-Wire Measurement.
    • Potentiostat / Amperometric Measurement Using ADuCM350
    • Unipolar Current Measurement Using ADuCM350
    • Errata for ADuCM350 I2C serial interface
    • FAQ ADuCM350 Embedded Software Development
    • How to get SDK + Eval-ADuCM350EBZ Working together.
    • FAQ for Captouch on ADuCM350
    • Known Issues for ADuCM350 Silicon and Support Material
    • ADuCM350 FAQ ADuCM350 Evaluation Kit
    • ADuCM350 FAQ AFE / ADC Measurement Channel
    • ADuCM350 FAQ AFE Measurement Circuit Impedance Range
    • ADuCM350 FAQ AFE TIA
    • ADuCM350 FAQ AFE Sequencer
    • ADuCM350 FAQ Amperometric Measurement Example
    • ADuCM350 FAQ Calibrate
    • ADuCM350 FAQ CRC accelerator
    • ADuCM350 FAQ GP Timers
    • ADuCM350 FAQ LCD controller
    • New Revision of UG-587 Available
    • ADuCM350 FAQ Potentiostat / Amperometric
    • ADuCM350 FAQ Real Time Clock (RTC)
    • First Steps: Quick Measurement with Eval-ADuCM350 & EKSP Labview GUI
  • +ADuCM355: FAQ
  • +ADuCM360: FAQ
  • +ADuCM361: FAQ
  • +ADuCRF101: FAQ
  • +Bio-Impedance & ECG Measurement Solution: FAQ
  • +CN0300: FAQ
  • +Continuously Amperometric Measurement: FAQ
  • Do we need new Maxim supplied algorithms for the MAX32664, as I assume that the ones provided for the MAXREFDES101 do not support SpO2?
  • +MAX32663A: FAQ
  • MAX32664-A HRM & SPO2 FIRMWARE V10.0.0: FAQ
  • +MAX32664GTGA+: FAQ
  • +MAX32664GTGC+: FAQ
  • +MAX32664GTGZ+: FAQ
  • +MAX32664GWEA+: FAQ
  • +MAX32664GWEB+: FAQ
  • +MAX32664GWEC+: FAQ
  • +MAX32664GWED+T: FAQ
  • +MAX32674C: FAQ

ADuCM350 FAQ AFE Sequencer

Q: How do I start writing an AFE squence ?

A: Advise to use the example sequences in the Software Development Kit as a reference, e.g. ImpedanceMeasurement_2wire.c

Then use the ADuCM350 ASH (AFE Sequence Helper) Tool to modify the sequence.

Link to ADuCM350 ASH: ADuCM350 ASH Tool (v1.0).

Q: Details on how to program the sequencer ?

A:

  • AN-1293 in Design Support Package - A Quick Guide to the ADuCM350 Sequencer.
  • Examples in Analog Front End Interface Chapter of Product Userguide. UG-587.
  • Use the ADuCM350 AFE Sequence Helper tool (see above).

Q: How deep / how many steps are available in Sequencer ?

A: Used correctly there is no limit to the sequncer depth ? If you feel adventurous you can feed it in commands from external memory.

Q: How are sequences for the AFE sequencer represented in software?

A: The afe_sequences.h file in the Software Development Kit (SDK) contains a number of example sequences. Each sequence is represented by an array of unsigned, 32-bit numbers in hexadecimal format. Each array consists of 2 pieces; the Safety Word and the sequence itself.

The first element (element [0]) of any example sequence array is the Safety Word. This is NOT part of the sequence itself. It is used to check the integrity of the sequence that has been executed. The upper half-word (bits[31:16]) contains the command count. This indicates how many commands the sequence comprises of. Note that this does NOT include the Safety Word. Each time the sequencer executes a sequence, the value in the AFE_SEQ_COUNT register is incremented by 1. When the sequence has finished executing, this value should match the command count element of the Safety Word.

The lowest byte (bits[7:0]) contains the CRC of the sequence. The CRC algorithm used is CRC-8, using the polynomial x8 + x2 + x + 1, with a seed of 1. There is a function in afe.c called crc8 which performs the calculation and mirrors the ADuCM350 hardware exactly. There is also an appendix in AN-1293 with instructions on how to use a Python CRC calculator (which is available online). Note that the CRC calculation should NOT include the Safety Word. The sequencer performs a CRC calculation on the sequences that it executes and returns the result to the AFE_SEQ_CRC register. This value should match the CRC element of the Safety Word.

Q: How are sequences triggered by the software?

A: The AFE driver (afe.c) in the SDK contains a function called adi_AFE_RunSequence which illustrates how a sequence can be triggered in software. It should be noted that this function is not optimised for performance and may not be suited to all applications, in particular where the core is required to perform other tasks while the sequencer is running. adi_AFE_RunSequence is a function which does a number of things, but remember that all of these tasks are executed on the core, the sequencer is a separate piece of hardware. First it initializes the sequencer (adi_AFE_SeqInit), pointing to the sequence to be run (txbuffer), where to put the results (rxbuffer) and how big the set of results will be (size). Some error checking is performed, some flags are set to keep track of what is happening and then the sequencer is started (adi_AFE_SeqStart). At this point, the core kicks the sequencer into action and then goes into CORE_SLEEP mode. When both the Rx DMA Done and Sequence Finished interrupts have fired, the core wakes from CORE_SLEEP mode, does some error checking and disables the FIFO and the DMA (adi_AFE_SeqStop). The very last thing the function does before returning is it checks that the CRC and command count elements of the safety word of the sequence array are equal to the CRC and command count values returned by the sequencer (adi_AFE_SeqCheck).

Q: How do I determine if I have a CRC error?  Is there a flag or error code that I can look at?

A: If you are using the adi_AFE_RunSequence function, look at the return code. If it returns ADI_AFE_ERR_SEQ_CHECK, this indicates a CRC error (i.e. a mismatch between the CRC value in the safety word and the value returned by the sequencer to the AFE_SEQ_CRC register) or a command count error (i.e. a mismatch between the command count value in the safety word and the final value in the AFE_SEQ_COUNT register after the sequence has finished). If you step through the function (you will need to set multiple breakpoints to ensure that you “run” through the piece of code where the sequence is executing, remember, the sequence executes in a separate piece of hardware to the core) you will notice that the last function, adi_AFE_SeqCheck, will return this error. Also remember that if you are setting breakpoints within the adi_AFE_RunSequence function, this is called many times for the power up and calibration steps, before the code ever gets to the actual measurement!

Q: I keep getting Command FIFO Underflow interrupts (INT_CMD_FIFO_UDF) when I run my sequence, but I can't see any reason for it.

A: The Command FIFO is 8 commands deep. The sequencer will execute 1 MMR write command in a single clock cycle. Once the Command FIFO is no longer full, it will trigger to the DMA that more commands are needed. If the command FIFO is filled with 8 MMR write commands (i.e. if the sequence has 8 consecutive MMR write commands), then these commands will be executed by the sequencer in 8 clock cycles. As soon as the FIFO starts to empty, the DMA gets a request to add more commands. But the DMA cannot fullfill this request in 8 clock cycles, so the sequencer finds an empty Command FIFO and generates an underflow interrupt (INT_CMD_FIFO_UDF). To resolve this, we can delay the sequencer a little to allow the DMA controller to catch up. After (every) 7 consecutive MMR write commands in a sequence, add a short wait (100us should be sufficient). This should resolve the problem. Don't forget to update the command count!!

Tags: safety_word aducm350 afe sdk sequencer_crc sequencer underflow aducm35x software_development_kit Show More
  • Share
  • History
  • More
  • Cancel
analog-devices logo

About Analog Devices

  • Who We Are
  • Careers
  • Newsroom
  • What We Do (Signals+)
  • Investor RelationsExternalLink
  • Quality & Reliability
  • Sales and Distribution
  • What's New on Analog.com
  • Contact Us

Find Help

  • Support
  • Resources
  • WikiExternalLink
  • Analog Dialogue
  • ADI Developer PortalExternalLink

myAnalog

Interested in the latest news and articles about ADI products, design tools, training, and events?

Go to myAnalog
  • Instagram page
  • Twitter page
  • Linkedin page
  • Youtube page
  • Facebook
  • Legal and Risk
  • Accessibility
  • Privacy Policy
  • Privacy Settings
  • Cookie Settings

©2025 Analog Devices, Inc. All Rights Reserved

analog-devices

About Analog Devices

Down Up
  • Who We Are
  • Careers
  • Newsroom
  • What We Do (Signals+)
  • Investor RelationsExternalLink
  • Quality & Reliability
  • Sales and Distribution
  • What's New on Analog.com
  • Contact Us

Find Help

Down Up
  • Support
  • Resources
  • WikiExternalLink
  • Analog Dialogue
  • ADI Developer PortalExternalLink

myAnalog

Interested in the latest news and articles about ADI products, design tools, training, and events?

Go to myAnalog
Instagram page Facebook Twitter page Linkedin page Youtube page
  • Legal and Risk
  • Accessibility
  • Privacy Policy
  • Privacy Settings
  • Cookie Settings

©2025 Analog Devices, Inc. All Rights Reserved