Game & MINTIA

by 陳亮 in Circuits > Arduino

12878 Views, 97 Favorites, 0 Comments

Game & MINTIA

DSC04388.jpg

This instructables show how to use a tiny sweet box to make a NES console.

Supplies

What Is MINTIA?

IMG_5218.jpg
IMG_5216.jpg

MINTIA is a multi favor tablet produced by Asahi Group Food, Ltd. in Japan since 1996. The sweet box design make it very easy to take one and only one tablet out when put off the cover, you can see the demo video how it works. MINTIA is very popular in Japan, it even have many 3rd parties tailor-made leather case for MINTIA.

The sweet box is very thin and the tablet outlet is very fit for the micro USB plug. MINTIA is over 20 years old, micro USB plug not yet born at that time! What a coincident!

4 years ago, I would like to squeeze all electronic components in it to find out how much it can be. This is the 3rd projects I built on MINTIA sweet box.

Asahi MINTIA page:

https://www.asahigroup-holdings.com/en/brand/minti...

MINTIA official Facebook page:

https://www.facebook.com/mintia.jp

My previous Mintia projects:

https://www.instructables.com/Arduino-MINTIA-Game-...

https://www.instructables.com/IoT-LED-Matrix/

Sweet Box Patch

IMG_4554.jpg
IMG_4555.jpg
IMG_4561.jpg
IMG_4562.jpg
IMG_4563.jpg
IMG_4564.jpg

I would like to hide the NES console under the MINTIA sweet box, so I will keep the original front face unchanged. All magic hide at the back ;>

First of all I need consume all 50 MINTIA tablets. It is an easy job, I can consume box of it every week. Then remove the back face sticker. MINTIA box is well designed, front and back part assembled without glue. So it is very easy to tear apart after put off the tablet outlet cover. I would like to utilize all space in the box, so I will cut out all the internal supports.

Now I can squeeze all components inside it.

Design Back Face Layout

IMG_4556.jpg
IMG_4559.jpg

I would like the NES console look like the Nintendo classic "Game & Watch" series. So I selected a red MINTIA sweet box. Then I use a gold color paper as a cover. Landscape layout, screen at the middle, direction buttons on the left, select and start buttons at the bottom and 2 big buttons on the right. Besides the standard NES buttons, I also require 2 more buttons for save and load status. So I add 2 more small buttons on the upper right.

Hardware Selection

IMG_4565.jpg
IMG_4567.jpg
IMG_4566.jpg
IMG_5001.jpg
IMG_5007.jpg
IMG_4866.jpg

ESP32 Dev Board

This NES console is based on my previous instructables, Arduino NES, so it require a ESP32 dev board. Not much dev board can fit into the sweet box, TTGO T7 v1.3 is the small enough one after removed the Lipo Battery socket. The limitation is it does not have PSRAM, it limited the NES ROM can play.

Lipo Battery

The Lipo capacity direct limited the console playing life time, so it should be as big as possible. Exclude the room for the ESP32 dev board, there are still enough room for a 30 x 30 x 40 mm 360 mAH Lipo battery. I think it can last over an hour.

Display

1.54" inches square display, ST7789 IPS LCD, is the largest display that can fit in MINTIA and still have enough room remain for the buttons.

Audio board

ESP32 can use internal DAC or external I2S DAC. Internal DAC still require an extra amplifier to drive a speaker and external have better sound quality, so I choose external I2S DAC amplifier board. No any I2S DAC audio breakout board can fit in the remaining room, so I need patch from a MAX98357 board.

Speaker

After MAX98357 patch, there are still have enough room can fit in a 10*18 mm speaker.

Prototype PCB

Normal PCB is too thick, we need a special thin (<= 1 mm) prototype PCB for holding the display and buttons.

Buttons

For better playing experience, this time I selected some light touch (125 gf / 160 gf operating force) tactile switches from Diptronics.

Fix Dev Board & Lipo

