2.1 KiB
a short retrospective on the project
why?
I intended to learn about how to use FPGAs, and figured that graphics would be an easy way to get feedback on my progress (I also just like computer graphics).
challenge
I used a pico-ice development board for this project. Since the iCE40UP5k (the FPGA) is not attached to the USB data pins, I needed to communicate between the microcontroller (a raspberry pi RP2040 chip) and the FPGA. For the amount of data to be transferred, even at 64MHz, SPI would be too slow. So, I had to design a custom protocol for communication between the two chips. Additionally, the were not enough pins for two one-way data buses. Thus, a bi-directional bus was needed.
how?
The RP2040 microcontroller has a cool feature called PIO, short for 'programmable input-output'. Essentially, it is a tiny state machine embedded in the microcontroller to manage the state of GPIO pins in order to avoid bit-banging, saving CPU time. I had to learn how to use this feature (and many others) of the RP2040. Raspberry Pi has good documentation available online. With this, I was able to create a bi-directional bus without the use of bit-banging in order to transfer frame data from the FPGA to the RP2040.
results
Overall, the project worked better than expected. The video displayed fine over USB Video Class, but the bi-directional data bus had synchronization issues, so I had to lower the clock speed of the FPGA so that the RP2040 could over-sample. Furthermore, the implementation of the mandelbrot fractal renderer could use some work: it doesn't use pipelining at all.
Here is a picture from the 'camera':
evaluation
Looking back on this project, I realize I should have invested more effort into designing a good interface between the two chips on the pico-ice board. One of the major pain points of this project was the improper synchronization over this bus. Overall, though, I learned a lot about SystemVerilog programming and microcontrollers.