Analog.com Analog Dialogue Wiki 简体中文
EngineerZone
EngineerZone
  • Log In
  • Site
  • Search
  • User
  • Support

    Popular Forums

    • RF and Microwave
    • Power Management
    • Video
    • FPGA Reference Designs
    • Precision ADCs
    • Linux Software Drivers
    • SigmaDSP Processors & SigmaStudio Dev. Tool

    Product Forums

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

    Application Forums

    • Audio
    • Automated Test Equipment (ATE)
    • Condition-Based Monitoring
    • Depth, Perception & Ranging Technologies
    • Embedded Vision Sensing
    • Optical Sensing
    • Precision Technology Signal Chains
    • 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
    • Reference Designs
    • Signal Chain Power (SCP)
    • Software Interface Tools
    • System Demonstration Platform (SDP) Support
  • Learn

    Recent Discussions

    • Pluto + GNURADIO frequency change
    • Pluto SDR
    • pluto sdr pyadi-iio continous iq recording
    • attribute error
    • gps-sdr-sim is not working with my ADALM-PLUTO

    Places

    • ADI Education Home
    • ADI Education China
    • ADI Education India
    • ADI Education Philippines
    • StudentZone (Analog Dialogue)
    • Virtual Classroom

    Latest Webinars

    • Optimizing GaN and GaAs RF Amplifier Performance Using Novel Biasing Techniques
    • Webinar Improving Switch-Mode Power Supplies Using Noise Cancelling Technology
    • Webinar Accelerate Your Design With a 2 to 24 GHz Wideband Transceiver Reference Design
    • How to Design an Optimized Motion Control System for Intelligent Edge Based Surveillance Camera
    • How to Enhance High Precision Current Sensing Systems
    View All
  • Community Hub

    Challenge Yourself!

      KCC's Quizzes: Buffers and Fan Out
    View All

    Places

    • Community Help
    • Logic Lounge

    Resources

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

     

    How To Design Fieldbus Agnostic Smart Factory Sensors

     

    You Passed EMC Testing… But Wait, Is There More?

    Latest Blogs

    • The 5 Things You Need to Know about RF Matching Networks
    • Does Reliability Prediction Uncertainty Justify Mandating Two Channel Safety?
    • An Inside Look at 2022
    • Meet the Person Behind the Quizzes
    • Updates Required: Why Newer is Better
    Read All Blogs

    ADI Blogs

    • EZ Spotlight
    • The Engineering Mind
  • Partners

    Electronic Design Services - PartnerZone

    • Boston Engineering
    • Calian, Advanced Technologies
    • Colorado Engineering Inc. (DBA CAES AT&E)
    • Clockworks Signal Processing
    • Epiq Solutions
    • Fidus
    • PalmSens
    • Richardson RFPD
    • Tri-Star Design, Inc.
    • VadaTech
    • Vanteon
    • X-Microwave
    View All
Precision Microcontrollers
  • Analog Microcontrollers
Precision Microcontrollers
Documents ADuCM350 FAQ AFE Sequencer
  • Forums
  • File Uploads
  • Docs/FAQs
  • Members
  • Tags
  • More
  • 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

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!!

  • safety_word
  • aducm350
  • afe
  • sdk
  • sequencer_crc
  • sequencer
  • underflow
  • aducm35x
  • software_development_kit
  • Share
  • History
  • More
  • Cancel
Related
Recommended
 
Social
Quick Links
  • About ADI
  • Partners
  • Analog Dialogue
  • Careers
  • Contact us
  • Investor Relations
  • News Room
  • Quality & Reliability
  • Sales & Distribution
  • Analog Garage
Languages
  • English
  • 简体中文
  • 日本語
  • Руccкий
Newsletters

Interested in the latest news and articles about ADI products, design tools, training and events? Choose from one of our 12 newsletters that match your product area of interest, delivered monthly or quarterly to your inbox.

Sign Up
Switch to mobile view
Analog Logo
© 1995 - 2023 Analog Devices, Inc. All Rights Reserved 沪ICP备09046653号-1
  • ©
  • 1995 - 2023 Analog Devices, Inc. All Rights Reserved
  • 沪ICP备09046653号-1
  • Sitemap
  • Privacy & Security
  • Privacy Settings
  • Terms of use
EngineerZone Uses cookies to ensure you get the best experience in our community. For more information on cookies, please read our Privacy & Security Statement.