Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C read with HSDIO 6551

Hello,

I'm trying to implement a I2C communication with a consumer device .

I'm using labview 8.2.1 and PXI HSDIO card 6551 .

At this time I'm able to write correctly to my device but all the registers reading get FF results.

Attached is the vi I'm using to do so.

Does someone could tell me know what's wrong on my vi.

 

Thanks for you help.

 

Rgds

Philippe

0 Kudos
Message 1 of 6
(4,534 Views)
Did you have an open collector between the pins?
And what sofftware are you using?
Who suppies the read clock e.g.?
greetings from the Netherlands
0 Kudos
Message 2 of 6
(4,530 Views)

I just put  externall pull up on Scl and Sda lines.

I re -attached the vi files.let me knowx if you can see it

Which software? Labview 8.2.1 is not the one you're asking for?

 the read clock shoudl come from the PXI card since it's the master

 

Rgds

Philippe

0 Kudos
Message 3 of 6
(4,523 Views)

Hi

 

I suggest to make a sub vi that does the write and one that does the read and do this immediately after each other.

 

waiting too long does not work!

 

I still miss about 4 vi's at the end, I found the i2c lib.

 

greetings from the Netherlands
0 Kudos
Message 4 of 6
(4,491 Views)

Hi ,

 

thankd for your time looking at my code.

 

I don't understand why I need to do sub vi.

My intent is to make write or read only access to my device .

Those write and read access will happen many  times in my GUI and sometimes I will need only to do the read access to look at the device map register value.

 

There is no limitation on my device for read access only .

Could you tell me if my i2c signal structure (using i2c lib) for reading appears correct?

 

Thanks for your help

 

Rgds

Philippe

 

0 Kudos
Message 5 of 6
(4,473 Views)

I never used the lib before, I used several i2c devices from several interfaces.

Essential is that the clock is supplied and handshaking is waiting long enough before reading the data.

The timing is determined by the chip, clock stretching makes it difficult on a device.

So when reading is a problem, maybe you read too fast.

Check with an oscilloscope when the clock goes up again.

 

I suppose that you also have an open collector on the clock? 

greetings from the Netherlands
0 Kudos
Message 6 of 6
(4,468 Views)