Newcomer questions - adding flash IC, SH1306 vs SSD1306, help in building own

Hello everyone, I just joined your fine community.

I learned about arduboy only recently and I’m amazed how mature the project is.
Obviously I want to make my own (where’s the fun in buying one, right?)

But I have few questions, that might seem dumb, but for me there is lots of confusion about some things:

  1. What is “FX” / “FX-Mod”?
    I assume it is the flash-cart, aka the external SPI-flash module. But why FX? what does FX stand for?

1.1) Arduboy is opensource hardware, right? So we can see schematics (and I did saw schematic here on forum). Can we see the schematic for the FX-Mod too?

  1. AVR can’t run code from external flash, right?
    So that’s why there are attinies in various (partial) schematics I saw, the 32u4 gets reflashed with new game each time we select one in menu (loader?).
    So wont that kill the MCU at some point? If I recall, the internal flash on mcu has like 1000x write cycles before it goes bad. With 300+ games available it sounds like it might die REALLY fast. Or am I being paranoid now?

  2. Is the ATTiny on flash-mod REALLY necessary?
    I’ve seen some schematic where the flash was directly hooked to 32u4 (with some extra circuitry), can’t find it anymore. Dunno how this would work, 32u4 can’t flash itself, right?
    I’m just trying to find out what is needed to make it work, I wanna try making my own pcb

  3. SSD1306 vs SH1306 (vs other kinds)
    At first I thought it was about i2c vs spi displays, then I saw there are I2C/SPI variants of both. So the SHxx has MORE RAM, so it requires so changes in code to work properly. Is it doable? Or should I look for SSDxxxx displays? Aliexpress isn’t very kind in that matter, they write SSD1306 and SH1306 everywhere, but I assume they sell the SH variants.

  4. Porting to different MCU
    I’ve seen lots of people been requesting support for 328p, but it was always dismissed due to smaller RAM/FLASH size.
    But what about porting to stm32? Those got really cheap compared to any AVR used in arduino, and have much higher clock speeds and uncomparably more RAM and program memory (looking at STM32G0xx as example). Not sure how hard/complex would it be to make a port, but for future editions maybe worth considering?

The “FX-Mod” adds a flash chip, for providing memory/ storage to the original Arduboy. With a custom bootloader (/firmware) it allows you to flash games on the go, without using a computer. The “FX Arduboy” comes with the chip already setup for you. The name “FX” just sounded cool/retro to the creator @bateske (perhaps inspired by the SNES Super FX cartridges?). It doesn’t have some technical meaning.

1 Like

Hi Welcome to the community!

  • FX or FX chip stands for Flash eXpansion which refers to a W25Q128 SPI flash chip.
  • FX-Mod stands for FX Modchip and refers to a small flex PCB that has the FX chip with an Attiny85 micro controller and is intended to upgrade the original Arduboy.

Check out the Mod chip repo the pinout here Not sure if @bateske posted a schematic somewhere.

The Atmega32u4 have a reflash cycle of (at least) 10000 times. if you’d play 3 different games every day for 9 years you still haven’t run out of burn cycles.

No It is only used to update the bootloader without the need for an ICSP programmer. when not used a pullup resistor on flash chipselect is required though.

Yes it can the bootloader flashes the games not the attiny. The 32u4 can’t flash fuses or the complete bootloader.

That’s not really important. when using SPI the display RAM is write only.

Depends on what is important to you. If you want high/full compatibility get a SSD1306 or SSD1309 and use the standard wiring. If you use a different wiring then you can choose any supported display you like as you need to recompile the games from source if somebody didn’t already do that. I don’t recommend using I2C though.

Sure can be done they could even emulate AVR if someone is willing port or make an emulator for it.

Yes it’s a nod to the Super FX chip too :slight_smile:

3 Likes

I make my FX build tutorial over here
Arduboy DIY with FX - Hackster.io
Hope this might help.
(all information i gather from this community)

2 Likes

Thanks, this is great.

But I still dont understand how this flash would work here - you mention

and then go to Arduboy FX mod-chip:

GitHub - MrBlinky/Arduboy-FX-mod-chip: Self updating bootloader for Arduboy FX

Yet from the description there it’s obvious that it is meant for the attiny on the fx module.

Edit;
Okay, so I found this thread

and I think I get it - so the attiny is used to flash the 32u4 ONCE. And once the new bootloader is in place, then it is kinda obsolete.
So if I want to make a version without attiny, then I need to expose the programming pins for the 32u4, so I can burn the new bootloader with USBASP.

Yep you got it!

And I’ve been playing around with the rp2040 it’s more powerful and more available. Only major downside is that it requires external flash chip.

2 Likes

I’ve been reading forum for hours in last few days and I indeed learned a lot, but there is still some confusion left.

