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!

Showing results for 
Search instead for 
Did you mean: 

Debug your FPGA design with nothing more than two I/O pins, I2C, and a digital scope

Xilinx Employee
Xilinx Employee
0 0 43.3K

Earlier today in a blog about DDR3 row hammer, I wrote about my friend Jack Ganssle who is an expert in embedded design. While writing this blog, I noticed that his Web site has a new 8-minute video about using two microcontroller I/O pins, some I2C bit banging, and a digital scope with a built-in protocol analyzer to debug a microcontroller-based design. As Jack says at the end of his video, you can use this technique for error handling, data logging, or messaging to give you better, real-time insight into what’s going on inside of your system.


Well, the same thing applies to debugging FPGAs. There are several ways to put an I2C controller in an FPGA, but first, here’s Jack’s rather cool video:





Now if you’re using a Xilinx Zynq SoC, you’re already in luck because there are all sorts of serial resources built into the Zynq PS (processor system) that you can use for debugging purposes—no bit banging required. However if you’re working with a Xilinx FPGA, you might need a little more help.


You could instantiate an I2C controller in the FPGA’s programmable logic and there are multiple I2C IP blocks available for use with FPGAs from sources including Xilinx. If you want to replicate the software-centric I2C approach in Jack’s video, then you can instantiate a Xilinx PicoBlaze 8-bit microcontroller in the FPGA and run code very similar to Jack’s demo.


You can instantiate PicoBlaze microcontrollers in 7 series FPGAs, in Virtex-6 FPGAs, and in Spartan-6 FPGAs. Details for doing this are available in the Xilinx PicoBlaze Lounge in the ZIP file containing the latest PicoBlaze processor IP release. Look in the Reference_Designs subdirectory and then in the I2C sub-subdirectory to find the file named KC705_KCPSM6_I2C_EEPROM_reference_design.pdf. This handy document gives you all the detail you need to use the Xilinx PicoBlaze microcontroller for software-driven I2C communications.


Tags (2)