-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple chips in series not working. #5
Comments
It has been a couple of years since I messed with this library, I cannot remember if I ever actually tested putting several in series. So you set the chip_count parameter to 2 in the call to setup? Does it have the appropriate response when you call getChipCount and getChannelCount? Then you called setAnalogValue with the channel and value? |
Thankyou for your reply. I have tested the getChipCount and the getChannelCount, they are worrking correctly. |
Can you please post your code so I can take a look to see if I can figure it out? Thanks. |
`#include <AD57X4R.h> const size_t CHIP_SELECT_PIN = 10; const int LOOP_DELAY = 500; AD57X4R dac = AD57X4R(CHIP_SELECT_PIN); void setup() uint8_t Result = dac.getChipCount(); void loop() dac.beginSimultaneousUpdate(); delay(LOOP_DELAY); dac.beginSimultaneousUpdate(); Thanks James |
Ah yes, I remember now. I did not finish implementing the multi-chip code since I did not have a hardware setup to test it with. I could take a shot at fixing the code, but I do not have a way to test it at the moment. If I start an experimental branch in this repository, would you be able to download the repository and test code in that branch with your hardware setup? |
Hi Peter Thanks |
Ok I created a new branch named multichip and added an example named MultiChip. I have not yet fixed the library. You might want to verify that this example shows the same flawed output that you saw in your code, then I will work on the fix. |
Hi Peter I have noticed before that Out 4 of DAC 2 is not what you would expect. thanks |
Ok I made some initial code changes. It compiles, but it may or may not work properly. Give it a try when you have a chance and see what happens. Thanks! |
Hi Peter As an aside, is there an easy way to run 2 libraries ? Currently I'm just replacing the .cpp and .h files in the AD57X4R library.. |
Thanks. I will look over my code to see if I can find where I made mistakes. Just to double-check, you are using code in the multistep branch correct? What do you mean by run two libraries? You can clone the git repository directly into your Arduino library directory and then just switch back and forth between branches. You probably have to restart the IDE after switching to another branch. I also use symbolic links to change libraries within that directory, but I do not know if your operating system supports that. |
Hi Peter. Thanks |
I found at least one bug in my code and I think I fixed it. Can you please update your repository and try it again using the MultiChip.ino example in the multichip branch? Thanks! |
Hi Peter
I have hurt my ankle so will be out of action for a bit. Will test the new library as soon as I can.
Thanks
James
… On 2 Mar 2023, at 1:50 am, Peter Polidoro ***@***.***> wrote:
I found at least one bug in my code and I think I fixed it. Can you please update your repository and try it again using the MultiChip.ino example in the multichip branch? Thanks!
—
Reply to this email directly, view it on GitHub <#5 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/A6C3GQZLQKXYNCJOXARJV53WZ5OZ3ANCNFSM6AAAAAAVGDPOPY>.
You are receiving this because you authored the thread.
|
Oh no, I hope your ankle gets better. No worries about a delay, I will pick it up and keep working on it whenever you have a chance to test it out. |
Hi Peter Finally got back on to this. I tried the suggested alternative that still gave a different compilation error. I have tested the DAC's by using a simple direct SPI program. The hardware is working fine. Thanks c:\Users\jsmoc\Documents\Arduino\libraries\AD57X4R\src\AD57X4R.cpp: In member function 'void AD57X4R::writeMosiDatagramToChip(int, AD57X4R::Datagram)': |
Ok fixed, you can try it again. |
I went ahead and merged the changes into the main branch. Please let me know if you are still having problems. Thanks! |
Hello Peter My apologies for taking so long to get back to you. The last version of code you sent to me did not work at all. I have tried the version 5 and that does not work. I am currently using version 4.01 and that works fine with a single chip. The last board I made I used 2 chips but under different chip selects, hence I was able to use 4.01. I am unable to test the multi-chip setup at the moment but when time permits, I will set it backup. Thanks James On 5 Oct 2023, at 2:06, Peter Polidoro ***@***.***> wrote: I went ahead and merged the changes into the main branch. Please let me know if you are still having problems. Thanks! — Reply to this email directly, view it on GitHub , or unsubscribe . You are receiving this because you authored the thread. Message ID: ***@***.***>
|
I am going to need to rig up some hardware so I can debug the code. If you can look at the signals with an oscilloscope and give me some ideas about what might be going wrong then I might be able to fix it, but it is hard for me to know what is happening without being able to test it myself. |
Another person found some bugs in my code. I still have not been able to test them on real hardware, but if you ever have a chance, please test it again and see if it works now. Thanks! |
Hi. I have used the library successfully on one chip, but when I put 2 in series, they both output the same data.
I am using the supplied example programs.
Any thoughts? Thanks
James
The text was updated successfully, but these errors were encountered: