Saturday, July 24, 2021

Analog Devices AD5761--EZ Embedded C library for Bipolar DAC--Works!!

 Hi again, follow up from the last post, where I was wasting hours trying to get an AD5721 12 bit Bipolar DAC to work. Fail!  Giving up on that, but I got the AD5761, a more expensive version with 16 bit resolution, to work just fine.  

Through an EE I know, he confirmed via AD tech support that the 5721 uses the same code as the 5761, except that the data register is a bit different, so that's not the problem.  Something on my bench?  Phases of the moon?  Sorry kids, we may never know.

So my solution about getting the AD5721 to work on my bench is simple: don't use it! The 16 bit version is about $3USB more per chip, and that will have to do.


They both don't work!


This one does! 

Looks OK on the scope....

I did learn an important thing about Analog Devices ICs--for some (many? most?) Analog Devices provides really thorough open  source example code, written in C.  

For the AD5761 for instance, go to its "product overview" page on the AD site (here) and scroll down.  

You see the "NO-OS driver", go here. Wow--There is a lot of  Pure-C here to peruse and if you are feeling lazy, just use that in your embedded C project and call up the methods Analog Devices provides. Cool.

For me, I am only going to use this DAC in a very specific application--bipolar DAC for +/- 10V P/P.  Otherwise I'd use a less expensive DAC! 

I need to send a 16 bit word in, in straight binary, and need that value converted to analog at the chip's output. If I end up using this for +/- 5V, 0-10V etc etc., I can write new functions, it's only a matter of changing the 24 bit control register that tells the chip what you want to do (which again is cool).

If you want to get my super easy embedded C micro library for this, the github content is here.  If you fork this dork, please comment below, let me see what you did, I am interested in seeing what others do to expand/improve/correct this code.

In the meantime, this all took way, way longer than it should have, and I am a bit burned out and frustrated. I guess we can't have fun all the time, right?  Coding means no fumes, but a lot of sitting around.....

Enough! See ya next time.

No comments:

Post a Comment

Anything to Clock Subcircuit

Readers:  If you want to build the project featured in today's post, please go to  PCBWAY's  Community pages --a gerber ready to dow...