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: 
6,820 Views
Registered: ‎11-14-2011

Is it possible to implement industrial interface protocol, Ex IIC or SPI ?

Dear all,

              We're trying to implement IIC interface with HLS but I really have any ideal to start coding.

              We hope to model my design completely in c/c++ language.

             The design maybe include algorithm, bus interface, and control logic.

              Is it possible ? Where can I find more detailed reference documentations or example?

              Any suggestions are welcome !!!

0 Kudos
3 Replies
Historian
Historian
6,814 Views
Registered: ‎02-25-2008

Re: Is it possible to implement industrial interface protocol, Ex IIC or SPI ?


@raytheon.xilinx wrote:

Dear all,

              We're trying to implement IIC interface with HLS but I really have any ideal to start coding.

              We hope to model my design completely in c/c++ language.

             The design maybe include algorithm, bus interface, and control logic.

              Is it possible ? Where can I find more detailed reference documentations or example?

              Any suggestions are welcome !!!


I2C in C++? GAHHHHHH.

 

Give me a break. An I2C interface is easily implemented using a couple of shift registers and open-drain I/O, and a simple state machine to keep track of the transaction phase (address, data, ACK/NAK). This is a design task for a university sophomore who is studying electronics engineering.

 

If our tax dollars are being wasted having engineers use the wrong tools to do something that is normally very simple, then maybe we should reconsider our defense budget.

----------------------------Yes, I do this for a living.
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
6,794 Views
Registered: ‎03-24-2008

Re: Is it possible to implement industrial interface protocol, Ex IIC or SPI ?

 

Of course you can also just look in the IP catalog and instantiate our logicore IIC interface or the SPI 4.2 IP and avoid reinventing the wheel.  The Zynq devices even have a hardened I2C IP interface.

 

If you don't want or need the overhead of AXI interfaces (you are interfacing to a microcontroller aren't you?) then as bassman59 points out - the IIC interface is fairly trivial to implement in Verilog, VHDL, or C.  It's only 2 signals with a very simple state machine, and descirptions of masters and slave protocols are readily available on the web at Philips website.

 

A quick google yields a C implementation here:

 

http://www.robot-electronics.co.uk/acatalog/I2C_Tutorial.html

 

 

Greg Daughtry
Vivado Product Marketing Director, Xilinx, Inc.
0 Kudos
6,790 Views
Registered: ‎11-14-2011

Re: Is it possible to implement industrial interface protocol, Ex IIC or SPI in HLS?

Dear All Sirs,

                Thanks for your response first!!

                 I'm sorry  that my Engligh is poor to confuse you and I apologizes for my carelessness at the same time.

                 My mean is that if we want to design a alogrithm with an industrial interface in HLS.

                 Is there any reference material descripting how to mode an interface in HLS?

                 I know modeling in RTL for interfaces is more easy and makes sense !!

                 But I thought it's also possible to modeling interfaces in HLS and want to know how to do it?

 

 

0 Kudos