The idea behind it was to have an Arduboy that you not only can play games with but also can use to check the time! All it needed more was a custom bootloader that reads out and displays the RTC. Well now I finally made one!
This new bootloader reads the time from the DS3231 RTC and displays it at the loader screen using sprites stored in the external flash chip. It support both 24 and 12 hour mode. To keep the bootloader in 3K some I removed some hidden features like LED and button control and display streaming.
The current version supports the DS3231 RTC but the next version Iâm working on will support Micro Crystalâs RV3028 RTC. Thatâs a tiny all in one RTC chip that could easily be added to Arduboy and Arduboy FX using a small flex PCB like the mod chip. With a RV3028 installed Ardboy is equiped with a swiss watch!
Yes, the RV3028 has a built in crystal. Itâs in a ceramic package along with the chip, which is a reason itâs relatively expensive. It needs less board space and draws 1 tenth of the power compared to a HT74563A.
I suggest you attach the RV3028 INT pin to an interrupt generating pin on the ATmega32U4 that can wake it from deep sleep. This would allow the RTCâs alarm and other timer functions to wake up the CPU for things such as Tamagotchi type games.
Since the INT output is open drain, you could attach it in parallel with one of the buttons, so you wouldnât need to use a dedicated pin for it. (A high value pullup resistor may be required.) Iâd consider using the A button, since itâs on the INT6 pin, but a different button could end up to be more suitable.
Hey, at least you donât have software development expenses to cover But yeah I donât have to finance a 1000pcs.
Well send me a dev board already
Yeah thatâs why I started with the DS3231 as it had a interupt pin. One Idea was to hook it to the reset pin to wake it up from (bootloader) power down. If I can find the room for some beeper code in the bootloader we have an alarm clock. An Arduboy AC
Hooking it to a button has itâs advantages to. wake up by button or alarm. Only works if the sketch is running and powers down ofcourse.
If necessary, you could probably query the RTC or the button registers to determine which one actually generated the interrupt, then take an appropriate action (like just go back to sleep if the button caused the interrupt). I havenât researched it but it might actually be necessary to clear the interrupt, regardless.
Of course this is your own board, not trying to steal your thunder, itâs incredible! I still donât know how itâs possible in so small space. Just trying to greatly influence your development path!
Yessir! And a gold arduboy to sway your thinking!
Yep, in most cases youâre going to want to allow the user to wake the device anyways so it just requires you to check the alarm when you wake up to see if itâs the user or rtc pressing the button - as noted.
I mentioned Tamagotchi specifically because @Mr.Blinky happens to be something of a Tamagotchi expert.
Though actually, I vaguely recall someone attempting a virtual pet before. If I remember rightly, it featured a dinosaur and was originally written for some other Arduino device, and they were trying to port it (and presumably just have it work without a proper RTC). Would have been a few years back. Iâm leaning towards thinking it was FreezingSnail who was attempting it, but my memoryâs not brilliant and Iâve seen a lot of people come and goâŚ
At any rate, that game would probably be a good candidate for quick adaptation, assuming a decent chunk of it was already properly ported.
Having the Arduboy sleep for an given amount of time is possible without a RTC to wake it up but it would use a little more power, so would have to be recharged more often. The timekeeping would likely not be as accurate, as well, but it is doable.
You would use the ATmega32U4 watchdog timer to wake up from a sleep state. The timeout is relatively short but you can briefly wake up just to decrement a timeout counter and only stay awake and do actual work when the counter reaches 0.
Yes, I vaguely remembered that possibility, but I wasnât sure if that was what had been planned or not.
As it happens, the thread for the aforementioned project linked to that same comment you linked to, so I was able to find it in the list of âlinked byâ topics:
Thus it was Keyboard Camper, not Freezing Snail.
(I did at least remember the dinosaur correctly.)
IMO itâs essential for a virtual pet to wake up and call for attention. I toyed around with the watchdog timer and it helps to reduce power. But itâs not possible to track real time unless you set the time each time you run it. With an RTC you only need to set it up once.
I expect you would want to run a virtual pet program for quite some time, so setting a clock once at the start of a petâs lifetime, or each time a pet whoâs state has been saved to load a different game is restored, shouldnât be too much of an inconvenience.
Itâs true having a RTC is an advantage for perpetual time, time handling simplicity and power savings. On the other hand, using the watchdog would reach a far greater audience due to the number of existing Arduboys without a RTC. It sould be possible to write a game that uses the RTC if available or the watchdog if not.