Author Topic: MachXO2, verilog and I2C  (Read 3811 times)

0 Members and 1 Guest are viewing this topic.

Offline SpiderElectronicsTopic starter

  • Contributor
  • Posts: 32
MachXO2, verilog and I2C
« on: October 21, 2014, 11:49:43 am »
I'm just getting started with FPGAs and I'm using the MachXO2 Breakout board from Lattice.
(The same one that MikesElectricStuff used in his Nano LCD project).

The MachXO2 has embedded function blocks (EFBs) containing 'hardened' implementations of such things as I2C, SPI and Counters etc.
As far as I can see these are all accessed via the WISHBONE interface, and I found a few examples on Lattice's website - but all the examples use the Mico soft-processor to control the EFBs.

What I'm looking for is a basic example of using the I2C function block from Verilog without the Mico soft processor. I haven't been able to find much documentation or examples on how to do that.

Does anyone have any Verilog examples of accessing the I2C EFBs via wishbone?

 

Offline jboard146

  • Contributor
  • Posts: 38
  • Country: us
Re: MachXO2, verilog and I2C
« Reply #1 on: October 27, 2014, 09:45:34 pm »
This is where I got very frustrated with the MachXO2.

You can use the XO2 hardware to do the I2C/SPI/UART via the wishbone interface or use an "off the shelf" verilog code. I think most people just ignore the XO2 "Hardended" EFB implementation.

The WISHBONE is a standard of sorts. That allows standard communication between verilog code modules. From what little I understand you should be able to use the code wizard in Lattice create the interface. Then read/write out the wishbone interface. There is a lot of setup to get it working.

I did very little experimenting with this and a buspirate. I got the buspirate to see that there was a I2C device on the address i configured, but i never got further than that. Lots of head banging against the desk and I gave up. And did what i needed to do on an AVR uC.

I'm not an expert in FPGA/verilog much more of a noob in this area I may be completely wrong. It was a learning experience and a not very good one. I need to revisit the XO2 again.
 

Offline Spikee

  • Frequent Contributor
  • **
  • Posts: 568
  • Country: nl
Re: MachXO2, verilog and I2C
« Reply #2 on: October 27, 2014, 11:18:17 pm »
There is an example project and code somewhere ...
Freelance electronics design service, Small batch assembly, Firmware / WEB / APP development. In Shenzhen China
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf