Creating a NES Game Console with ESP32

This article is adapted from the Lichuang Open Source Hardware Platform.

Author: micespring

Original link: https://oshwhub.com/micespring/esp32-nesemu

▌Introduction

An open-source handheld game console based on ESP32 that can run standard NES (FC in Japan) games, supporting mono audio. Let you reminisce about your childhood anytime.

The firmware is based on the official Espressif and a secondary development project by moononournation, GitHub link:

https://github.com/moononournation/esp32-nesemu

▌Version Update

[V1.1-200807]

  • You can now select different games by pressing the directional keys during startup. Supports up to 5 built-in games. (Requires re-flashing firmware, download method for games is detailed in the “Download Games” section.)

Features

  • Low cost: All functions are achieved with just one ESP32-WROOM-32 module, no external Flash, SRAM, or DAC needed.
  • Easy to make: The passive components use 0805 packaging, making soldering easy. The 3D model of the case has considered the tolerance issues of low-end 3D printers, improving the success rate of case production.
  • Good compatibility: Most NES games have been tested to run perfectly.
  • Easy game downloads: Games can be downloaded without recompiling the source code, with built-in ESP32 automatic download circuit, no manual reset required during download.
  • Built-in battery: Includes a lithium battery charging circuit and low power indicator circuit.
  • Low power consumption: A 400mAh battery can last about 3 hours.
  • Multi-functional: All available IOs of the ESP32 are exposed, can be used as an ESP32 development board.
  • Three indicator lights: Red: Low power; Blue: Charging; Green: Battery full.
  • [2020/08/07] Can download 5 games at once.

Precautions

  • Make sure to turn on the power switch when downloading games!
  • The game ROM size should not exceed 1M.
  • The default charging current is about 400mA. If you use a battery with a different capacity during your own production, please modify the value of R19 according to the TP4056 charging management IC’s datasheet to reset the charging current.

▌Key Mapping

Creating a NES Game Console with ESP32

▌IO Mapping

Function IO Comments

LCD-SCLK

GPIO18

LCD-MOSI

GPIO23

LCD-DC

GPIO17

LCD-CS

GPIO5

LCD-RST

GPIO4

KEY-UP

GPIO14

With 4.7k ohm pullup resistor

KEY-DOWN

GPIO32

With 4.7k ohm pullup resistor

KEY-RIGHT

GPIO33

With 4.7k ohm pullup resistor

KEY-LEFT

GPIO27

With 4.7k ohm pullup resistor

KEY-A

GPIO35

With 4.7k ohm pullup resistor

KEY-B

GPIO34

With 4.7k ohm pullup resistor

KEY-START

GPIO16

With 4.7k ohm pullup resistor

KEY-SELECT

GPIO13

With 4.7k ohm pullup resistor

▌Example

Running Contra Game

Creating a NES Game Console with ESP32

Running as an ESP32 Development Board Example (LittleVGL)

Creating a NES Game Console with ESP32

▌How to Make?

Materials Needed

The following items need to be purchased from third-party platforms.

  • Screen: Either of the following is fine, but make sure to select the 9341 version.
    • (Verified) 2.4-inch TFT LCD screen ILI9341 SPI serial screen.
    • (Not verified, need to check PCB package, may need to modify PCB) Zhongjingyuan 2.4-inch LCD screen 320×240 TFT LCD SPI color screen 9341.
  • M3*12 screws x4

Other components can be purchased according to the BOM table from the Lichuang Mall, including battery link: lithium battery 700mA.

Preparing the Case

Use third-party 3D printing services or print the case yourself; the model files for the case are attached.

Creating a NES Game Console with ESP32

Sample PCB

Creating a NES Game Console with ESP32

Start Making

1. Solder components on the front side of the PCB (do not solder the screen).

Creating a NES Game Console with ESP32

2. Solder components on the back side of the PCB (do not solder the battery).

Creating a NES Game Console with ESP32

3. Power the PCB through the marked position with a voltage of 3.3V and connect the PCB to the computer via USB.

Creating a NES Game Console with ESP32

