Locale Icon
English
  • 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
    • Reference Designs
    • Signal Chain Power (SCP)
    • Software Interface Tools
    • System Demonstration Platform (SDP) Support
  • Learn

    Highlighted Webinar

    Simulation and Modeling: Tools for Reducing Risk and Getting to Market

    Models have the potential to accelerate engineers' design process, offering an interactive platform for using and evaluating products. A simulation model...

    Places

    • ADI Education Home
    • ADI Webinars
    • GMSL U
    • StudentZone (Analog Dialogue)
    • 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

    • Design Smarter: Integrated Precision Signal Chains for Scientific Instrumentation
    • Simulation and Modeling: Tools for Reducing Risk and Getting to Market
    • Simplifying Connectivity - Remote Controlled (RC) Nodes in a Software Defined Vehicle (SDV)
    • Simplify High-Accuracy Instrumentation Design with Latest Precision Data Converters
    • Design High Performance Power Systems with Ultralow Noise Technology
    View All Webinars
  • Community Hub

    Challenge Yourself!

      KCC's Quizzes AQQ288 about an amazing Equations System

      1. First, the quote of the week: " The chief function of the body is to carry the brain around " - Thomas A. Edison 2. And here is the new challenge...

    View All

    What's Brewing

      GMSL Quiz! Read the blog, take the quiz, and enter to win a gift card!

      Quiz! Read the GMSL Link Lock Blog - Take the Quiz and You are Entered to Win! Important: Read the blog first . The quiz questions are all based on...

    View All

    Places

    • Community Help
    • Logic Lounge
    • Super User Program

    Resources

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

    Highlighted Blogs

    Corporate Clichés and the Intelligent “Analog” Edge

    What if the concept of the “Intelligent Edge” were made a little easier to understand? Einstein famously said, " If you can't explain it simply, you don...

     

    Keeping Up with LTspice

    I don't think I'm alone when I say: I love SPICE . Circuit simulation is no substitute for building and testing actual circuits, but simulation can be...

    Latest Blogs

    • GMSL Debugging: Detecting the Pixel Clock
    • When Signals Go South: Preventing Transceiver Failures with Fault Protection
    • Are Some Diagnostics Self-checking?
    • Future-Proof Your Network: Benefits of Integrating Cellular DAS Remote Access Unit: Part 3 of 4
    • Field Monitoring and the Continuous Pursuit of Functional Safety
    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
    • Internet of Things (IoT)
    • 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
    • Security Solutions
    • Sensor Interfaces
    • SmartMesh
  • Partners

    Partner Forums

    • Boston Engineering
    • PalmSens
    • Richardson RFPD

    Partner Libraries

    • Calian, Advanced Technologies Library
    • Clockworks Signal Processing Library
    • Colorado Engineering Inc. (DBA CAES AT&E) Library
    • Epiq Solutions Library
    • Fidus Library
    • Tri-Star Design, Inc. Library
    • VadaTech Library
    • Vanteon Library
    • X-Microwave Library
EngineerZone
EngineerZone
Motor Control Hardware Platforms
  • Log In
  • User
  • Site
  • Search
OR
Ask a Question
Motor Control Hardware Platforms
Motor Control Hardware Platforms
Documents Double Execution of Interrupt
  • Forums
  • FAQs/ Docs
  • Members
  • Tags
  • More
  • Cancel
  • Documents
  • +ADIMonitor: FAQ
  • +Arduino: FAQ
  • -CM40x: FAQ
    • Double Execution of Interrupt
    • Getting started with the EV-MCS-LVDRV-Z (LV FlexMC) motor control platform
  • +Code Examples: FAQ
  • +Firmware: FAQ
  • +HPPWM: FAQ
  • +Motor Control: FAQ
  • +Motors: FAQ
  • +PCB Guidelines: FAQ
  • +Platform Schematics: FAQ
  • +Raspberry Pi: FAQ
  • +Specific Products: FAQ
  • +Technical: FAQ
  • +TMCL: FAQ
  • Topic: FAQ
  • Trinamic Customs: FAQ

Double Execution of Interrupt

CM40x has multiple clock domains/buses: AHB, PAB, APB, AXI. The necessary bus conversions add latency as MMR reads/writes traverse through the fabric (typically when a peripheral register is accessed from the core domain).  In other words, each MMR write would need to stall code execution until the operation made the round-trip through the fabric This can be over 10 SYSCLKs per write.

For most MMR writes however, it's acceptable to do the write and proceed code execution right away. There is no need to wait until the write has actually reached the peripheral. If this mode is acceptable CM40x supports "Posted Writes" which immediately acknowledge writes before the peripherals knows if they were successful. This brings down the latency considerably but is some cases it requires special attention from the programmer.

Consider an ISR with only a few instructions in it. For this example, we look at ISR for PWM0 SYNC but it applies to any interrupt:

void PWM0_SYNC_ISR(uint32_t iid, void* handlerArg){

  *pREG_PWM0_STAT = BITM_PWM_STAT_TMR0PER;

  *pREG_PWM0_ILAT = BITM_PWM_ILAT_TMR0PER;  

}

 

Here the ISR only contains a few instructions - clear of STAT and ILAT register. These writes has to transverse across clock domains and assuming Posted Writes is enabled, it means the clear of IALT has not taken effect before the end of the ISR. To the interrupt handler it appears like IALT is set again as soon as the ISR is exited, leading to a new execution of the interrupt - Double Execution. This is an unwanted consequence of using Posted Writes.

 

To avoid this, Posted Writes can be disabled. However, for the most part, Posted Writes is desirable and significantly improves code performance. Therefore, it is better to leave Posted Writes enabled and deal with the special cases.

 

Another work-around is to clear ILAT at the top of the ISR. If the ISR has several instructions in it, the execution time will allow for the write to go though before exiting the ISR.

In cases where the ISR only has a few instructions in it (like the example above), the programmer must take special care to make sure the write goes through. For that the assembler instructions sev and isb are helpful. This ensures synchronization across clock domains and flushes the pipeline to the processor.

With synchronization, the ISR looks like this:

void PWM0_SYNC_ISR(uint32_t iid, void* handlerArg){

  *pREG_PWM0_STAT = BITM_PWM_STAT_TMR0PER;

  *pREG_PWM0_ILAT = BITM_PWM_ILAT_TMR0PER;  

  asm("sev;isb;");

}

  • 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

Get the Latest News

Stay up to date with our latest news and articles about Analog Devices' products, design tools, trainings, and events.

Sign Up Now
  • Instagram page
  • Twitter page
  • Linkedin page
  • Youtube page
  • Facebook
  • Legal and Risk
  • Accessibility
  • Privacy Policy
  • Privacy Settings
  • Cookie Settings
沪ICP备09046653号-1

©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

Get the Latest News

Stay up to date with our latest news and articles about Analog Devices' products, design tools, trainings, and events.

Instagram page Facebook Twitter page Linkedin page Youtube page
  • Legal and Risk
  • Accessibility
  • Privacy Policy
  • Privacy Settings
  • Cookie Settings
沪ICP备09046653号-1

©2025 Analog Devices, Inc. All Rights Reserved