cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Anonymous
Not applicable
11,383 Views

How to access/call IIC functions in SDK

Jump to solution

I am trying to create a C program that would read and write via IIC interface to external devices. The IIC on the board would be always master. For that, I created a simple block design by adding the Zynq ip and AXI IIC ip, performed auto connection, created wrapper, went through the processes to generate the bitstream and exported the project to SDK:

Capture3.PNG

Now, I created a new project with Hello World template and would like to perform reads and writes on IIC using the board. Is there a project template on IIC usage? How do I initialize this interface? How to check if a IIC slave is connected to by board? Where's the IIC .h file that contains the description of availabe functions that I could call from main()?

Is there a tutorial that focuses on IIC inteface that includes SDK fotware development examples?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Teacher
Teacher
20,091 Views
Registered: ‎03-31-2012

Re: How to access/call IIC functions in SDK

Jump to solution
try files in this directory: /Xilinx/SDK/2015.4/data/embeddedsw/XilinxProcessorIPLib/drivers/iic_v3_1/

specifically there is an examples directory in there.
- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.

View solution in original post

8 Replies
Highlighted
Teacher
Teacher
20,092 Views
Registered: ‎03-31-2012

Re: How to access/call IIC functions in SDK

Jump to solution
try files in this directory: /Xilinx/SDK/2015.4/data/embeddedsw/XilinxProcessorIPLib/drivers/iic_v3_1/

specifically there is an examples directory in there.
- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.

View solution in original post

Highlighted
Anonymous
Not applicable
11,112 Views

Re: How to access/call IIC functions in SDK

Jump to solution
This is good, thanks.
0 Kudos
Highlighted
Explorer
Explorer
11,077 Views
Registered: ‎03-13-2014

Re: How to access/call IIC functions in SDK

Jump to solution

Just an idea, why don't you use the one of the hard functions in the PS to get a iic interface. You can route them through the PL to any pin.

0 Kudos
Highlighted
Participant
Participant
10,917 Views
Registered: ‎01-19-2016

Re: How to access/call IIC functions in SDK

Jump to solution

Hi all,

 

I have the exact same problem. I am using Zybo and I don't know how to write/read via IIC despite the inclusion of the AXI IIC IP in the PL. Also, although the examples provided, I still couldn't figure out to which physical pins does the IIC interface connects to. So, my questions are:

 

 - How to know if a slave is connected?

 - Where to connect (physically) the SCL and SDA wires of my slave?

 - How to read/write to such slave?

 

Many thanks in advance :)

0 Kudos
Highlighted
Teacher
Teacher
10,914 Views
Registered: ‎03-31-2012

Re: How to access/call IIC functions in SDK

Jump to solution

* the only way to know if a slave is attached is to create a transaction and see if it responds to a known to succeed read.

* which i2c ? ps or pl ? if ps, the ps7 block config should tell you which MIOs are used. If pl, look at the pin assignment xdc.

* I think this is already covered in detail.

 

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Highlighted
Anonymous
Not applicable
10,387 Views

Re: How to access/call IIC functions in SDK

Jump to solution
I did not know how to do it, so figured, it would be easier to start with the IICps, since it is already routed out of the chip.
0 Kudos
Highlighted
Anonymous
Not applicable
10,386 Views

Re: How to access/call IIC functions in SDK

Jump to solution

@horacioneto

If you want to add a AXI IIC IP to your PL, then I think you need to right-click on the outputs "make external" and implement the design. Then, you should be able to assign pins/pads, thus, making then physically routed on your board (see the board schematic). Then comes the software. You need to use SDK to configure your AXI IIC block and if you know the I2C protocol standard your first two questions are solved. When your create a project in SDK, the BSP is created and contains many examples including the IIC.

0 Kudos
Highlighted
Contributor
Contributor
1,071 Views
Registered: ‎07-03-2019

Re: How to access/call IIC functions in SDK

Jump to solution

Hi,will please share the dts file for iic ,i'm getting a error after booted up the zcu102 board

 

0 Kudos