I looked at your flash-cart thread and wonder:

  1. Why is there no 10k pullup in your schmeatic with level-shifter (the very first image here: Flash cart(ridge))

  2. Why is an inverter for flash CS being mentioned sometimes there?
    Is the inverter also needed if I would follow the “Pro Micro 5V alternate wiring”? (GitHub - MrBlinky/Arduboy-homemade-package: Arduino IDE board package for Arduboy and homemade versions making things easy)

  3. In alternate wiring, which I most likely be using in my board, OLED RST is on PD1, but so is the flash Chip-Select (PD1/SDA) - should the RX (32u4 PD2 pin) be used instead when doing the “alternate wiring”?
    If flash would only be used during flashing games, then I guess it’s not a problem for OLED to be resetted, but I read games could use flash for storing data too - so that won’t work well together, right?

    My bad, it clearly is PD2 for alternate wiring.

  4. Not so important but why are there two pins for driving the speaker?
    Was thinking about adding some cheap amp and regular speaker instead of piezo (similar to simple circuits “add speaker to raspberry pi zero” that use single PWM signal), but can’t do it if some games use one pin, some use the other, and in some situations BOTH are being used?

Because of the way the levelshifter works.

It is required when using standard wiring and a flash chip.

No

2 Likes

Some Arduboy clones do add an amp and a speaker, and they choose to omit one of the speaker channels. Some games use one pin or the other, some use both. The atmlib music library uses differential signaling to increase the volume and perform effects.

If you wanted to add an amplifier I suppose the “best possible” circuit would be to invert one of the signals and push them into a stereo amplifier.

1 Like

Thanks again to everyone.

So I’ve been DIYing for some time and made my own clone (is that’s the right term for homebrew arduboys?). It’s been giving me some trouble, as I might have overengineered it a bit. But despite all the problems I reached the point where I was able to flash the 3k bootloader and something shows up on the screen.

Now I wonder how to proceed next - since I have used the “promicro alternate wiring” and different display, I need to recompile all games to make it work with my hardware - it looks like there’s easy way to do that in arduino ide with the homemade plugin.

My new questions:

  • is there some “collection” project that can pull all the games and batch-compile them?
  • is there some central place where all the available games are listed (with links)? Or do I need to get them one by one from the GAMES category and separate threads? Seems like a bit of work
  • how do I put them on the memory IC? I get it flashing the 32u4 one by one, but how do I put them on the fx w25x chip?
  • does the SPI Flash needs to be formatter/prepared somehow before I can put there anything? Edit: Okay I somehow missed this

1 Like

You could look at the cart builder.

Most of the games have a link to the source.

If your clone is the same as an 8BitCade XL, then you might be lucky that the games are already compiled for you.

2 Likes

The 8BitCade XL uses the following settings when compiling.

Are these the same as yours?

If so you are in luck.

If not, can you tell me what settings you are using?

Similar, but with exception of SH1106 Display.

Of that’s a pity … you will need to recompile unfortunately.

2 Likes

I dont think that’s a big problem. Just a hassle if I wont find any semi-automated way to do it for whole collection. I’ll try in few hours when I’m back home.

After you’ve got a list of GitHub links should may at least be able to automate the downloading of the source files via Git.

You’d have to change the link from https://github.com/<user>/<repo> to https://github.com/<user>/<repo>.git before feeding it to Git, but that’s easy enough to automate.

Building on the other hand will differ per game because there’s no standardised way of structuring an Arduboy project.

Most games will have a single .ino file, so you should be able to automate locating the .ino file.

Some games use more than one .ino file, which makes things a bit trickier.

You might be able to narrow it down by picking one that matches the name of the containing folder.

After identifying the .ino file it should theoretically be possible to use the CLI version of Arduino to automate the actual compilation.

The main reason this isn’t easier is because the existing infrastructure is designed for people with an ‘official’ Arduboy. People with ‘clones’ that deviate from the spec are an afterthought.


There’s no official terminology.

Though personally I avoid using ‘homebrew’ in relation to Arduboy because it’s very different to what people usually mean when they talk about ‘homebrew games’.

Typical homebrew usually involves having to circumvent some kind of protection mechanism and is usually of dubious legality because the companies who make proprietary consoles (e.g. Nintendo, Sony) don’t want users to be able to write their own code for the console.

None of that applies to Arduboy because the Arduboy is supposed to be programmed. Here in Arduboy-land the line between users and developers is almost nonexistant, therefore it’s not ‘homebrew’ in the traditional sense.

1 Like

We decided to call it “homemade” after much discussion actually, but you are welcome to call it whatever you like :wink:

I almost mentioned the category naming, but I wasn’t sure if that was ‘official’ enough or not.
Can I take that to mean that the official stance is that ‘homemade Arduboys’ is the ‘proper’ term?

1 Like

I don’t think there is a proper term, people can call it whatever they like. We just had to pick one to use that most represented most people and clearly communicated the idea.

You can call it a clone, a copy, a hack, inspired by, or you don’t have to say what it is at all.

But in the taxonomy of this website, it belongs in the “homemade” section.

1 Like