07-07-2009 08:46 PM
I'm trying to create a module using the I2C Digital Waveform Reference Library: http://zone.ni.com/devzone/cda/epd/p/id/6080
The trouble I'm running into is programming the timing into the Init VI. The timings I define in the input cluster from a particular IC's datasheet don't seem to hold; the coerced timings cluster shows all 0 for each timing value. Has anyone gotten this to work?
07-08-2009 06:15 PM
Hey Jeanius,
what timing parameters do you provide to the Init VI ? What timing constraints are you trying to make? Are you using a 655x device?
Also, I encourage you to post your question on this forum specifically created for questions about the IDW library. It seems like there has already been some discussion about timing in that thread. Don't forget to include the answers to the above questions when you post. Good luck!
07-08-2009 06:30 PM
07-09-2009 01:28 PM
Jeanius,
Again, please post your question in the thread created for IDW issues mentioned above - that is your best bet on getting the quickest and most comprehensive answer.
07-20-2009 09:59 AM - edited 07-20-2009 10:01 AM
Hi Jeanius -
1: You're right about the 6224: it can't tri-state its buffers in a single period of the sample clock, so it can't be used with the IDW in its native form. Changing the 'Z' states to '1' in the IDW waveform will make the waveform compatible with DAQmx devices, but remember that I2C is an open-drain bus and isn't designed for active-drive outputs. If you attempt to receive data from your slave device, you won't be able to see the message returned by the slave because your 6224 will be driving a '1' onto the bus instead of a Z. Likewise, you won't be able to address multiple slaves or listen for ACK/NACK conditions returned by the slaves. You'll essentially be "blind" as the bus master.
2: Replacing the 'Z' bits in the IDW waveform after it's been generated is a slow and inefficient process. It's better to directly modify your copy of the IDW library instead, so it creates waveforms with '1" as the high state. Given the caveat I mentioned above, here's how to do it: Open each of the following VIs on your IDW palette and replace every instance of the constant 'Z' that you see with a '1'. (You can just click on the Digital Values Ring constant and select 1 from the menu.)
- Add Start Condition.vi
- Add Addr Byte.vi
- Add Clocked Bit.vi
- Add Stop Condition.vi
- Interpret Data.vi
Here's an example from Interpret Data.vi:
I should also mention that I would have responded sooner to your question, but I don't actively monitor posts on this topic outside the IDW, SDW, and JDW forums. If you have any more questions about using the IDW, post in the forum that Misha linked above and I'll get a notification of your post. This guarantees you a timely reponse from me or someone else who knows the topic.