• 0
Sign in to follow this  
kdumont

I2C Python Interface

Question

I'm writing an I2C interface in python in order to get a real-time stream from a peripheral device and do some additional processing. 

I have been able to get everything set up such that my peripheral ACKs my request. However, I'm curious for what your strategy is for handling the next packet depending on ACK/NACK.

Originally I was just using a digital read at the start of the transmit (Start + Address) and processing the response to detect ACK, then setting up the device for the next transmit (data). However, the USB back/forth is way too slow, so I'm assuming you set everything up in advance in Waveforms I2C to trigger on an ACK.

I tried a few methods of setting the output to trigger from I/O states, but I haven't been able to get it to work quite right (is there a way to force a trigger?).

Can you briefly explain the general flow for how you set the AD2 up to handle I2C as master in Waveforms?

 

Thanks,

Kyle

 

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 1

Hi @kdumont

I have added UART, SPI, I2C master and UART receiver functions to the WF SDK, similar to WF application Protocol tool.
I hope to have time in the coming days to finalize the documentation and build a beta release with this.

Share this post


Link to post
Share on other sites
  • 0
On 4/4/2018 at 12:46 PM, attila said:

Hi @kdumont

I have added UART, SPI, I2C master and UART receiver functions to the WF SDK, similar to WF application Protocol tool.
I hope to have time in the coming days to finalize the documentation and build a beta release with this.

Couple bugs:

 - The documentation says "DwfDigitalI2cWriteRead," but should be "FDwfDigitalI2cWriteRead"

 - The examples use "FDwfDigitalI2cFrequencySet" and "FDwfDigitalI2cTransfer" but should be "FDwfDigitalI2cRateSet" and "FDwfDigitalI2cWriteRead"

Other than that it works magically so far.

Share this post


Link to post
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
Sign in to follow this