IMG_5002.jpg
IMG_5004.jpg
IMG_5006.jpg
  • Direct soldering Lipo to the original Lipo socket power pins
  • Use hot glue fix the dev board on the sweet box and align the USB socket in the right place (beware hot glue should not touch any GPIO pins)
  • Use a little bit hot glue fix the Lipo battery
  • Double check the sweet box back cover can reassemble without problems

I2S DAC Board Patch

IMG_5008.jpg
IMG_5024.jpg
IMG_5078.jpg
IMG_5079.jpg

The MAX98357 board is a tiny square board but it still cannot fit in the sweet box. The upper part is the speaker connector and no any other electronic components. I will cut it out for saving space. The speaker still can connect by soldering the node between 2 capacitors as show in second photo. Then use hot glue fix in the sweet box and double check the sweet box back cover can reassemble without problems.

Then it is the soldering work, here are the connection summary:

ESP32        -> MAX98357
=====           ========
GPIO 15(TD0) -> LRC
GPIO 13(TCK) -> BCLK
GPIO 14(TMS) -> DIN
5V           -> Vin
GND          -> GND
             -> 100k Ohm resistor -> Gain (optional for 15 dB gain)

Ref.:

https://datasheets.maximintegrated.com/en/ds/MAX98...

Early Test

After connected the first component, I2S DAC, I would like to check is it works. So switch to software part first.

Software Preparation

Arduino IDE

Download and install Arduino IDE if you are not yet do it:

https://www.arduino.cc/en/main/software

ESP32 Support

Follow the Installation Instructions to add ESP32 support if you are not yet do it:

https://github.com/espressif/arduino-esp32

Arduino ESP32 filesystem uploader

Follow the installation steps to install Arduino ESP32 filesystem uploader if you are not yet do it:

https://github.com/me-no-dev/arduino-esp32fs-plugi...

Arduino_GFX Library

Download latest Arduino_GFX libraries: (press "Clone or Download" -> "Download ZIP")

https://github.com/moononournation/Arduino_GFX

Import libraries in Arduino IDE. (Arduino IDE "Sketch" Menu -> "Include Library" -> "Add .ZIP Library" -> select downloaded ZIP file)

Arduino Nofrendo Library

Download latest Arduino Nofrendo libraries: (press "Clone or Download" -> "Download ZIP")

https://github.com/moononournation/arduino-nofrend...

Import libraries in Arduino IDE. (Arduino IDE "Sketch" Menu -> "Include Library" -> "Add .ZIP Library" -> select downloaded ZIP file)

Configuration

  • Open esp32-nofrendo sample code in Arduino IDE ("File" -> "Example" -> "arduino-nofrendo" -> "esp32-nofrendo")
  • Save as a new project
  • Change hardware parameters:

hwconfig.h around line 69, select SPIFFS

// Uncomment one of below, ESP32 support SPIFFS SD_MMC and SD
/* SPIFFS */
#define FILESYSTEM_BEGIN SPIFFS.begin(false, FSROOT); FS filesystem = SPIFFS;
/* 1-bit SD mode SD_MMC, always retry once for begin() failed */
// #define FILESYSTEM_BEGIN (!SD_MMC.begin(FSROOT, true)) && (!SD_MMC.begin(FSROOT, true)); FS filesystem = SD_MMC;
/* 4-bit SD mode SD_MMC, always retry once for begin() failed */
// #define FILESYSTEM_BEGIN (!SD_MMC.begin(FSROOT, false)) && (!SD_MMC.begin(FSROOT, false)); FS filesystem = SD_MMC;
/* SD using default SPI settings */
// #define FILESYSTEM_BEGIN SD.begin(22 /* SS */, SPI, 8000000, FSROOT); FS filesystem = SD;
/* SD using custom SPI settings */
// #define FILESYSTEM_BEGIN SPIClass spi = SPIClass(HSPI); spi.begin(14, 2, 15, 13); SD.begin(13, spi, 8000000, FSROOT); FS filesystem = SD;

