Jump to content
  • 0

I2C Python Interface


kdumont

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

 

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

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.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...