4. Use serial assistant software on the computer to check if the ESP32 outputs the startup log normally. If not, please check the soldering of components for errors (don’t worry about the log content, just ensure the log is output normally).

Creating a NES Game Console with ESP32

5. Close the serial assistant and download the “ESP32-FLASH download tool – pre-configured.zip” attached.

Creating a NES Game Console with ESP32

6. Run the tool.

Creating a NES Game Console with ESP32

7. Select the ESP32 Download Tool.

Creating a NES Game Console with ESP32

8. Check if the key settings are consistent with the image below (the downloaded tool is already configured, normally no changes are needed).

Creating a NES Game Console with ESP32

9. Select the correct COM port and click Start to begin downloading.

Creating a NES Game Console with ESP32

10. Normally, the download should start automatically, and the progress bar will begin to move, as shown:

Creating a NES Game Console with ESP32

11. If the download does not start automatically for a long time, hold down the “download” button, press the “reset” button, and then click “START” on the download tool again.

Creating a NES Game Console with ESP32

12. If an error still occurs after following step 11, it may be due to component damage or poor soldering; please check the soldering again.

13. After waiting for the program to download normally, disconnect the USB connection and power supply. The following image shows a successful download.

Creating a NES Game Console with ESP32

14. Solder the screen, but do not fix the screen yet.

Creating a NES Game Console with ESP32

15. Ensure that the power switch is off (the lever is up for off), then solder the battery.

Creating a NES Game Console with ESP32

Creating a NES Game Console with ESP32

16. Turn on the power switch, and if there are no issues, the game screen should display “TANK.” If the screen is white or does not light up, please disconnect the battery and start from step one to check soldering and downloading for errors.

Creating a NES Game Console with ESP32

17. Use a 2.5mm drill bit to expand the screw holes; if you don’t have the relevant tools, you can also use self-tapping screws.

Creating a NES Game Console with ESP32

18. Tear off the protective film from the LCD screen (do it according to your own habits; if you don’t want to tear it off, you can skip this). Fix the screen using the double-sided tape that comes with the screen or glue it securely (make sure it’s not crooked!). Place the PCB in the bottom case, position the buttons, cover it with the top case, and screw it tightly.

Creating a NES Game Console with ESP32

19. All done, time to play!

▌Downloading New Games

1. Prepare the game’s ROM file (*.nes).

Creating a NES Game Console with ESP32

2. Run the attached “ESP32-Flash download tool – download multiple games”.

Creating a NES Game Console with ESP32

3. Click the button in the red box, and in the pop-up file selection dialog, select the file type as “All Files” and then choose the game ROM file you want to download.

Creating a NES Game Console with ESP32

4. Turn on the game console power (important!!!), connect the game console to the computer via USB, then select the correct COM port and click START to begin downloading.

Creating a NES Game Console with ESP32

5. After the download is complete, press the “reset” button on the game console to run the first game by default.

Creating a NES Game Console with ESP32

6. Hold down the directional key, then turn on the power (in the powered state, press the reset key), and it will automatically start different games based on the pressed directional key. Refer to the table below.

Game Number Directional Key

1

Default (not pressing any key)

2

Directional Key – Up

3

Directional Key – Down

4

Directional Key – Left

5

Directional Key – Right

▌Photo Gallery

Creating a NES Game Console with ESP32

Creating a NES Game Console with ESP32

The complete materials have been uploaded to the public account backend; reply with the keyword: handheld to obtain the download link.

The complete materials have been uploaded to the public account backend, reply with the keyword:handheld, to obtain the download link.

The complete materials have been uploaded to the public account backend, reply with the keyword:handheld, to obtain the download link.

▌Video

Recommended Reading:
Special Collection | Linux Articles Summary
Special Collection | Programmer’s Life
Special Collection | C Language
My Knowledge Circle
Follow the public account and reply with “1024” to get the link to the learning materials cloud disk.
Thank you for your likes, follows, shares, and views. I will remember every encouragement you give me~

Creating a NES Game Console with ESP32

Leave a Comment