519 Simon Says memory game

519 : Simon Says memory game

Design render

Simon Says Game

How it works

Simon says is a simple electronic memory game: the user has to repeat a growing sequence of colors. The sequence is displayed by lighting up the LEDs. Each color also has a corresponding tone.

In each turn, the game will play the sequence, and then wait for the user to repeat the sequence by pressing the buttons according to the color sequence. If the user repeated the sequence correctly, the game will play a "leveling-up" sound, add a new color at the end of the sequence, and move to the next turn.

The game continues until the user has made a mistake. Then a game over sound is played, and the game restarts.

Check out the online simulation at https://wokwi.com/projects/408757730664700929 (including wiring diagram).

Clock settings

The clk_sel input selects the clock source:

  • 0: external 50 KHz clock, provided through the clk input.
  • 1: internal clock, generated by the ring_osc module, at ~50 kHz (to be confirmed on TTGF26a silicon).

The internal clock is generated by a 13-stage ring oscillator (~101 MHz in GF180 SPICE at 3.3 V), divided by 2048 to land near 50 kHz, matching the external-clock path. The divide ratio will be confirmed against the post-layout PEX and silicon.

When using the internal clock, its signal is also output on the uo_out[7] pin for debugging purposes.

How to test

Use a Simon Says Pmod to test the game.

Provide a 50 KHz clock input, reset the game, and enjoy!

If you don't have the Pmod, you can still connect the hardware manually as follows:

  1. Connect the four push buttons to pins btn1, btn2, btn3, and btn4. Also connect each button to a pull down resistor.
  2. Connect the LEDs to pins led1, led2, led3, and led4, matching the colors of the buttons (so led1 and btn1 have the same color, etc.). Don't forget current-limiting resistors!
  3. Connect the speaker to the speaker pin (optional).
  4. Connect the seven segment display as follows: seg_a through sev_g to individual segments, dig1 to the common pin of the tens digit, dig2 to the common pin of the ones digit. Set seginv according to the type of 7 segment display you have: high for common anode, low for common cathode.
  5. Reset the game, and then press any button to start it. Enjoy!

External Hardware

Simon Says Pmod or four push buttons (with pull-down resistors), four LEDs, and optionally a speaker/buzzer and two digit 7-segment display.

IO

#InputOutputBidirectional
0btn1led1seg_a
1btn2led2seg_b
2btn3led3seg_c
3btn4led4seg_d
4seginvspeakerseg_e
5dig1seg_f
6dig2seg_g
7clk_selclk_internal

Chip location

Controller Mux Mux Mux Mux Mux Analog Mux Analog Mux Mux Mux Mux Analog Mux Mux Mux Analog Mux Mux Mux Mux tt_um_chip_rom (Chip ROM) tt_um_factory_test (Tiny Tapeout Factory Test) tt_um_tnt_gf_555 (tnt's recreation of a 555 on GF180mcu) tt_um_mcml_vco (MCML VCO) tt_um_tnt_gf_vco (Quadrature VCO) tt_um_oscillating_bones (Oscillating Bones) tt_um_MichaelBell_tinyQV (TinyQV Risc-V SoC) tt_um_essen (256x8 SRAM) tt_um_analog_factory_test (TT GF180mcuD Analog Factory Test) tt_um_cw_testbuffer (TT GF180mcuD Testbuffer) tt_um_fabulous_gf_0p3 (Tiny FABulous FPGA) tt_um_fabulous_gf_0p3_3v3 (Tiny FABulous FPGA (3.3V version)) tt_um_htfab_momcap (MoM capacitor) tt_um_gf_r2r_dac (GF R2R DAC) tt_um_AbAdA_2048 (Abad2048) tt_um_mattvenn_signal_generator (Simple Signal Generator) tt_um_74hct00 (74HCT00 Quad 2-Input NAND (3.3 V)) tt_um_algofoogle_gf_analog (algofoogle analog stuff) tt_um_LPCAS_TTGF0P3_TP1 (3.3V Folded Cascode OTA ) tt_um_kianV_rv32ima_uLinux_SoC (KianV uLinux SoC) tt_um_kiterai_current_dac (Analog 4 bit Current DAC) tt_um_urish_simon (Simon Says memory game) tt_um_waferspace_vga_screensaver (Wafer.space Logo VGA Screensaver) tt_um_urish_usb_cdc (USB CDC (Serial) Device) tt_um_a1k0n_nyancat (VGA Nyan Cat) tt_um_rahulbhagwat_gf180_bandgap_reference (GF BGR) tt_um_odgrip_polywave (PolyWave) tt_um_2048_vga_game (2048 sliding tile puzzle game (VGA)) tt_um_combined (Philippine flag waving) tt_um_gojimmypi_ttgfa_UART_FSM_TRNG_Lab (Hardware Entropy Explorer: UART/SPI TRNG and PUF) tt_um_gojimmypi_ttgfa_UART_FSM_TRNG_Lab_analog (Hardware Entropy Explorer: UART/SPI TRNG and PUF (Analog)) tt_um_coldbrew (Until heat death do us part) Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available