LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PXI 6534 is reding logic 0 as logic high on connected with I2C E2PROM

Hi,

 

I connected two lines of PXI 6534 as SDA and SCL lines of I2C E2PROM.When i try reading SDA line for acknowledgement after writing a byte,6534 is reading that as one where oscilloscope is showing low in its screen.I have attached the the connection below.Please eaplain why is it so.Is it anything to do with tri-state nature of IO?

0 Kudos
Message 1 of 8
(3,545 Views)

Hi JeyZ,

Is the last bit of the data byte is logic-1? If yes, then maybe you are reading back the last bit you actually wrote on the line.

 

To read the ack bit you need to configure your SDA line as input and you have to apply a clock pulse on SCL.

Then the EEPROM will be able to drive the SDA line to send the ack bit.

 

To try if this is the case, change your data byte (without changing other parts of the code) such that the last bit written is a logic-0.

If you read a logic-0 in this case my argument may be valid.

 

You can always switch to basics and connect simple SPDT switches instead of your PXI device to make sure the rest of the circuit is OK.

Connect the common terminal of the switch to the SDA or SCL line. Connect one of the others to ground and leave the other one open.

 

Just toggle the switches manually to simulate SDA and SCL lines according to the bit stream.

In this case, to get the ack bit you have to leave the SDA switch at open position and then toggle the SCL switch once.

 

This may also give you an idea about what you might be doing wrong in the code.

Hope this helps.

Message Edited by ebalci on 10-21-2008 03:22 PM
S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 8
(3,525 Views)

Hi ebalci,

 

Thanks for your response.The last bit transmitted is zero only before the acknowledgement.Still the read of SDA take the ack as one insted of zero.

 

As per the Switch i collected two SPDT switches one each for SDA and SCL.The switch is connected as Com connected to SDA or SCL and one of the ends is

 

connected  to ground and the other left open. Suppose for testing acknowledgement ,i just have to set Start condition followed by awrite of  bit pattern of 10100000

 

from the PC to the E2PROM.How to simulate these conditions  by using these 2 switches alone .Is it like continuously ON and OFF SDA switch simultaneously with

 

SCL switch. In that case how to measure Ack in  SDA as itmay need LED to be connected right. And how Logic 1 is generated from these switched as there s no

 

supply is attached.

 

Right now the clock rate of the SCL through PXI is just 1kHz.Does I2C operate in this freq?

 

With regards,

JeyZ

 

 

0 Kudos
Message 3 of 8
(3,500 Views)

Hello JeyZ,

 

There is nothing different between using a DIO module like your PXI device and manual switches.

Your EEPROM probably has a timing diagram in its datasheet for I2C communication. You just apply this timing by toggling the switches as necessary.

To apply logic-0 to the line just connect Com to ground using the switch, to apply logic-1 leave Com unconnected through the open terminal of the switch.

 

I did not mention a power supply because in the drawing you attached in your first post I saw 2 pull-up resistors on SDA and SCL lines.

They will drive the SDA and SCL lines to logic-1 when the corresponding switch does not apply a ground.

 

To read the ACK bit, just leave the SDA line open and toggle the SCL (up and down). The EEPROM will drive the SDA line and you can see the ACK bit simply using a DMM or scope (or an LED if you want, remember that the LED will turn off if you get the ACK).

 

I believe there is no lower limit for data or clock frequency, but the upper limit is 100 kHz for standard mode and  400 kHz for fast mode (see http://www.i2c-bus.org/fileadmin/ftp/i2c_bus_specification_1995.pdf).

 

Beware that SCL is not a free-running clock. You apply a single clock pulse after a data bit. Then the clock will stay at low until you apply the next data bit. You will operate the switches one-by-one. Do not toggle them at the same time.

 

Remember to change the data bit only when SCL is low and apply a high SCL pulse after you adjusted the SDA switch to the next data bit.

 

S. Eren BALCI
IMESTEK
0 Kudos
Message 4 of 8
(3,497 Views)

Hi Ebalci,

 

I connected the switchs as you mentioned and genrated the command byte after the Start condition.But still the E2PROM is not driving the pin Low for the acknowledgement.

 

The speed of transferring is only 1kHz(from the  PXI card) .Is the speed of transferring the  bits matter ?.

 

With regards,

JeyZ

0 Kudos
Message 5 of 8
(3,440 Views)

Hello JayZ,

 

I'm sorry to hear that you could not make it work.

 

The speed matters only if it is higher than 100kHz, as mentioned in my previous post.

Since this cannot be the case when you use the manual method, I think you should not be concerned about the speed right now.

 

You'd better focus on "doing it right". Can you send me the model of the chip or simply attach the datasheet?

Are you sure you are sending a correct command byte?

 

It is a simple protocol but it is also very easy to get confused and to flip a wrong switch.

Such a mistake ruins everything and you have to start from the beginning.

So you really have to be sure that you are doing it right. Just focus and think twice before making a move.

 

Other than that, I cannot comment more on this unless I do it myself in your environment.

I hope you can make it work.

S. Eren BALCI
IMESTEK
0 Kudos
Message 6 of 8
(3,436 Views)

Hi E BALCI,

 

I have  attached the waveforms of the SDA and SCL with this post for a single Byte Write .Could you just go through it and let know anything wrong with this waveform.

 

With regards,

JeyZ

0 Kudos
Message 7 of 8
(3,378 Views)

Hi JeyZ,

 

You have not mentioned about your E2PROM yet. Which model is it?

Couldn't you have any positive results using the switches?

Have you considered changing the chip, in case you might be working on a faulty one? 

You are not connecting both PXI board outputs and the swithces at the same time, right?

 

I'll try to have a detailed look, but there is something that looked weired. In the WriteData-0xaa.bmp snaphot first clock is applied when the signal level is not 5V yet.

I'm talking about the first rising edge on the blue signal.

Can't you avoid that? You can delay the clock (white) pulse a little so it is toggled when the SDA is settled to 5V.

S. Eren BALCI
IMESTEK
0 Kudos
Message 8 of 8
(3,375 Views)