Documentation

Schematics


Breaking down this design from the top down, the system takes user input, processes it within the MCU, and then updates the FPGA with the brush’s current location and any updated color settings using SPI. The entire 128x128 grid used for drawing is stored on the FPGA within its RAM memory, and the SPI updates are used in order to read into the device and write out. Depending on if the brush is raised or lowered, the FPGA will follow different logic; when the brush moves, it will either leave the previous color behind, or it will update the color with the current color selected by the brush.

Figure 1: Simplified Block diagram of the system’s interconnects.

Prior to completing the entire design, we figured out what pins could be used on the MCU board to determine exactly how many colors and controls we could have. We started by figuring out which pins we would use for SPI, as the Development Board used in E155 hardwires them together. We found that with our current break-out board, and with the assumption that the colors would be set using interrupt controls, we could use seven pins off of the MCU. We further determined which three pins we could use for analog input, and assigned our final pin for brush up and brush down using the only remaining pin.

The FPGA board’s pins were routed based off of the number of pins necessary to control the VGA’s red, blue, and green channels, as well as whether the V-Sync and H-Sync of the VGA was on or off. For further details on how VGA works, see the FPGA Section or this website.

This design resulted in the following overall schematic for the board interconnects (Figure 2), although further details and decisions can be found in the MCU Section and the FPGA Section.

Figure 2: Detailed schematic diagram of hardware used within the project.

New Hardware


Micro P(ictionary) is built using the FPGA and MCU programming techniques and skills learned throughout Mudd’s E155 course, with several new hardware and software components.

Joystick

For the MCU, alongside the interrupts and SPI outputs from previous labs, new analog functionality was included in order to allow for joystick control and the use of a potentiometer for brush size. The joystick that we chose outputs an analog voltage for x and y on two different pins; depending on the incoming voltage, the joystick will output half the voltage in its middle state, 0 at its lowest, and the full applied voltage at its highest. In our design, we powered the joystick under its required supply voltage of 5 V at 3.3 V, meaning that when powered, the joystick would output about 1.7 V at medium power, 3.3 V at max (either positive X or Y), and 0 V for lowest power (either negative X or Y). Each analog input needs to be read into the MCU using the onboard ADCs and then filtered to give us usable data to determine the desired position for the brush. The same idea applied for the potentiometer.

VGA (Video Graphics Array)

The other significant new hardware component is the VGA monitor. This required lots of new components of the FPGA. First of all, the PLL was needed to generate the clock signal to produce the H-Sync and V-Sync signals for the monitor. This also required the use of a much larger RAM (an SPRAM in this case) to store the color data for each pixel. This RAM in particular was the source of many of our troubles throughout this project.

The VGA requires an analog input to all three pins used for color (i.e. R-G-B pins). This meant that in addition to the code that was constructed in Lattice Radiant, we needed to make a physical digital to analog (DAC) converter, with seven resistors used for each channel.

Additional Hardware Information

For more details on the hardware, see the MCU and FPGA pages. These include schematics and block diagrams.

The Github repository contains all of the source code for the project.

Relevant links for more information can be found in the Appendix.

This project has a relatively low barrier of entry from a hardware perspective. If you are working from a well stocked lab, the only parts that are not likely present are the joystick and a VGA breadboard adapter.

Bill of Materials

Item Part Number Quantity Unit Price
VGA Adapter VGA DB15 1 $7.39
Joystick KY-023 5 $6.49
VGA Monitor Any 1 Digital Lab
DIP Button SPST-NO 1 Stockroom
DIP Switch 782-3831-5-ND 1 Stockroom
10 kOhm Potentiometer Alpha B10k 1 Stockroom
DIP Switch 72N3906 1 Stockroom
Total Cost: $13.88

{.striped .hover tbl-colwidths=“[10,10,10,10]”}