This is an example of the using the https://github.com/toivoh/pio-ram-emulator RAM emulator for Tiny Tapeout. The RAM is used to store a frame buffer, 320x480 at 2 bits/pixel. The frame buffer is continuously read to output a 640x480 @60 Hz VGA signal. At the same time, the logic computes a Julia fractal, writing 16 bits to the frame buffer for every 8 pixels computed. After about a second, the whole frame buffer is filled in.
For more info about the RAM emulator, see https://github.com/toivoh/pio-ram-emulator/blob/main/docs/pio-ram-emulator.md.
The project contains some helper code for working with with the RAM emulator:
pio_ram_emulator.v
and pio_ram_emulator.vh
(sb_io.v
is also need) contain the modules pio_ram_emu_transmitter
and pio_ram_emu_receiver
julia_top.v
for an example of how to use these modulestest/pio_ram_emulator_model.v
contains a simulation model of the RAM emulator
test/tb.v
for an example of how to use the simulation model in a testverilator/vtop.v
for an example of how to use the simulation model in a verilator setupERROR_RESPONSE
parameter)Plug in a TinyVGA VGA Pmod to the output Pmod. The https://github.com/toivoh/pio-ram-emulator RAM emulator must be running on the RP2040. TODO: Instructions for how to set up. Start the project.
The appearance of the Julia fractal is controlled by the C
parameter, which can be seen as a complex value or 2d vector.
The C
paramter can be changed using the ui_in
port:
button_up
/ button_down
/ button_left
/ button_right
move the C
value.button_incstep
doubles the step length.button_decstep
halves the step length.A new ui_in[5:0]
value must be stable for 2^19
cycles, or approximately 10 ms (at a 50.4 MHz clock rate), before it is accepted.
The use_both_button_dirs
input changes how the input is interpreted:
use_both_button_dirs = 0
, an input is triggered when one of the button_
signals goes from high to low (and is stable for 10 ms). Recommended if the inputs are connected to buttons.use_both_button_dirs = 1
, an input is triggered when one of the button_
signals goes from high to low or low to high (and is stable for 10 ms). Recommended if the inputs are connected to toggle switches.This project needs a TinyVGA VGA Pmod.
# | Input | Output | Bidirectional |
---|---|---|---|
0 | button_up | R1 | |
1 | button_down | G1 | |
2 | button_right | B1 | |
3 | button_left | vsync | |
4 | button_incstep | R0 | tx_out[0] |
5 | button_decstep | G0 | tx_out[1] |
6 | B0 | rx_in[0] | |
7 | use_both_button_dirs | hsync | rx_in[1] |