Any library for MAX541 16 bit DAC?

I would like to use the MAX541 16 bit DAC but I could not found a libray:

I found 2 files : MAX541.cpp

and the MAX541.h

but they have not an *.ino sketch sample . From the above files how is difficult to write a demo for the IC ?

The IC datasheet :

Hint: google "arduino max541 library" to find this one.

1 Like

Try reading the *.cpp link you supplied.

You missed a complete example.

The comments in the source files include a demo program showing how to use what the *.cpp and *.h files provide for interface to the DAC.


The MAX541X seems be to different ICs. MAX 5417 , 5418 , 5419 are related to digital potentiometers ....

Ok. I will try.

Sry, I think the example is in the *.h file.


Thanks but it is not clear to me how could I construct the object
... begin() and so on...

Yes, I see that, I was trying to do something with it myself… :frowning:

In the absence of a library ready to go, you are back to the data sheet.

It looks like a fairly straight-ahead SPI part; the code you linked is not so long and should be a useable guide if not ready to go code.


Yes. the SPI protocol must be quite common and I believe it is already resolved in the cpp and h files. I'll only have the chip to test it tomorrow. I'll try something in the sketch calling some function to see if it works... Maybe tomorrow I'll ask something again. Anyway, thank you for your clues

The below was from a very basic SPI DAC device. It did not do any configuring of the chip (defaults were OK), which you might find in the code you linked above, and it assumes the default SPI settings, which you might also verify in that code as well. If the setting are different, you can fix that, see the Arduino SPI document page.

// from basic sketch.

#include <SPI.h>

const int slaveSelectPin = 10;

void setup() {
  pinMode(slaveSelectPin, OUTPUT);

unsigned int cUp;

void loop() {	

  delay(15);  // for now just to see it.

void dacWrite(unsigned int value) {

  digitalWrite(slaveSelectPin, LOW);

  digitalWrite(slaveSelectPin, HIGH);



This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.