The board is designed around a LATTICE iCE40UP5K and in this case implement a ATmega32U4 with the necessary IO’s to run unmodified arduboy games, also ( optionally ) includes a VS1053b audio decoder to play music from uSD or create games with more complex sounds.
This board is a derivation of ARDUFPGA ICE40UP5K V1.1 board.
in portable format with a size of only 67x42mmin size, smaller than a credit card.
As hardware, there is:
1x LATTICE iCE40UP5K.
1x SSD1306 OLED 128x64 BW display, or ST7735S LH096TIG11 0.96 inch 80x160 TFT Color 64K Colours.
1x 2MB of SPI FLASH where the design, the GUI boot-loader and the user application (game) is located, with an endurance of minimum 100K erase/write.
1x Optionally VS1053b dedicated audio decoder.
1x Piezoelectric buzzer.
1x RGB powerfull LED that can be used as flashlight without exiting the game that you play.
1x Dedicated battery charger with status LED’s.
Design and firmware’s:
Games and applications are load from a uSD card thru two stage boot-loader:
The first stage that is written inside the design and has its own 4KBytes of ROM memory and 512Bytes of RAM memory, it has even a dedicated interrupt vector named NMI that interrupt the running game every 1mS and check for INT button to be press, this is a service function that is used to check for INT button to be press and optionally can integrate a debug option to debug the core with thru UART unit.
Second stage is a GUI explorer/boot-loader that is load into the emulated ATmega32U4 program memory running like a normal application and include a FAT FS library, this application check and update the design and GUI boot-loader every time a game or application is launch, in case if the running design is custom made for that application or game, when the game or running application is interrupted the GUI boot-loader will automatically save the EEPROM content to the uSD card, and load the EEPROM content from uSD card when a game or application is started, so, all game scores and history is saved if the game is changed.
At this moment all games are in binary format, need to be converted from hex to bin files in order to run.
The design has the capability to increase the size of ROM and RAM memory according to each developer necessities, but no more than 128KB combined.
Different designs, applications source code,boot-loaders source code, user guides, schematic’s and other stuff will be available on:
Of course, design and application ideas are very welcome.
I disabled the startup update, has no reason to exist if every time when an application is started it check’s if need to update the design and GUI boot-loader.
If you short press the INT button ( between 100mS and 500mS ) the game is interrupted and the EEPROM content is saved to the uSD memory.
If you press INT button more that 500 milliseconds, the keyboard is disconnected from the application, and buttons have other functionalities done by the first stage boot-loader that runs like a bios in background.
The features of the first stage boot-loader when INT button is press are:
- INT+ B button change the LED colour B,G,R.
- INT+ A button turn ON/OFF the flashlight (RGB led becomes flashlight).
- INT+ UP increase the game volume in four steps, from mute to maximum.
- INT+ DN decrease the game volume in four steps, from maximum to mute.
- INT+ LEFT switch the USB connector function between UART RX/TX and video NTSC composite output.
- INT+ RIGHT switch the audio connector function between audio and video NTSC composite output, as protection to avoid driving the audio connector by VS10xx and the FPGA, when VS10xx is out of reset the audio connector can not be switch to composite output.
The features of the first stage boot-loader with debug module enabled is:
- This is a very simple debug module that receive commands thru UART module, more details here: https://github.com/dev-board-tech/arduFPGA-mega-first-stage-boot-loader
All this functionalities at the same time when you playing games or listen music.
The volume mostly has effect on headphones, the piezoelectric buzzer does not react to much to the volume change, the volume is changed using two four bit PWM generators in the design that are connected to PORTA bit [3:2], bit [3:2] of the PWM are connected to ‘0’ and bit [1:0] to PORTA, the real maximum volume is 1/4 of total power to avoid blowing up the listener ears .
There, on the board, is a VS1053b audio decoder, is waiting to develop an application to run with him :).
The audio connector is connected directly to VS1053b and three pins of the FPGA, this pins are used by the game as audio outputs but alternatively can be used as data communication, one of the pins needing to be put to ‘0’ to provide the ground for the communication.
The micro USB connector is used for charging the battery, alternatively can be used for data communication, three pins of the FPGA are wired to this connector to D+, D- and ID and can have any desired function.
The current design is a reduced IO, ATmega32u4 compatible core with 64KB of emulated FLASH memory and 32KB of RAM memory, TIM0, TIM3, TIM4, SPI, UART, emulated EEPROM, extra-reduced PLL ( USB clock generator strip away ), 10bit LFSR RNG as ADC.
- PIOA used for design FLASH chip select, application FLASH chip select. external chip select on the ARDVARK connector, volume control as outputs, switch USB connector function and switch audio connector function, all seven keys and LoBat signal as inputs.
- Ports 0xDB-0xFF used for boot status and FLASH memory write registers.
The external chip select on the ARDVARK connector can be used as CS for an external SPI device connected to ARDVARK connector and in case if the user brick’s the arduFPGA console to recover it using any other arduFPGA console or a regular SPI programmer.
A secondary four pin header is available and marked with TWI function, two pins for power and two for communication, the power can be selected by a strap selector for 3.3V from LDO or VBAT, the two pins for communication can be used for any purpose.
Board consumption from the battery is 29mA with the display at maximum bright ~90% of the pixels active, uSD initialized, RGB LED OFF, and VS1053b in reset mode ( no consumption ).
The board is smaller than a credit card only 68x43x10mm in size and the space in the back of the board close to audio connector can be glued a battery up to 1Amp’s in capacity giving a huge game play/ music listen time for one charge.
Here is a demo:
The board is a little bit fried ( ehh, is the prototype )