I2C device address changing of MCP23017 I/O extender

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
2
down vote

favorite












When I connect all A0, A1 and A2 to ground, then my device address of the MCP23017 is 0x20 (constant).



But when I disconnect the A0 from ground, then the device address is switching between 20 and 21 everytime I check with the i2cdetect command?



Why isn't the device address constantly 21?







share|improve this question


























    up vote
    2
    down vote

    favorite












    When I connect all A0, A1 and A2 to ground, then my device address of the MCP23017 is 0x20 (constant).



    But when I disconnect the A0 from ground, then the device address is switching between 20 and 21 everytime I check with the i2cdetect command?



    Why isn't the device address constantly 21?







    share|improve this question






















      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      When I connect all A0, A1 and A2 to ground, then my device address of the MCP23017 is 0x20 (constant).



      But when I disconnect the A0 from ground, then the device address is switching between 20 and 21 everytime I check with the i2cdetect command?



      Why isn't the device address constantly 21?







      share|improve this question












      When I connect all A0, A1 and A2 to ground, then my device address of the MCP23017 is 0x20 (constant).



      But when I disconnect the A0 from ground, then the device address is switching between 20 and 21 everytime I check with the i2cdetect command?



      Why isn't the device address constantly 21?









      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 29 at 17:20









      Jochem Gruter

      1132




      1132




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          Probably because the pin is floating.



          Indeed the datasheet says of pins A0, A1, A2 "Hardware address pin. Must be externally biased."



          This means you must tie each pin either low or high, you must not let them float.






          share|improve this answer
















          • 1




            Thanks, I indeed didn't connected to high.
            – Jochem Gruter
            Aug 29 at 17:52










          • Also check the errata (always a good idea, doubly so when microchip is involved), I have a feeling that there is a subtle trap in the write to enable hardware addressing on those parts.
            – Dan Mills
            Aug 29 at 20:47










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "447"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fraspberrypi.stackexchange.com%2fquestions%2f88628%2fi2c-device-address-changing-of-mcp23017-i-o-extender%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          3
          down vote



          accepted










          Probably because the pin is floating.



          Indeed the datasheet says of pins A0, A1, A2 "Hardware address pin. Must be externally biased."



          This means you must tie each pin either low or high, you must not let them float.






          share|improve this answer
















          • 1




            Thanks, I indeed didn't connected to high.
            – Jochem Gruter
            Aug 29 at 17:52










          • Also check the errata (always a good idea, doubly so when microchip is involved), I have a feeling that there is a subtle trap in the write to enable hardware addressing on those parts.
            – Dan Mills
            Aug 29 at 20:47














          up vote
          3
          down vote



          accepted










          Probably because the pin is floating.



          Indeed the datasheet says of pins A0, A1, A2 "Hardware address pin. Must be externally biased."



          This means you must tie each pin either low or high, you must not let them float.






          share|improve this answer
















          • 1




            Thanks, I indeed didn't connected to high.
            – Jochem Gruter
            Aug 29 at 17:52










          • Also check the errata (always a good idea, doubly so when microchip is involved), I have a feeling that there is a subtle trap in the write to enable hardware addressing on those parts.
            – Dan Mills
            Aug 29 at 20:47












          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          Probably because the pin is floating.



          Indeed the datasheet says of pins A0, A1, A2 "Hardware address pin. Must be externally biased."



          This means you must tie each pin either low or high, you must not let them float.






          share|improve this answer












          Probably because the pin is floating.



          Indeed the datasheet says of pins A0, A1, A2 "Hardware address pin. Must be externally biased."



          This means you must tie each pin either low or high, you must not let them float.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 29 at 17:25









          joan

          46.4k34477




          46.4k34477







          • 1




            Thanks, I indeed didn't connected to high.
            – Jochem Gruter
            Aug 29 at 17:52










          • Also check the errata (always a good idea, doubly so when microchip is involved), I have a feeling that there is a subtle trap in the write to enable hardware addressing on those parts.
            – Dan Mills
            Aug 29 at 20:47












          • 1




            Thanks, I indeed didn't connected to high.
            – Jochem Gruter
            Aug 29 at 17:52










          • Also check the errata (always a good idea, doubly so when microchip is involved), I have a feeling that there is a subtle trap in the write to enable hardware addressing on those parts.
            – Dan Mills
            Aug 29 at 20:47







          1




          1




          Thanks, I indeed didn't connected to high.
          – Jochem Gruter
          Aug 29 at 17:52




          Thanks, I indeed didn't connected to high.
          – Jochem Gruter
          Aug 29 at 17:52












          Also check the errata (always a good idea, doubly so when microchip is involved), I have a feeling that there is a subtle trap in the write to enable hardware addressing on those parts.
          – Dan Mills
          Aug 29 at 20:47




          Also check the errata (always a good idea, doubly so when microchip is involved), I have a feeling that there is a subtle trap in the write to enable hardware addressing on those parts.
          – Dan Mills
          Aug 29 at 20:47

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fraspberrypi.stackexchange.com%2fquestions%2f88628%2fi2c-device-address-changing-of-mcp23017-i-o-extender%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          Installing NextGIS Connect into QGIS 3?

          One-line joke