Sign Up

Unlock the Gateway: Join the Embed Threads

Have an account? Sign In

Captcha Click on image to update the captcha.

Have an account? Sign In Now

Sign In

Unlock the Possibilities: Dive In with Login Access

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Embed Threads

Embed Threads

Embed Threads Navigation

  • Blogs
  • Forum
  • About Us
  • Contact Us
  • Books
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Forum
  • Communities
  • Questions
    • New Questions
    • Must Read Questions
    • Trending Questions
    • Hot Questions
  • Polls
  • Groups
  • Add group
  • Badges
  • Users
  • Help
  • Blogs
  • Forum
  • About Us
  • Contact Us
  • Books
Tanmoy Chandra Dey
  • 1
Tanmoy Chandra DeyBeginner
Asked: August 14, 20232023-08-14T06:03:30+00:00 2023-08-14T06:03:30+00:00In: Embedded Software Development

Why is the "ADDR flag" cleared without reading the SR2

  • 1

when slave address is placed in DR register then ADDR bit set but when control return from the address phase function the bit is cleared automatically .

PS: this happens only in debug mode

  • 3 3 Answers
  • 146 Views
  • 0 Followers
  • 0
Share
  • Facebook
    Leave an answer

    Leave an answer
    Cancel reply

    Browse
    Captcha Click on image to update the captcha.

    3 Answers

    • Voted
    • Oldest
    • Recent
    1. alokm014 Enlightened
      2023-08-14T09:37:35+00:00Added an answer on August 14, 2023 at 9:37 am

      The reason for this automatic clearing of the ADDR flag without explicitly reading SR2 could be attributed to the nature of the I2C protocol and its hardware implementation. When the I2C peripheral detects that the slave address matches and the ADDR flag is set, it knows that the address phase has been successfully completed. At this point, the I2C peripheral might automatically clear the ADDR flag as it transitions to the next phase of communication, which could involve reading or writing data.

      In many microcontroller or peripheral implementations of the I2C protocol, this automatic clearing of the ADDR flag can help simplify software handling

      • 0
      • Reply
      • Share
        Share
        • Share onFacebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
      • Tanmoy Chandra Dey Beginner
        2023-08-14T10:05:29+00:00Replied to answer on August 14, 2023 at 10:05 am

        Thank you for the clarification. But if it resets automatically before I can check if the addresses matched or not then how would I continue the task?
        I must know if the address matched or not.

        • 0
        • Reply
        • Share
          Share
          • Share onFacebook
          • Share on Twitter
          • Share on LinkedIn
          • Share on WhatsApp
        • Best Answer
          alokm014 Enlightened
          2023-08-14T19:17:16+00:00Replied to answer on August 14, 2023 at 7:17 pm

          Configure an interrupt to trigger when the “ADDR” flag is set. This way, when the address is matched during the address phase, an interrupt will be generated, allowing you to handle the address match in the interrupt service routine (ISR). This approach can provide you with more control over the address-matching process.

          • 1
          • Reply
          • Share
            Share
            • Share onFacebook
            • Share on Twitter
            • Share on LinkedIn
            • Share on WhatsApp

    Sidebar

    Ask A Question

    Stats

    • Questions 85
    • Answers 318
    • Best Answers 15
    • Users 799

    Free PDF Downloads

    A Roadmap to a Successful Career

    HTTP, WS and TLS: The Complete Guide

    Embedded Interview Questions

    • Popular
    • Answers
    • alokm014

      Embedded System Testing: Strategies and Approaches

      • 107 Answers
    • Paresh

      USB Serial Port giving junk data

      • 20 Answers
    • Shubha V

      Why can't we save the footprints in kicad and How ...

      • 14 Answers
    • D Sai krishna

      Error in final launch sequence

      • 7 Answers
    • Jagadesh

      SD card data logging

      • 7 Answers
    • http://genome-tech.ucsd.edu/LabNotes/index.php?title=User:ConstanceTimmerm
      http://genome-tech.ucsd.edu/LabNotes/index.php?title=User:ConstanceTimmerm added an answer Пляжи Айя-Напы — чистейший песок, вода как в сказке, обязательно… May 12, 2025 at 4:29 pm
    • https://yogaasanas.science/wiki/Auto_100B
      https://yogaasanas.science/wiki/Auto_100B added an answer Пляж Агиос Тиконас — для тех, кто любит тишину. https://www.prrpc.net/index.php/User:HelenWbw80 May 12, 2025 at 4:13 pm
    • http://searchamateur.com
      http://searchamateur.com added an answer Hello to every body, it's my first pay a visit… May 11, 2025 at 10:41 pm
    • fortune dragon
      fortune dragon added an answer Slot Fortune Dragon – jogue sem apostar . Bônus generosos… May 11, 2025 at 9:47 pm
    • important site
      important site added an answer I'm truly enjoying the design and layout of your site.… May 11, 2025 at 9:17 pm

    Explore

    • Forum
    • Communities
    • Questions
      • New Questions
      • Must Read Questions
      • Trending Questions
      • Hot Questions
    • Polls
    • Groups
    • Add group
    • Badges
    • Users
    • Help

    Footer

    Embed Threads

    Embed Threads

    Join us on a transformative journey where knowledge is amplified and solutions are empowered.

    About Us

    • Blogs
    • Forum
    • About Us
    • Contact Us
    • Books

    Legal Stuffs

    • Privacy Policy
    • Adsense Disclaimer

    Help

    • Help
    • Contact Us

    Follow

    © 2024 Embed Threads. All Rights Reserved
    With Love by Embed Threads.