JahwnMallard / Lab3-Font_Controller

ECE383 at the United States Air Force Academy, controls a font output to a vga monitor
0 stars 0 forks source link

Lab3- Font controller

C2C John Miller

VHDL Code to generate font via a VGA signal

This code also supports the use of the switches on the Atlys board for selecting specific ASCII characters.

The major problems that this project dealt with were:

Version

1.1 - Generates characters based on switch positions and button inputs

Previous Versions

Works in Progress

Implementation

This project did not rely as heavily on finite state machines as the previous lab, instead, it was more reliant on being able to connect prexisting modules together. There was a lot of timing to take into consideration, as some signals needed to be delayed in order to sync up the timing of the modules

The following basic constructs were used to realize the font controller:

Flip-flop (memory element):

    process(clk) is
    begin
        if(rising_edge(clk)) then
            col_next_2 <= col_next_1;
            end if;
    end process;

Mux (selector)

    process(sel, data) is
    begin

        if( sel = "000") then
            output <= data(7);
        elsif(sel = "001") then
            output <= data(6);
        elsif(sel = "010") then
            output <= data(5);
        elsif(sel <="011") then
            output <= data(4);
        elsif(sel <="100") then
            output <= data(3);
        elsif(sel <="101") then
            output <= data(2);
        elsif(sel <= "110") then
            output <= data(1);
        else
            output <= data(0);
        end if;

    end process;

The following modules were to implement the game

The modules are connected as shown below:

block diagram

Troubleshooting

The biggest troubles I had can be separated by module:

character_gen.vhd:

    row_col_multiply <= std_logic_vector(((unsigned(row(10 downto 4)) * 80) + unsigned(column(10 downto 3))));
    row_col_multiply_12 <= row_col_multiply(11 downto 0);

atlys_lab.vhd:

Confirming functionality

There was a bit of serendipity in this assignment, as the font that displayed was very close to correct without much debugging. It was very incremental in designing it, the general process was write, check syntax, check if it synthesizes.

There was some debouncing required at the start of testing b-functionality, which was alleviated by increasing the delay in the debounce code.

The hardest thing to test, and still is, is the NES functionality. I think I have a problem with a feedback loop, because my signal references itself. However, I had a considerable amount of classwork due for other classes, so I was not able to get the NES functionality.

Lessons Learned

TODO

Documentation

C2C Ryan Good helped me make the function