UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
9,942 Views
Registered: ‎04-24-2009

I2C / xps_IIC does not sending data

Jump to solution

Hi ,

 

I am trying to send data to an image sensor registers through the I2C  core in the EDK. The problem is I can not send any thing and I got zero sent byte. I am using the following alogrithm

 

1. put the address of the internal register and the data into one array

2. send the array using XIic_Send function

3. check the return value of the function till the number of sent bytes is equal the size of the register address and the data byte size.

 

In C :

 

Do {

 

sendbytecount = XIic_Send(IIC_Base_ADDRESS, CMOS_ADDRESS, writebuffer, sizeof(address)+data_size, XIIC_Stop)

 

} while ( sendbytecount ! = sizeof(address)+data_size);

 

Please could you help me.

 

 

0 Kudos
1 Solution

Accepted Solutions
Adventurer
Adventurer
11,777 Views
Registered: ‎04-24-2009

Re: I2C / xps_IIC does not sending data

Jump to solution

Hi all , 

 

I have solved the problem of the I2C bus using I2C scope analyzer. I discovered that the FPGA shifts the slave address one position to the left, So I had to change the slave address a little bit to ensure that the right address is sent to the slave device. for example 0x90 is changed to 0xC8.

 

Thanks for all who tried to help me .

 

 

0 Kudos
10 Replies
Scholar drjohnsmith
Scholar
9,935 Views
Registered: ‎07-09-2009

Re: I2C / xps_IIC does not sending data

Jump to solution

Hi

 

first rule of debugging, devide and conqure.

 

 So are you in hardware or simulation ?

  have you looked with a scope to see what actual voltages are moving on the I2C lines ?

 

 

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
Adventurer
Adventurer
9,931 Views
Registered: ‎04-24-2009

Re: I2C / xps_IIC does not sending data

Jump to solution

hi , 

 

thank you for your reply. 

I used a scope to check the I2C pins. I can only use the I2C to send one byte successfully. When I try to send an array of bytes , the voltage in the I2C pins does not change(stays in high state without changes). I checked that also using the the software by printing the number of bytes that has been sent and I found that it works only when I put one byte. I use XIic_Send function.

 

 

PLease do you have some examples or app note ? That may help me . 

 

Thanks  

0 Kudos
Scholar drjohnsmith
Scholar
9,923 Views
Registered: ‎07-09-2009

Re: I2C / xps_IIC does not sending data

Jump to solution

Hi

 

have you seen this Xapp  ?

 

http://www.xilinx.com/support/documentation/ip_documentation/xps_iic.pdf

 

pages in the area of P27 show you the pseudo code you need.

 

 

 

 One other thing,

 

are you getting the ACK condition on the I2C ?

 

I guess if the controler does not get the ACK, it's not going to get past the first byte.

 

Message Edited by drjohnsmith on 24-08-2009 09:03 PM
<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
Xilinx Employee
Xilinx Employee
9,896 Views
Registered: ‎08-07-2007

Re: I2C / xps_IIC does not sending data

Jump to solution

Hi

 

If you are using IIC high level driver, please make sure that the IIC interrupt has been connected to INTC.

 

-XF

0 Kudos
Explorer
Explorer
9,882 Views
Registered: ‎08-29-2008

Re: I2C / xps_IIC does not sending data

Jump to solution

Hi,

 

the XIic_Send method cancels when the address write transfer has not been  aknowledged.

Therefore you see exactly one byte on the i2c bus!

- Is the slave-id correct??

- Is the i2c frequency to high?

- Are the pullups connected??

- Is the voltage pegel (TTL/CMOS) suitable??

Cheers,

Kai

0 Kudos
Scholar drjohnsmith
Scholar
9,831 Views
Registered: ‎07-09-2009

Re: I2C / xps_IIC does not sending data

Jump to solution

Hi

 

did you find an answer to this 

 

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
Adventurer
Adventurer
11,778 Views
Registered: ‎04-24-2009

Re: I2C / xps_IIC does not sending data

Jump to solution

Hi all , 

 

I have solved the problem of the I2C bus using I2C scope analyzer. I discovered that the FPGA shifts the slave address one position to the left, So I had to change the slave address a little bit to ensure that the right address is sent to the slave device. for example 0x90 is changed to 0xC8.

 

Thanks for all who tried to help me .

 

 

0 Kudos
Contributor
Contributor
8,536 Views
Registered: ‎05-04-2010

Re: I2C / xps_IIC does not sending data

Jump to solution

Hello,

 

I am dealing with the same problem of writing via I^2c with the function 

XIic_Send. The result of this function is that no bytes were sended.

You mentioned connecting pullups, can you explain what could I do if I am using Nexys2-500  FPGA board?

 

thanks,

haz88

0 Kudos
Contributor
Contributor
8,535 Views
Registered: ‎05-04-2010

Re: I2C / xps_IIC does not send data

Jump to solution

Hello,

 

How can I check that?

 

thanks,

haz88

0 Kudos
Contributor
Contributor
2,712 Views
Registered: ‎05-04-2010

Re: I2C / xps_IIC does not sending data

Jump to solution

Hello,

 

I'm using Nexys2-500 board and a digilent's video decoder. I need to configure the registers in the board via I2C.

In my design, there is a XPS IIC Interface. I used the XIic_Send function and only the first byte of the slave address is transmitted but with no acknowledge while all of the other bytes that include subaddresses and data aren't. I am sure that the slave address is right and I also know via debbuging that the program gets stuck in the part that statusReg should get a value. What could cause this problem.

 

Looking forward for your reply,

haz88

 

P.s 

 The source file that I am using, is attached to this message( the while statement around the XIic_Send is for seeing the signals on the scope).

0 Kudos