chipKIT® Development Platform

Inspired by Arduino™

PmodDA2 fully controled

Created Thu, 17 Dec 2015 00:06:31 +0000 by FredCailloux


Thu, 17 Dec 2015 00:06:31 +0000

Since my purchase of this PmodDA2 and ChipKit pro MX7 I found that the module could not be easily addressed for both channels. So I got involved in solving this problem and ended up with this humble piece of code that seams to do the job pretty well. Anyone interested to make it better is welcome.

:idea: This routine is to manage the PmodDA2 dual parallel DAC121S101 DA converter for which there were no fully working examples available until now. The challenge is that both DAC121S101 share common SCLK and SYNC which render impossible to address each individual chip without repercussions on the other analog output. Hence, existing examples are inadequate for using the PmodDA2 to its full capacity. Only one channel usage is possible as such. This little routine, although simple, overcome this problem by rendering possible to address both channels and if one wish to use both channels simultaneously, care to update both channels at each WRITE sequence is then necessary, for each update to one channel will clear the other if not specifically rewritten. The actual routine generate a sawtooth wave on both channel A an B. At least, now, one can use the PmodDA2 at its full capacity on any Pmod compatible boards and beyond, I guess.



Mon, 28 Dec 2015 15:47:57 +0000

For those interested, I made a library with the code. It's been tested in an example sketch. See attached If anyone more experimented would look at it and guide me in this project in creation I would appreciate it. I am at my first working Library and still have a lot of questions. Like, why these lines are created when you create a Library within UECIDE ? What are they for ? #ifndef _CLASSERROR_H #define _CLASSERROR_H

#if (ARDUINO >= 100)

include <Arduino.h>


include <WProgram.h>