+ Post New Thread
Results 1 to 15 of 15
  1. #1
    Member level 1
    Points: 191, Level: 2

    Join Date
    Feb 2019
    Posts
    35
    Helped
    0 / 0
    Points
    191
    Level
    2

    MCP4261 need manually power off from time to time or not working well

    Do you have idea why my MCP4261 need manually power off time by time, otherwise it can't be write correctly.

  2. #2
    Super Moderator
    Points: 73,905, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,991
    Helped
    3418 / 3418
    Points
    73,905
    Level
    66

    Re: MCP4261 need manually power off from time to time or not working well

    Hi,

    My idea: You did something wrong... = not according the datasheet.

    But we are not able to verify this, because you didnīt give any information.
    * Schematic
    * PCB layout
    * code
    * scope pictures
    * test conditions
    ...

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  3. #3
    Member level 1
    Points: 191, Level: 2

    Join Date
    Feb 2019
    Posts
    35
    Helped
    0 / 0
    Points
    191
    Level
    2

    Re: MCP4261 need manually power off from time to time or not working well

    Quote Originally Posted by KlausST View Post
    Hi,

    My idea: You did something wrong... = not according the datasheet.

    But we are not able to verify this, because you didnīt give any information.
    * Schematic
    * PCB layout
    * code
    * scope pictures
    * test conditions
    ...

    Klaus
    Thank Klaus,
    The drawing attached here.
    Click image for larger version. 

