Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C interface using 6552

Hi,

Has anyone implemented an SMBUS / SPI or I2C interface using a PXI-6552 ?.  Just wondering before I reinvent the wheel 🙂

Thanks,
 
                                                  MARK
0 Kudos
Message 1 of 22
(7,306 Views)

Hi Mark,

Unfortunately, there are no examples on I2C for HSDIO-6552.

Good information on 6552 can be found from this knowledge base :
http://zone.ni.com/devzone/conceptd.nsf/webmain/15de80989fd122188625704d007885ea

Also, if you are doing I2C communication below 250kHz, you can use NI USB-8451 to quickly develop your application. Here is the link to the NI USB-8451

http://sine.ni.com/nips/cds/view/p/lang/en/nid/202368

Hope this helps.

Thanks,

Kalyan

Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
0 Kudos
Message 2 of 22
(7,286 Views)
Hi Mark,
 
Just clarification for previous post, I2C is do-able using 6552 but there are no examples at present to offer.
However, attached with this post is a sample LV code you can use to get started with I2C Communications. This sample demonstrates writing to an HWS File. You can use the same sample and write onto digital lines using HSDIO Functions.
 
Hope this helps. Let me know if you have further questions.
 
Thanks,
Kalyan
Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
0 Kudos
Message 3 of 22
(7,273 Views)
Thanks Kalyan.  I'm surprised someone hasn't implemented such a thing before.  I went and wrote a protocol anyway.   I need full control of the I2C / SMBus vectoring as I'll be using it to evaluate the I2C interface itself.  This would discount your dedicated USB solution.

I'll check out your software in a few days (I'm still awaiting my IT dept to upgrade from 8.0 -> 8.20 so cant access your VIs yet)

One question I have on this, I'm trying to write using two 6552 channels and readback the same SDA signal on another channel. 
The problem I'm having is initiating the acquisition. I'm using a modifed version of the example VI  ""Dynamic Generation and Acquisition-Demo.vi"".  And have selected the "Pattern Start Match Trigger" to start the acquisition when an I2C start condition occurs.

 Ideally I'd like the acquisition to be data independant and I'd rather not use the trigger inputs as this just adds cabelling. Is there a way to start the acquisition with the generation internally to the PXI ?.


0 Kudos
Message 4 of 22
(7,268 Views)
Hi Haket,
 
I am sorry I didn't knew that you were currently using LV 8.0. Attached is the example in version 8.0.
 
Thanks,
Kalyan
 
Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
0 Kudos
Message 5 of 22
(7,247 Views)
Thanks, got that.   Its the h/w generation thats the tricky part, as I want to be able to read back the SDA line as I generate it (for I2C read operations) at 400kHz.

Currently I'm using three channels, two to generate the I2C signals and a third to acquire the SDA line at the DUT side. 
0 Kudos
Message 6 of 22
(7,202 Views)
Hi Haket,

You can trigger the acquisition off of the generation session by routing the Data Active Event from your generation session as a start trigger to your acquisition session.  Please refer to the example Dynamic Generation and Acquisition - Source Synchronous.vi for an idea on how to accomplish this.

Using the generation session's niHSDIO Export Signal.vi, select the Data Active Event as the signal and an unused PFI line as the output terminal.  Then modify the acquisition session's niHSDIO Configure Trigger.vi for a digital edge trigger off of the same PFI line.  As already set up in the example, the acquisition would be initiated first, followed by the generation.

Regards,

Andrew W
National Instruments
0 Kudos
Message 7 of 22
(7,168 Views)
Hi Andrew,

Thats exactly what I want, no external conections required.  I tried to play with that examply like you detailed, but I didnt get it to work.   I modified the bundled example see "lv2.jpg"   into "lv3.jpg"  but was unsure about the generation session as there are two niHSDIO Export Signal.vi instances there.




Download All
0 Kudos
Message 8 of 22
(7,160 Views)
Hi Haket,

I apologize for not being more clear in my first post.  The first niHSDIO Export Signal.vi instance in the generation session exports the sample clock to strobe, and the acquisition uses strobe for its sample clock.  The second instance exports the Data Active Event to PFI1 and then the acquisition session triggers off of PFI2 (with an external connection of these 2 PFI lines).  In MAX, both the Data Active Event and the acquisition start trigger have a direct route to PFI1, so you should be able to set both to PFI1 and just let the signal route internally.  I tested this and received no errors in LabVIEW for this configuration.

Regards,

Andrew W
National Instruments
0 Kudos
Message 9 of 22
(7,137 Views)
Hi Haket,

I did some more research on my previous post, and there is actually a recent post on our discussion forum that gives more detailed information.  While routing the PFI pins internally is allowed, there are some delay conflicts created by doing this.  This is something I was not fully aware of, and I wanted to let you know.  Please refer to the discussion forum post here for more information about this.  The post from Jesse O on 11/06/2006 addresses this question in more detail.

Regards,
Andrew W
National Instruments
0 Kudos
Message 10 of 22
(7,106 Views)