Mini handheld game console

This is my second small handheld game console. This one is much less powerful and uses tiny 0.42” inch OLED screen. The MCU is a ATMega32u4 running at 8 MHZ (the ATMega32u4 should not run faster when supplied with 3.3V). The bootloader is Arduino compatible and is programmed from the familiar Arduino IDE.

The OLED communicates using I2C which is a quite slow interface. On ATMega32u4 the maximum supported frequency for the builtin driver is 400kHz. With 72×40 pixels (the silkmask says 70×40 but that is a print error) to shuffle, it will take almost 65 ms to update the image which is way too slow to get a smooth animation. Luckily, I was not the only one that had this problem so my google skills showed me the way to Larry Banks blog and using his algorithm (a highly optimized bitbanging of the I2C communication), the frame speed is now down to 10 ms which is perfectly acceptable.

Other than the OLED communication, the most other stuff is quite standard. The buttons are connected to GPIOs of the MCU and the battery level runs through a voltage divider and then to a analogue input of the MCU.

The charging circuit is based on MCP73831 and basically copied for the datasheet. The unit can be powered by either the USB port or from the battery. When powered from the USB port, the battery is charged.

There are three LEDs on the PCB: The yellow one (clostest to the mid of the board) are charge indication, the middle one is power on and the third one is connected to the MCU as a general userdefined LED. It is connected to the same GPIO as on the original Arduino Leonardo and flashes nicely when the unit is in bootloader mode.

ISP (In-System-Programmer) is only used to program the bootloader first time and then the unit will be seen as a serial port and can be programmed directly from the Arduino IDE without any external programmers.

The size of the unit is 60 mm x 20 mm (without battery and piezo summer). Fits easily in ones pocket!

Specification

  • ATMega32u4@8MHz, 3.3V
  • 6 buttons (left, right, down, up, A, B)
  • 3 LEDs
  • Built-in LiPo charger
  • Piezo buzzer output
  • 0.42″ 72×40 pixels OLED
  • USB C port
  • Arduino bootloader