Takemasa Tamanuki Posted July 5, 2019 Share Posted July 5, 2019 I am trying to make a AD2 SPI control program by VB. I have referred some comments on this site but I can not solve that. Could you provide some comment for this issue? (or If you can provide me any reference SPI VB-project-program, it is very helpful for me. I will try to custom it for my use.) Thanks, Link to comment Share on other sites More sharing options...
attila Posted July 5, 2019 Share Posted July 5, 2019 Hi @Takemasa Tamanuki I have moved your post to the proper forum. In the WaveForms SDK you can find a VB wrapper at: SDK/ samples/ vb/ dwf.vb You can also find several SPI Python examples like: SDK/ samples/ py/ Digital_Spi.py Link to comment Share on other sites More sharing options...
Takemasa Tamanuki Posted July 6, 2019 Author Share Posted July 6, 2019 Hi, Attila_san, Thank you very much for your comments. Finally, the “Digital_Spi.py” works in my setup with AD2 successfully. One more question, regarding the Clock-Frequency. My setup does not work more than 10MHz (it works at 10MHz, but not work at 11MHz and more) on the “Digital_Spi.py”. (My setup also does not work more than 10MHz on the waveform-application.) Can my setup work at 50Mz with AD2 by optimizing the clock-circuit of my setup? Link to comment Share on other sites More sharing options...
attila Posted July 9, 2019 Share Posted July 9, 2019 Hi @Takemasa Tamanuki The maximum frequency depends on the IC rating and circuit setup. The signals also have to pass through the AD2 DIO protection:https://reference.digilentinc.com/reference/instrumentation/analog-discovery-2/reference-manual#digital_io For instance the ID of PMod SF2 P2Q PCM Flash is read correctly even at 50MHz.https://reference.digilentinc.com/reference/pmod/pmodsf2/start Link to comment Share on other sites More sharing options...
Takemasa Tamanuki Posted July 10, 2019 Author Share Posted July 10, 2019 Thanks for your detail comments. Also, please let me know the setting parameter on the dwf.FDwfDigitalSpiModeSet(hdwf, c_int(0)) Is it related to the “Polarity” and/or “Phase”? “Polarity=0, Phase=1” are required specification of my DAC. (Setting with “0” on the ModeSet looks better than that of “1” for my DAC. Am I right?) Link to comment Share on other sites More sharing options...
attila Posted July 10, 2019 Share Posted July 10, 2019 Hi @Takemasa Tamanuki https://en.wikipedia.org/wiki/Serial_Peripheral_Interface#Clock_polarity_and_phase Link to comment Share on other sites More sharing options...
Takemasa Tamanuki Posted July 11, 2019 Author Share Posted July 11, 2019 Hi, Attila_san, Many thanks for your advice. > “Polarity=0, Phase=1” are required specification of my DAC. > (Setting with “0” on the ModeSet looks better than that of “1” for my DAC. Am I right?) In my DAC (“Polarity=0, Phase=1”) case, I understand the iMode setting should be “1”. (I will re-check the DAC-datasheet if “Polarity=0, Phase=1” is correct as well.) Link to comment Share on other sites More sharing options...
Question
Takemasa Tamanuki
I am trying to make a AD2 SPI control program by VB.
I have referred some comments on this site but I can not solve that.
Could you provide some comment for this issue?
(or If you can provide me any reference SPI VB-project-program, it is very helpful for me. I will try to custom it for my use.)
Thanks,
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.