Giter Club home page Giter Club logo

ad524x's People

Contributors

robtillaart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

felixoon menken47

ad524x's Issues

Unable to see results as expected.

Hi Everyone,
I'm looking for guidance to know what exactly the reason that my circuit is not working as expected.

  1. I have connected to AD5242 IC as per the datasheet guidance and integrated with ATTINY402 using I2C bus. As always pull-up registers and other connections are taken care.
  2. I currently have followed only RobTillaart AD524X library and its example codes. Initially I tested with "isConnected" example code and it responded true ('1') on serial monitor. Later I ever tested with logic outputs "O1 & O2" and they are working absolutely fine.
  • Now the problem is, Even after RDAC1 & RDAC2 registers are being updated with "200" value, there is no change in voltage drop at W1 & W2 with respect to B1 & B2 (Ground connected). I did some survey online and tried all possible way, but unable to find a solution to this. :(
  • Even I tried reading RDAC register back for validation, surprisingly register hold "200" in it. However, A1, W1 & B1 terminals are not at all changing.

PFA schematics and code for your reference.
GitHub_Circuit
GitHub_Code

I'm very happy if anyone over GitHub can help me to solve this problem.

Thanks in advance,
Vaibhav Sugandhi

AD5245 supported

Hi, in title implicitly states AD5245 is supported, but did not see it written - is this likely to work? AD5245 is one of the top 5 digital potentiometers supported by jlcpcb assembly service currently

I2C address in table

Hello! Is the data in the "I2C address" table correct? AD0 and AD1 do not need to be swapped? In the datasheet AD1 is the high bit of the address.

Constantly resetting to mid point

I'm attempting to use this library with a Teensy 4.0 and the potentiometer keeps reading the midpoint value. Simply put, I can't seem to get this to work. It seems to be a communication error but I've noticed the read commands don't actually read from the AD524X but simply return what you last set the value as.

Problem when not using default Wire channel

I have finally gotten to the bottom of why the library doesn't work on an Adafruit Feather RP2040! The problem is here:

uint8_t AD524X::send(const uint8_t cmd, const uint8_t value)
{
  Wire.beginTransmission(_address);
  Wire.write(cmd);
  Wire.write(value);
  return Wire.endTransmission();
}

This code uses the default Wire channel rather then the one specified during initialization. Changing the code to this, fixed the problem:

uint8_t AD524X::send(const uint8_t cmd, const uint8_t value)
{
  _wire->beginTransmission(_address);
  _wire->write(cmd);
  _wire->write(value);
  return _wire->endTransmission();
}

Although I am not using it, I believe this:

uint8_t AD524X::readBackRegister()
{
  Wire.beginTransmission(_address);
  Wire.endTransmission();
  Wire.requestFrom(_address, (uint8_t)1);
  return Wire.read();
}

should be changed to this:

uint8_t AD524X::readBackRegister()
{
  _wire->beginTransmission(_address);
  _wire->endTransmission();
  _wire->requestFrom(_address, (uint8_t)1);
  return _wire->read();
}

Thanks again for all the hard work in producing this library.

identity request

hi
is it possible in some way (ex. a read instruction) to know the type of IC (if 41 or 42) and its pots type (10k, 100k or 1M)?

Consider write(value) for the AD5241

just a wrapper would be OK if used in base class (or is this error prone ...?)

uint8_t AD524X::write(const uint8_t value)
{
  write(0, value);
};

or if only in AD5421 it might be optimized.

uint8_t AD5241::write(const uint8_t value)
{
  // apply the output lines
  uint8_t cmd = AD524X_RDAC0 | _O1 | _O2;
  _lastValue[0] = value;
  return send(cmd, value);
}

AD524X with Adafruit RP2040 Feather

Thanks for creating a great library!

I am trying to use the library on an Adafruit RP2040 Feather.
There are two I2C channels on this board. I initialize the library for the second channel (Wire1) as that is the one the AD5242 is connected to:

AD5242 AD01(0x2C, &Wire1);

The setup code indicates that the AD5242 is found. More specifically, this code:

      b = AD01.begin();
      Serial.println(b ? "Begin: true" : "Begin: false");
      Serial.println(AD01.isConnected());

produces this output:
Begin: true
1

However, when I try to write to the AD5242 there are errors:

      int a = AD01.write(0, 100);
      int b = AD01.write(1, 100 );
      char buff[256];
      sprintf(buff,"Write 1: %d\tWrite 2: %d\n", a, b);
      Serial.println(buff);

The output is:
Write 1: 4 Write 2: 4

From the Arduino documentation for Wire, I believe that a return value of 4 means "other error"

I know that the hardware works properly as everything works correctly when I used an ESP32 instead of the RP2040. My board is designed as a feather wing so that I can simply swap feather processors. (For the ESP32 I initialize with AD5242 AD01(0x2C); )

Any suggestions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.