Flash cart(ridge)


#1

I start this thread as a place holder for the Arduboy flash cart project that I’m working on.

Like many others I also fancy playing multiple games on the go. @eried made an awesome looking Arduboy dock to be able to do that and many would love to see SD card support. I gave this a thought too but decided to go for a more console-ish approach: a (game) flash cart.
Not just for a more authentic feel but also because flash is faster and easier to handle for Arduboy than SD cards.

What is this flash cart for Arduboy?

In a nutshell the flash cart is a serial (SPI) flash memory chip hooked up to a voltage levelshifter and Arduboy’s test pads.

Initially the idea was to built it inside Arduboy but with @n602 replacement backplate design and discussing ideas, a removable flash cart was born.

What will it be usable for?

The most important feature will be that a game can be selected from a menu in bootloader mode and that it can be programmed into Arduboy memory right away. No loader app is used wearing down program memory and It takes about a second to program a game. You can follow the development of the custom bootloader that makes this possible here

Another feature will be that sketches can access the flash cart and store additional game data and graphics on it freeing up precious program data in Arduboy program memory.

Schematic - using TXB0104 levelshifter :

flashcart

Schematic - using diode and resistor level shifter :

flashcart-diode-resistor

Eagle PCB design

Proposed connector pinout

Flash cart/ Expansion connector pinout

( (Homemade) Arduboy facing top - front view male pinheader)

12 11 10 9 8 7 6 5 4 3 2 1
TX RX SCL SDA NC KEY MISO MOSI CLK RST GND Vcc
TX*  - Serial Transmitter output
RX   - Serial Receiver input / Flash cart chip select
SCL* - I2C/TWI serial clock I/O
SDA* - I2C/TWI serial data I/O
NC   - Not connected (reserved for future use)
KEY  - Key pin. should be filled to block pin insertion (reverse insert protection)
MISO - SPI/ICSP Master Input, Slave Output
MOSI - SPI/ICSP Master Output, Slave Input
CLK  - SPI/ICSP clock
RST  - MCU/ICSP reset
GND  - Ground (0V)
Vcc  - 5V (~3.0V to ~4.1V on Arduboy)
(*) Not available when using Pro Micro with Alternate Wiring

Example parts / modules

TXB0104 level shifter module

64Mbit / 8Mbyte storage (256+ games):
W25Q64 64Mbit Flash loose chip SOP8 package
W25Q64 64Mbit Flash loose chip DIP package
W25Q64 64Mbit Flash module

128Mbit / 16Mbyte storage (512+ games):
W25Q128 128Mbit Flash loose chip SOP8 package
W25Q128 128Mbit Flash loose chip DIP package
W25Q128 128Mbit Flash module

Adapter board for when using loose chips with SOP8 package
SOP8 to DIP adapter board

Flash storage format

Flash can be read randomly at byte level. But writing to flash is done in pages of 256 bytes and erasing flash in sectors of 4K (4096 bytes). Applications are stored in a number of adjacent pages called a slot. Slots are linked together with a forward and backwards link.

Slot format

  • header (1 page)
  • title screen (4 pages)
  • Optional application code (0 to 116 pages for Cathy3K)
  • Optional Application data (0 to 65534 pages)
  • Optional save data aligment gap (0 to 15 pages)
  • Optional save data (0 to multiple of 16 pages)

Header format

mandatory data

7 ARDUBOY signature string
1 list number (0 bootloader title screen)
2 previous slot page address (0xFFFF for first slot)
2 next slot page address
2 slot size in pages
1 application flash size in 128 byte blocks (0 for none)

optional data

2 page address of application program data (0xFFFF none)
2 page addr application data file ( 0xFFFF none)
2 page addr application save data (0xFFFF none)
2 EEPROM start (0xFFFF none)
2 EEPROM end (0xFFFF none)
16 MD5 application signature
214 UTF-8 zero terminated strings:

  • Application Name
  • Version
  • Author
  • Quick instructions

Numbers are stored in big-endian (Most Significant Byte first) format.

Edit:
added diode-resistor schematic, MD5 signature to header format


Can you load several games at once in 1 Arduboy?
Arduboy custom bootloader
Arduboy replacement face/back plate
ArduBigBOY (WAS: My Homemade: Pro Micro, SSD1309, with Flash Cart)
Can you load several games at once in 1 Arduboy?
Smart Response XE Re-purposed into Arduboy
Flash Cart について
(Nao) #2

