Skip to content

A Tamagotchi P1 emulator for microcontrollers

License

Notifications You must be signed in to change notification settings

PiperoCorporation/mcugotchi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCUGotchi - A Tamagotchi P1 emulator for microcontrollers

Synopsis

MCUGotchi is a Tamagotchi P1 emulator for microcontrollers relying on the hardware agnostic Tamagotchi P1 emulation library TamaLIB.

STM32F072 Discovery Board

For the time being, MCUGotchi only supports the STM32F0 MCU from STMicroelectronics, more precisely the STM32F072 discovery board, with an SPI SSD1306 OLED screen connected to it, but it can basically run on any STM32F0 based board almost out of the box, and on any STM32 MCU with minor modifications.

The expected connections are the following:

Name PIN
SSD1306 CLK PIN PA5
SSD1306 DIN PIN PA7
SSD1306 DC PIN PA1
SSD1306 CE PIN PA2
SSD1306 RES PIN PA6
SSD1306 VCC PIN VDD
SSD1306 GND PIN GND
Left Button PB3/VDD
Middle Button PA0/VDD
Right Button PB2/VDD

MCUGotchi is also a good example of an embedded implementation of TamaLIB's abstraction layer.

Build instruction

MCUGotchi depends on several components:

  • the GNU ARM Embedded Toolchain, which can be downloaded there
  • OpenOCD, which can be installed using the package manager of your operating system, or built using a release package provided there
  • the STM32Cube Library, which is provided as submodule
  • TamaLIB, which is also provided as submodule
  • a Tamagotchi P1 ROM, which can be downloaded from there for instance
  • TamaTool to convert the binary ROM into a .h file, which can be downloaded or built from there
  1. Clone MCUGotchi and its submodules:
$ git clone --recursive https://github.com/jcrona/mcugotchi.git
  1. Download/build/install the toolchain, OpenOCD and TamaTool. OpenOCD and the toolchain are expected to be in the parent folder of MCUGotchi, but you can place them wherever you want and adjust the first lines of mcugotchi/Makefile accordingly.
  2. Convert the ROM to rom.h and place it in mcugotchi/src:
$ tamatool -r rom.bin -H > mcugotchi/src/rom.h
  1. Build MCUGotchi:
$ cd mcugotchi
$ make
  1. Connect you board and program it:
$ make flash
  1. Try to keep your Tamagotchi alive !

License

TamaTool is distributed under the GPLv2 license. See the LICENSE file for more information.

Hardware information

The Tamagotchi P1 is based on an E0C6S46 Epson MCU, and runs at 32,768 kHz. Its LCD is 32x16 B/W pixels, with 8 icons. To my knowledge, the ROM available online has been extracted from a high-res picture of a die. The ROM mask was clear enough to be optically read. The pictures can be seen there (thx asterick for the link !).
I would love to see the same work done on a P2 and add support for it in TamaLIB/MCUGotchi !

__
Copyright (C) 2021 Jean-Christophe Rona

About

A Tamagotchi P1 emulator for microcontrollers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 82.0%
  • Assembly 13.8%
  • Makefile 4.2%