Jump to content
  • 0

Analogshield and arduino due


jvandijk

Question

Hi,

I have changed the library analogshield.cpp for werking with the due. Everything looks alright. But one think, way the DAc has two chipselect pins syncpin an dacpin. Especially the Use of dacpin is a bit of surprise. It is Set low in initializing the example codes but never set high? What is the USB of this pin?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Hi jvandijk,

 

The dacpin (presuming you are looking at the ldacpin), is a pin that can be used to update all DAC registers simultaneously. However, the library that was written for the AnalogShield updates the DAC registers serially, so the LDAC pin needs to be connected to GND (or driven low in the case of this library).

 

This is from page 31 of the DAC datasheet from TI:

DAC8564 data updates are synchronized with the falling edge of the 24th SCLK cycle, which follows a falling edge of SYNC. For such synchronous updates, the LDAC pin is not required and it must be connected to GND permanently. The LDAC pin is used as a positive edge triggered timing signal for asynchronous DAC updates.

 

So, you would only need to operate this pin if you updating multiple DAC registers at the same time, but this was not done in the chipKIT libraries since the chipKIT Uno32 was plenty fast enough to make serial updates effective.

 

Let me know if you have any more questions.

 

Thanks,

JColvin

Link to comment
Share on other sites

jvandik,

 

I would love to see the modifications you made to the library for the Arduino DUE.  

 

Did you modify the library from my Github?

   here: https://github.com/mwingerson

 

I would be very thankful if you forked the library on my Github and submitted pull requests for the changes that you made.  

 

In my last update, I tried to create the functionality for the DUE but I do not have one on hand so I could not test it beyond seeing if it compiled.

 

As for the sync pin on the DAC, there was not a demand to change multiple DAC channels and have them update at the same time.  It would be a rather simple update if there was a demand though.   :D

 

Also I would enjoy any feedback that you might have for the AnalogShield library.
 

Cheers!

Link to comment
Share on other sites

Hallo, sorry for my english. I typed the text on an iPhone which was still in Dutch orientation, So a lot of strange corrections. Thank you for the awnsers. The changes I made to the library (.cpp) are quite simple. I have deleted all avr oriented code and kept the chipkit stuff. because I expected the Chipkit Uno 32 uses a processor comparable to the Sam Arm processor of the Due and they probably have the same SPI protocol. indeed they have, after the revision/ deletion everything works with the Arduino Due. The avr code in the else part of the if statements gave errors.

Link to comment
Share on other sites

Sorry to dig up a old thread.   Got things working (at least far enough to get the ramp example working) on a DUE.  

Don't know what version of the library jvandijk was starting from, but I started from the one @ https://www.digilentinc.com/Products/Detail.cfm?NavPath=2,648,1261&Prod=TI-ANALOG-SHIELD however this looks to be same as the master version on mwingerson github.

Was running into problems with SPI not being instantiated before analogshield needed it.   Also found and fixed a compile issue for the uno (I have both a DUE and an UNO) 

I signed up for a github account, forked the library from mwingerson, put my changes in and did a pull request.   Hope I did the github stuff correctly. First time I've contributed to an open source project.

Hope this helps!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...