- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello I need help with programming universal I2C interface. I need to do I2C commands for various operations . Such as address, write, read , and stop bit . Such operations have defined somewhere in the package and use only. Can I use procedure?
procedure I2C_address(address:in unsigned(6 downto 0); RW:in std_logic); procedure I2C_write(data_out:in unsigned(7 downto 0)); procedure I2C_read(data_in:out unsigned(7 downto 0)); procedure I2C_stop(); This procedures I need use my projects... Can I embed the process into a procedure ? Somewhere package with I2C ? ThanksLink Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
that question is mighty strange for a VHDL forum. I assume that you're either a beginner to VHDL, or accidentally put the question into the wrong forum. In case you're a beginner to VHDL, I recommend to start simple, learn VHDL (or Verilog). There are tons of resources if you ask Google (unfortunately I don't have a personal recommendation, as I had German tutorials back then, which I assume won't help you much). You'll see that VHDL is a hardware description language, where you less deal with procedures, but with hardware, i.e. registers, logic functions, etc. You can implement an I2C master in VHDL, but it'll look way different from what you see e.g. in a bit-banging I2C master written in C. You can find examples for I2C controllers e.g. here: http://opencores.org/projects (http://opencores.org/projects). Okay, unless you want to have the I2C controller only in a test bench (i.e. in simulation only), then you can actually write a VHDL procedure to do that. But you won't be able to put that on an FPGA or CPLD. Best regards, GooGooCluster
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page