+ Post New Thread
Results 1 to 12 of 12
  1. #1
    Junior Member level 3
    Points: 126, Level: 1

    Join Date
    Feb 2019
    Posts
    25
    Helped
    0 / 0
    Points
    126
    Level
    1

    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: 72,643, Level: 65
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,765
    Helped
    3370 / 3370
    Points
    72,643
    Level
    65

    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.



    •   AltAdvertisment

        
       

  3. #3
    Junior Member level 3
    Points: 126, Level: 1

    Join Date
    Feb 2019
    Posts
    25
    Helped
    0 / 0
    Points
    126
    Level
    1

    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:	6 
Size:	73.9 KB 
ID:	151951



  4. #4
    Super Moderator
    Points: 72,643, Level: 65
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,765
    Helped
    3370 / 3370
    Points
    72,643
    Level
    65

    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
    Junior Member level 3
    Points: 126, Level: 1

    Join Date
    Feb 2019
    Posts
    25
    Helped
    0 / 0
    Points
    126
    Level
    1

    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
    Junior Member level 3
    Points: 126, Level: 1

    Join Date
    Feb 2019
    Posts
    25
    Helped
    0 / 0
    Points
    126
    Level
    1

    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
    Junior Member level 3
    Points: 126, Level: 1

    Join Date
    Feb 2019
    Posts
    25
    Helped
    0 / 0
    Points
    126
    Level
    1

    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: 72,643, Level: 65
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,765
    Helped
    3370 / 3370
    Points
    72,643
    Level
    65

    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
    Junior Member level 3
    Points: 126, Level: 1

    Join Date
    Feb 2019
    Posts
    25
    Helped
    0 / 0
    Points
    126
    Level
    1

    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: 72,643, Level: 65
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,765
    Helped
    3370 / 3370
    Points
    72,643
    Level
    65

    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
    Junior Member level 3
    Points: 126, Level: 1

    Join Date
    Feb 2019
    Posts
    25
    Helped
    0 / 0
    Points
    126
    Level
    1

    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,384, Level: 20

    Join Date
    Jan 2015
    Posts
    1,037
    Helped
    326 / 326
    Points
    7,384
    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



--[[ ]]--