Name:	0_MCP_MEGA2560.JPG 
Views:	7 
Size:	73.9 KB 
ID:	151951



    •   AltAdvertisment

        
       

  4. #4
    Super Moderator
    Points: 73,905, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,991
    Helped
    3418 / 3418
    Points
    73,905
    Level
    66

    Re: MCP4261 need manually power off from time to time or not working well

    Hi,

    In my eyes it is very likely that you confuse yourself with this symbol and itīs wrong pin numbering.
    Please draw a more suitable schematic. Even hand drawn will be better.

    As written in post#2 --> we need more information.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  5. #5
    Member level 1
    Points: 191, Level: 2

    Join Date
    Feb 2019
    Posts
    35
    Helped
    0 / 0
    Points
    191
    Level
    2

    Re: MCP4261 need manually power off from time to time or not working well

    Quote Originally Posted by KlausST View Post
    Hi,

    In my eyes it is very likely that you confuse yourself with this symbol and itīs wrong pin numbering.
    Please draw a more suitable schematic. Even hand drawn will be better.

    As written in post#2 --> we need more information.

    Klaus
    Thank you.
    Can you point out which pin is not correct? The drawing is what I'm using now and it is working well, just some time need be power off.



  6. #6
    Member level 1
    Points: 191, Level: 2

    Join Date
    Feb 2019
    Posts
    35
    Helped
    0 / 0
    Points
    191
    Level
    2

    Re: MCP4261 need manually power off from time to time or not working well

    The CODE is here and the LEDS just on/off one time after added the shutdown function, otherwise it should be on/off cycle.
    Code:
    // inslude the SPI library:
    #include <SPI.h>
    
    
    // set pin 10 as the slave select for the digital pot:
    //const int slaveSelectPin = 10;
    
    const int slaveSelectPin = 53; //WAS 10 on Arduino uno.
    const int shutdownPin = 49; // was 7 on uno.
    
    const int wiper0writeAddr = B00000000;
    const int wiper1writeAddr = B00010000;
    
    const int analogInPin_c = A5;
    
    void setup() {
    
     
      
      // set the slaveSelectPin as an output:
      pinMode(slaveSelectPin, OUTPUT);
      // initialize SPI:
      SPI.begin();
    
     pinMode (shutdownPin, OUTPUT);
      // start with all the pots shutdown
     digitalWrite(shutdownPin, LOW);
      
    }
    
    void loop() {
    
     delay(2);
      digitalWrite(slaveSelectPin, LOW);
    
      digitalWrite(shutdownPin, HIGH); //Turn off shutdown THIS MAKE WRITEABLE OR DISABLE THIS CAN'T WRITE
      delay(2);
    
    
      // go through the six channels of the digital pot:
        for (int channel = 0; channel < 6; channel++) {
    
    //int channel = 0;
    
       // for (int channel = 0; channel < 2; channel++) {
          
       
        // change the resistance on this channel from min to max:
        for (int level = 0; level < 255; level++) {
          digitalPotWrite(channel, level);
          delay(10);
        }
        // wait a second at the top:
        delay(100);
        // change the resistance on this channel from max to min:
        for (int level = 0; level < 255; level++) {
          digitalPotWrite(channel, 255 - level);
    
          digitalPotWrite(wiper1writeAddr, 255 - level);
    
           digitalPotWrite(wiper0writeAddr, 255 - level);
    
           delay(2);
      digitalWrite(shutdownPin, LOW); //Turn off shutdown THIS MAKE WRITEABLE OR DISABLE THIS CAN'T WRITE
      delay(2);
    
          delay(10);
        }
      }
    
    }
    
    void digitalPotWrite(int address, int value) {
      // take the SS pin low to select the chip:
      digitalWrite(slaveSelectPin, LOW);
      //  send in the address and value via SPI:
      SPI.transfer(address);
      SPI.transfer(value);
      // take the SS pin high to de-select the chip:
      digitalWrite(slaveSelectPin, HIGH);
    }



  7. #7
    Member level 1
    Points: 191, Level: 2

    Join Date
    Feb 2019
    Posts
    35
    Helped
    0 / 0
    Points
    191
    Level
    2

    Re: MCP4261 need manually power off from time to time or not working well

    Any comment on how to use the reset pin?



  8. #8
    Super Moderator
    Points: 73,905, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,991
    Helped
    3418 / 3418
    Points
    73,905
    Level
    66

    Re: MCP4261 need manually power off from time to time or not working well

    Hi,

    Again just a confusing post...
    --> The MCP4261 has no reset pin...

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  9. #9
    Member level 1
    Points: 191, Level: 2

    Join Date
    Feb 2019
    Posts
    35
    Helped
    0 / 0
    Points
    191
    Level
    2

    Re: MCP4261 need manually power off from time to time or not working well

    Quote Originally Posted by KlausST View Post
    Hi,

    Again just a confusing post...
    --> The MCP4261 has no reset pin...

    Klaus
    Thanks,
    I mean the pin12 (SHDN), can this pin used by a switch or it just can be set by code?



  10. #10
    Super Moderator
    Points: 73,905, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,991
    Helped
    3418 / 3418
    Points
    73,905
    Level
    66

    Re: MCP4261 need manually power off from time to time or not working well

    Hi,

    The source of the signal is not important, it just needs to be HIGH or LOW with valid voltage levels according darasheet.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  11. #11
    Member level 1
    Points: 191, Level: 2

    Join Date
    Feb 2019
    Posts
    35
    Helped
    0 / 0
    Points
    191
    Level
    2

    Re: MCP4261 need manually power off from time to time or not working well

    Quote Originally Posted by KlausST View Post
    Hi,

    The source of the signal is not important, it just needs to be HIGH or LOW with valid voltage levels according darasheet.

    Klaus

    Hardware or software. can this pin works as reset? say I switch it to 0, and then to Vcc ?



  12. #12
    Advanced Member level 4
    Points: 7,496, Level: 20

    Join Date
    Jan 2015
    Posts
    1,055
    Helped
    331 / 331
    Points
    7,496
    Level
    20

    Re: MCP4261 need manually power off from time to time or not working well

    If you are talking about the \SHDN\ pin then the data sheet (Section 5.4) clearly shows how the pin works and it is NOT a reset in that it does not change the wiper setting value.
    As to whether it needs to be a switch or driven by some external device, have a look at Section 8, and in particular Figures 8-1 and 8-2.
    There really is no substitute for reading the data sheet.
    What are you wanting to do that makes you ask if there is a 'reset' pin?
    Susan



  13. #13
    Member level 1
    Points: 191, Level: 2

    Join Date
    Feb 2019
    Posts
    35
    Helped
    0 / 0
    Points
    191
    Level
    2

    Re: MCP4261 need manually power off from time to time or not working well

    Quote Originally Posted by Aussie Susan View Post
    If you are talking about the \SHDN\ pin then the data sheet (Section 5.4) clearly shows how the pin works and it is NOT a reset in that it does not change the wiper setting value.
    As to whether it needs to be a switch or driven by some external device, have a look at Section 8, and in particular Figures 8-1 and 8-2.
    There really is no substitute for reading the data sheet.
    What are you wanting to do that makes you ask if there is a 'reset' pin?
    Susan

    Thanks.
    The reason I want to have a reset function is the MCP becomes hot some time and the re powered make it works.



  14. #14
    Super Moderator
    Points: 73,905, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,991
    Helped
    3418 / 3418
    Points
    73,905
    Level
    66

    Re: MCP4261 need manually power off from time to time or not working well

    Hi,

    My recommendation:
    Replace the cause, not the symptom.

    I think you have a good reason not to provide all the requested informations of post#2. You already know the reason, don't you?

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  15. #15
    Advanced Member level 4
    Points: 7,496, Level: 20

    Join Date
    Jan 2015
    Posts
    1,055
    Helped
    331 / 331
    Points
    7,496
    Level
    20

    Re: MCP4261 need manually power off from time to time or not working well

    Quote Originally Posted by laoadam View Post
    The reason I want to have a reset function is the MCP becomes hot some time and the re powered make it works.
    Then you need top look for the root cause of the overheating.
    Look for things such as drawing too much power from an output pin, or the supply voltage going high, or a damaged MCU. (This is certainly NOT an exhaustive list!)
    Susan



--[[ ]]--