I have a Lattice Machxo3 FPGA based design / board and currently I am configuring the FPGA using JTAG. As per the datasheet I2C also can used as the FPGA configuration interface. Is it possible to use the I2C as the primary interface to configure instead of JTAG? The datasheet mentions that I2C can be used for reconfiguration. I just want to confirm.
Also, is there any same code available wishbone interfacing to configure FPGA?
Best Answer
Yes it is possible to use I2C for configuration. Almost all of my project are using the I2C interface only because of the reduced required pin count. Drawback is that one has to be more careful to not brick a device because recovery can be impossible without the JTAG interface.
required steps:
Additionally I recommend to assign individual I2C addresses for every pinout / board vision. Else it can happen that one program a device which an bitstream which is not pin compatible. This is especially a thing if you route some of the connections over other pins (which I frequently do to avoid the way more expensive via-in-pad technology).
Using the I2C interface not only for configuration but actively as interface is a different beast imho. I have some code for purely receiving mode via the wishbone EBR interface that can be extended to support writing as well which I might add later if there is any interest.
P.S. a few additional information can be found here: http://buildingelectronics.blogspot.com/2017/09/machxo3lf-tips-tricks.html
P.P.S: avoid to connect any outputs to the system pins as this might hinder the programming of a blank device via I2C. E.g. do not drive the SN pin with an external circuit as this might enable the SPI interface blocking of the I2C interface.