Homemade arduboy keeps restarting

Hello, I’m trying to make a homemade Arduboy. I’ve tried uploading a the built-in HardwareTest sketch using MrBlinky’s homemade package on an Arduino with only SH1106 screen connected to it, and later with nothing connected, but each time after uploading it would keep turning off and on again. Should I have something else connected for it to work, or is that not an issue?

If you can include a picture, and of course double check all your wiring to the schematic.

Sounds like it is some kind of power related issue?

Oh, well, if you don’t have the external flash memory installed, I think this could be the problem? It’s looking for it on boot, but I don’t think it should just reset?


This is my current setup, it’s messy though.I’ve double checked the connections and they are right, according to the pro micro standard wiring on homemade package’s github.

It’s connected to a 9V battery, so I have a voltage divider that should bring the voltage down to around 3.3V for the screen. The Arduino itself is a 5V Pro Micro from aliexpress, it’s connected to the same battery through RAW pin.

I should note that it works the same way without anything connected to arduino and when it is connected to a computer via USB - the usb connect/disconnect audio cues suggest that. It turns on, and after between 5 and 10 seconds it turns of to immediately turn on again. It’s the same no matter if the screen is connected or not.


And those are the settings I have used when uploading the sketch to the Arduino

Have you tried uploading a short serial program and using the serial monitor to receive the data?

E.g. something like this

void setup()
{
	while(!Serial);

	Serial.print(F("Wait 4 seconds"));
	delay(1000);
	Serial.print('.');
	delay(1000);
	Serial.print('.');
	delay(1000);
	Serial.print('.');
	delay(1000);
	Serial.println();
	Serial.println(F("Hello world"));

	while(true);
}

void loop()
{
}

Or is uploading not working because the device is resetting?

The Arduino was working well before I used it for this. After I ran into this problem, I managed to reset the arduino and upload a blank sketch, and then it wouldn’t restart like anymore. After uploading the HardwareTest sketch it started malfunctioning again. I can try uploading a serial program now, but I think if I manage to do that, it’ll work again. Also, should I include the Arduboy libraries in that sketch?

I have uploaded that code and it seems to work correctly now. I have also tried uploading it with all the libraries from the program before and it also seems to be working well.

Might be a poor connection in the breadboard, that seems to be the most common issue when people are doing this kind of stuff. Especially if it’s intermittent and you can’t track any other cause down.

While I connect the arduino to the pc via USB cable, without a screen or a battery, or anything connected, it keeps restarting all the same though

Maybe try going back to programming it as a pro-mini using the normal arduino core to see if that works.

Is the battery connected at the same time as the usb? If so putting 9v into the USB port probably isn’t a good idea.

Also, by using a voltage divider to power the screen from a 9v battery means that that current is continuously being used just to heat up the resistor.

Right now I’ve tried putting a Serial print in various places in the code, and it seems like it just turns off at arduboy.begin();

The battery and USB are not connected at the same time, but I’ve tried running it with either of those.

I’ve seen the threads about using a voltage converter to power the screen, but I’ve decided to try it with the cheaper option that would let me run Arduboy at all, and maybe later upgrade to proper components. The screen works though, when the arduino turns on it flashes with “ARDUBOY” text right before the arduino turns off again.

By putting Serial.print in different spots in the Arduboy2 library, I have determined that it stops working in this loop in function void Arduboy2Base::bootLogoShell(void (*drawLogo)(int16_t)). It seemed to consistently stop working at the iteration where y = 3, so I tried putting another print at that exact iteration in different spots to determine what exactly doesn’t work but… It looks like that iteration finishes successfully? It seems really weird.

Update: I have tried uploading that to a brand new Arduino, and miraculously it worked! The Arduino I have used up until now is an old one I have used in different projects before - maybe it is broken. I can’t test it with battery and screen yet, because I don’t have pins soldered to it, but I’ll update when I check if it really works or doesn’t work.

Just to confirm, did you upload to the new one using the exact same settings, or is it a different kind of board?

If the same settings were used and it worked then it’s probably an issue with that particular board, but if it’s a different board then there’s several possible things that could explain the issue including software errors and problems during upload.

It should be the exact same board, just fresh and unused, with the exact same settings. I have used the old one in many other small projects so there’s a high chance something went wrong at some point and it broke it in a way that wasn’t obvious yet.

In that case, yes, it seems likely it’s a hardware fault with the board.

Based on where it’s failing I’d guess it’s an issue with a hardware timer or the interrupt mechanism, but it’s hard to say for certain.
Whether or not it’s worth looking into depends on how much time you’re willing to spend trying to diagnose the problem.


So finally, it works! It really must have been a hardware fault, but I’m not going to investigate further, the other one can keep being a small side project board.

Thank you guys for the help!

2 Likes

Good the issue is fixed.

The Pro Micro probably saw up+down being pressed (connection to GND). When those buttons are pressed for 2 seconds Arduboy will ‘reset’ into bootloader mode. The stock bootloader will remain active for about 8 seconds and then exits and runs the sketch again. This would loop forever.

No it’s not! The cathy3K bootloader was designed to work with and without a flash chip.

I don’t see that he flashed the bootloader, just used the board package.

I assumed you talked about Cathy3K bootloader. The stock bootloader does’t care if a flash chip is connected or not.

Ya I don’t know either my swag is 9v went somewhere it wasn’t supposed to.