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:
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?
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?
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
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.
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.
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.
Yet from the description there it’s obvious that it is meant for the attiny on the fx module.
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.
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.
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?
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.
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
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.