hwconfig.h around line 81, set I2S DAC pins

// enable audio
#define HW_AUDIO
#define HW_AUDIO_EXTDAC
#define HW_AUDIO_EXTDAC_WCLK 15
#define HW_AUDIO_EXTDAC_BCLK 13
#define HW_AUDIO_EXTDAC_DOUT 14
#define HW_AUDIO_SAMPLERATE 22050

hwconfig.h around line 89, setting controller GPIO

/* controller is GPIO */
#define HW_CONTROLLER_GPIO
// #define HW_CONTROLLER_GPIO_ANALOG_JOYSTICK
// #define HW_CONTROLLER_GPIO_REVERSE_UD
// #define HW_CONTROLLER_GPIO_UP_DOWN 34
// #define HW_CONTROLLER_GPIO_REVERSE_LF
// #define HW_CONTROLLER_GPIO_LEFT_RIGHT 35
#define HW_CONTROLLER_GPIO_UP 12
#define HW_CONTROLLER_GPIO_DOWN 32
#define HW_CONTROLLER_GPIO_LEFT 25
#define HW_CONTROLLER_GPIO_RIGHT 27
#define HW_CONTROLLER_GPIO_SELECT 4
#define HW_CONTROLLER_GPIO_START 0
#define HW_CONTROLLER_GPIO_A 22
#define HW_CONTROLLER_GPIO_B 21
#define HW_CONTROLLER_GPIO_X 17
#define HW_CONTROLLER_GPIO_Y 16<br>

if your display is 9-bit SPI LCD, display.h around line 37

// #define TFT_BRIGHTNESS 128 /* 0 - 255 */

// #define TFT_BL 14
Arduino_DataBus *bus = new Arduino_ESP32SPI(-1 /* DC */, 5 /* CS */, 18 /* SCK */, 23 /* MOSI */, -1 /* MISO */);
Arduino_ST7789 *gfx = new Arduino_ST7789(bus, 33 /* RST */, 0 /* rotation */, true /* IPS */, 240 /* width */, 240 /* height */, 0 /* col offset 1 */, 80 /* row offset 1 */);

/* ST7796 on breadboard */
// #define TFT_BL 32
// Arduino_DataBus *bus = new Arduino_ESP32SPI_DMA(32 /* DC */, -1 /* CS */, 25 /* SCK */, 33 /* MOSI */, -1 /* MISO */);
// Arduino_TFT *gfx = new Arduino_ST7796(bus, -1 /* RST */, 1 /* rotation */);

/* ST7796 on LCDKit */
// #define TFT_BL 23
// Arduino_ESP32SPI_DMA *bus = new Arduino_ESP32SPI_DMA(19 /* DC */, 5 /* CS */, 22 /* SCK */, 21 /* MOSI */, -1 /* MISO */);
// Arduino_ST7796 *gfx = new Arduino_ST7796(bus, 18, 1 /* rotation */);

if your display is normal SPI LCD, display.h around line 37

// #define TFT_BRIGHTNESS 128 /* 0 - 255 */

// #define TFT_BL 14
Arduino_ESP32SPI_DMA *bus = new Arduino_ESP32SPI_DMA(14 /* DC */, 5 /* CS */, 18 /* SCK */, 23 /* MOSI */, -1 /* MISO */);
Arduino_ST7789 *gfx = new Arduino_ST7789(bus, 33 /* RST */, 0 /* rotation */, true /* IPS */, 240 /* width */, 240 /* height */, 0 /* col offset 1 */, 80 /* row offset 1 */);

/* ST7796 on breadboard */
// #define TFT_BL 32
// Arduino_DataBus *bus = new Arduino_ESP32SPI_DMA(32 /* DC */, -1 /* CS */, 25 /* SCK */, 33 /* MOSI */, -1 /* MISO */);
// Arduino_TFT *gfx = new Arduino_ST7796(bus, -1 /* RST */, 1 /* rotation */);