With your tremendous help and detailed documentation, I was able to test the operation of prototype of flash-cart just now.
flashcart20180601_03
Thank you @Mr.Blinky
What a genius you are


#3

Great to see you’ve built flash cart already :+1: and taking a different approach. It looks neatly built on some veroboard. I think I overcomplicated mine trying to keep it small/thin :sweat_smile:


(Simon) #4

You’ve done all the hard work - I wonder if you and @bateske can collaborate and incorporate this into a new Arduboy design? Is there enough space to mount a header and squeeze it into the existing design and casing?


#5

…if @bateske doesn’t design and release a super/mega Arduboy with @Mr.Blinky’s flash chip and @Keyboard_Camper’s accelerometer on board now (before someone else does) then he is just leaving money on the table! :open_mouth:


(Simon) #6

I agree!

I will buy 3 or 4 of them alone. @eried will buy the same no doubt.


(Scott R) #7

Mine kind of grew into its own thing and became a pen drive.


(James) #8

That would be awesome with a 3d-printed case, or you could do an Arduboy-esque design and use some acrylic with an aluminum backing to it. Also I came up with a name for your pen drive: The Ardudrive


#9

I can understand why do you have to have a entire thing that supports the flash (like the voultage regulator and the Ievel shifter) on the cart. It should merely be a storage medium. For now it seems reasonable, but in a production modle I think we can make it a bit smaller, still.(it actually depends on where they are able to fit stuff in)
That Arduboy look cool!
And wait for my console once I figure out where to get a VGA out or HDMI out…


#10

Dumb questions:

This looks very exciting, but I have some questions…

  1. How would we put files onto a Serial Flash chip?

  2. How would we choose which file to load from the Serial Flash chip? Dip Switches?

  3. Are there any serial flash chips that don’t need a level shifter? If so, we could eliminate the level shifter part (33% of the total circuit). Are 3.3v chips cheaper or faster or better for the environment?

Looks promising…


#11

If the connector would be dedicated to flash (or 3.3V hardware) only the voltage regulator and level shifter could be embedded. But the idea is to use it also as a general expansion connector.


(Nao) #12

I thought that it might be necessary not only for Flash memory but also for other SPI and I2C devices,
I tried making a case.


I tried to make somewhat thin cases, but they may have been a bit too big.

After all, it seems that I should have made a thin case for a Flash-cart like @Keyboard_Camper 's cool-pen-drive at first…


(Andrew Dent) #13

Looks great! Are the 3D files for the Arduboy front case available online?


#14

the thinner one looks better. If you scan squeeze in the top screw holes. You can make it look more like a hat :smiley: like this:
flash-cart
(quick mock-up with no accurate dimensions)

Also it would be nice if the screw holes where on the back and the top size was solid so you could stick a little label on there. I like the idea of the pin protector clip :+1:


(Scott R) #15

or you could add a cartridge port to the backplate :wink:


#16

This or having it fold over the back. @n602 has a couple thickness of cases designed for a battery extension. Maybe using one of the thicker ones and making a slot at the top like the gameboy


#17

the cartridge port is already in the backplate. could you please elaborate?

Do you mean a recessed cartridge slot? Like a gameboy has as @Freezingsnail mentioned? That would look very nice (still need a case for the cartridge) but at the cost of a smaller battery.


(Scott R) #18

I was thinking more like a gameboy port/ slot.
I’ve also thought about rotating the header and having it clip on like a Pi hat (a little how the DMG battery cover fits if that makes sense).


#19

Ah I see, the connector at the back. For a standard .1 header the back has to be much thicker to make it not stick out of the back.

I fancy a gameboy style slot too. The power switch would be easier accessible then too. but like I said at the cost of a smaller battery.

Note that these prototypes are quite huge for a small card. With a properly designed PCB
The cart doesn’t have to be much deeper then 0.5" (or 2x6 Lego studs :smile: ). With a nice label stuck to it, it would look like a nice little marquee at the top.

In a future stage the connector on flash card could be changed to female. But that requires a redesign of the backplate for a male connector slot. With a female connector at the flash card it will would less likely poke your fingers and a male connector at Arduboy side has less wear than a female one.


(Nao) #20

Hello.
Several files for 3d printers are in Thingiverse.
thing:2853120
“Arduboy replacement face/back plate”
If you are interested in it, please find it.