Lattice FPGA
News
5-30-2024: Added some example projects.
Contact:
Send email to ted_rossin at yahoo
Basics
Where to buy ($54) and how to get set up with a free development environment:
SparkFun: Note that IceCube2 is still free for hobbyist and students
Alchitry.com: Tutorials and how to get IceCube2 from Lattice
These projects are simulated using the free Icarus Verilog simulator. Use either gtkwave or my waveform viewer (VcdView).
Common
Common.zip: Plls, FIFOs and UARTS ... : (5-29-2024)
PLLs: A variety of frequencies. These were made with the IceCube2 tool
UART: A send/receive UART to interface to the board through the USB cable. The design is double buffered (similar to popular microcontrollers).
Power On Reset: The board has no proper power on reset so this module will provide a reset signal to the design.
FIFO: A basic FIFO controller to use with the registered block RAM. It is not the fastest but does not use a second set of flip-flops on the output to reduce the area impact.
Projects
3D/2D Graphics Processing Unit (GPU)
Project: GpuProject.zip (5-08-2024) Includes source and test bench.
Raspberry Pi Pico code: TftSolid3d.zip (V1.0 5-29-2024 to 5-29-2024) also need Lib.zip
This project is teamed with a 320x240 TFT display, 4 128Kx8 RAMs and a Raspberry Pi Pico to create an OpenGL compatible 3D graphics system. The FPGA controls the LCD display and RAM to form a Z-buffered 3D system which can draw 3D depth tested triangles to form solid objects on the screen. The LCD controller in the FPGA is able to draw 2D vectors, rectangles as well as copy the frame buffer into the LCD display. The controller also clears the buffers for the next frame to be drawn. The Raspberry Pi Pico implements the OpenGL pipeline up to rasterizing triangles which is done by the FPGA. The Pico converts OpenGL function calls into triangles and applies 3D transforms, lighting calculations as well as clipping before sending the triangle vertex and color data to the FPGA to be drawn.
Triangle and span rendering uses fixed point math and the machine snaps the starting points by interpolating the pixel values based on words/equations from p. 20 of "Advance Animation and Rendering Techniques". This is what prevents flashing at triangle seams in animations.
Serial Port
Project: Serial.zip (10-06-2023) Includes source and test bench.
This project creates a UART running at 115200 baud and will echo bytes received to the 8 LEDs on the board. It uses the PLL module to reduce the on boards 100MHz clock down to 25MHz. Not real exciting but demonstrates some basics.