/* ST7796 on LCDKit */
// #define TFT_BL 23
// Arduino_ESP32SPI_DMA *bus = new Arduino_ESP32SPI_DMA(19 /* DC */, 5 /* CS */, 22 /* SCK */, 21 /* MOSI */, -1 /* MISO */);
// Arduino_ST7796 *gfx = new Arduino_ST7796(bus, 18, 1 /* rotation */);

Program

  1. Connect the device with USB cable
  2. Open Arduino IDE
  3. Open esp32-nofrendo sample code ("File" -> "Example" -> "arduino-nofrendo" -> "esp32-nofrendo")
  4. Press Arduino IDE "Upload" button
  5. Select "Tools" menu in Arduino IDE -> "ESP32 Sketch Data Upload" will upload the ROM file to ESP32 SPIFFS.

Subsequence Test

The dev board have a built-in "Boot" button. This button can help ESP32 enter program mode easily.

Since the boot button (GPIO 0) is mapped to start button in hwconfig.h, press this button after Arduino-nofrendo boot up means press the start button. So I always can test the connected components by pressing the start button. E.g. after connected the I2S DAC board I should able hear game sound by pressing start button.

Thin Prototype PCB Patch

IMG_5112.jpg
IMG_5113.jpg

The first layer of the NES console is ready, the second layer is

The thin prototype PCB is a large plate, simply use scissor can cut to desired shape. The shape should a little smaller than the sweet box, and avoid cover the speaker. The dev board flash chip is the thickest component, so I also trim the PCB to avoid this.

Connect Display

IMG_5114.jpg
IMG_5115.jpg

Please read through the ordered display data sheet before make any connection.

Here are the connection summary:

ESP32   -> Display
GPIO 14 -> D/C
GPIO  5 -> CS
GPIO 18 -> SCK
GPIO 23 -> SDA
GPIO 33 -> RST
3v3     -> Vcc, LED+
GND     -> GND, LED-

After connection, simply turn on the power to check if it work.

Sweet Box Patch for Display

IMG_5124.jpg
IMG_5123.jpg
IMG_5121.jpg

Power Switch

IMG_5257.jpg
IMG_5258.jpg

I think redirect the dev board power switch outside the sweet box is the most difficult part. I need to use a tiny 3D printed part help to make it:

https://www.thingiverse.com/thing:4693514

If you do not have a 3D printer, simply desoldering the original switch and extend the pins to a bigger switch should be a good solution.

Connect Buttons

IMG_5259.jpg
IMG_5159.jpg
IMG_5161.jpg

Here are the connection summary:

ESP32   -> Buttons
=====      =======
GND     -> All buttons
GPIO 12 -> Up button
GPIO 32 -> Down button
GPIO 25 -> Left button
GPIO 27 -> Right button
GPIO  4 -> Select button
GPIO  0 -> Start button
GPIO 22 -> A button
GPIO 21 -> B button
GPIO 17 -> X button
GPIO 16 -> Y button
Check connection anytime:

Cover Plate

IMG_5198.jpg
IMG_5199.jpg

This step is second difficult part.

  • Select a good looking card paper from stationery shop
  • Cut the size to a little bit smaller than the sweet box
  • Cut the buttons and display one by one

Sound Hole

IMG_5231.jpg

Remember punch some hole to let the speaker sound out before stick the cover plate.

Final Decoration

IMG_5204.jpg
DSC04333.jpg
DSC04336.jpg
DSC04341.jpg

I would like to make it look like Nintendo "Game & Watch" series, so I printed a tiny label "Game & MINTIA" and stick on it ;>

Enjoy!

DSC04391.jpg

It's time to play and show off what you have done to your friends!

What's Next?

IMG_5220.jpg
IMG_5217.jpg
IMG_5213.jpg

4 years ago, I use MINTIA made a Tetris game with a 0.96" display; Now I use a 1.54" display to make a NES console. MINTIA still have many possibilities, let's dig it out together!