PmodDA2 fully controled

Show off your projects to others!
Post Reply
FredCailloux
Posts: 69
Joined: Sat Mar 28, 2015 4:45 am
Location: Quebec - Canada

PmodDA2 fully controled

Post by FredCailloux » Thu Dec 17, 2015 1:06 am

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.

Enjoy...
Attachments
Loop_Triangle.txt
(3.54 KiB) Downloaded 35 times
Prashant Tripathi :idea: Knowing is to the Self what knowledge is to the ego

FredCailloux
Posts: 69
Joined: Sat Mar 28, 2015 4:45 am
Location: Quebec - Canada

Re: PmodDA2 fully controled with Library

Post by FredCailloux » Mon Dec 28, 2015 4:47 pm

For those interested, I made a library with the code. It's been tested in an example sketch.
See attached PmodDA2.zip
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>
#else
# include <WProgram.h>
#endif
Attachments
PmodDA2.zip
(1.6 MiB) Downloaded 32 times
Prashant Tripathi :idea: Knowing is to the Self what knowledge is to the ego

Post Reply