Jump to content
  • 0

Please tell me about the SPI output setting method (SDK-API) for Analog Discovery 2.


roshy

Question

Using Analog Discovery 2, I'm trying to output SPI output (using SDK-API), 2 ports, separately. Port settings are also done individually. Then, for some reason, if you output to the 1st port, it will also be output to the 2nd port. At this time, 2 ports are not set. Is the SPI output setting process wrong? Can I ask for confirmation?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @roshy

Use the following when changing the DIOs: 
FDwfDigitalSpiClockSet(hdwf, 9) # clock on DIO-9
.... read/write
FDwfDigitalOutEnableSet(hdwf, 9, 0) # disable (float, high impedance) earlier clock output on DIO-9
FDwfDigitalSpiClockSet(hdwf, 1) # clock on DIO-1
... read/write
FDwfDigitalOutEnableSet(hdwf, 1, 0) # disable DIO-1
...

If you want to drive low or high, use the following instead of disable:
FDwfDigitalOutCounterInitSet(hdwf, 9, 0 or 1, 0)
FDwfDigitalOutCounterSet(hdwf, 9, 0, 0)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...