The Arduino Mega is a useful tool for the maker. Generally, once one has come up with plans for blinking LEDs that require more IO than is available on the Arduino Uno, one graduates to the Mega and goes for broke. However, it’s not typically what we’d consider as our first choice for video work. [Stephane] begs to differ, and coded this Bad Apple!! demo for the Arduino Mega 2560.
For those unfamiliar, video on the Arduino is actually somewhat of a solved problem – merely requiring a pair of resistors and some nifty code. The real meat of this hack is the video storage itself. It’s been done before, but by streaming data off an SD card or serial link. [Stephane] was determined to store everything on the Arduino itself, and thus the hack begun. Video data is stored as 1 bit per pixel, as it’s a simple black and white video as per the original inspiration. LZ77 compression was used to cram the data down without requiring too much RAM, which is a limited resource on the Mega. It’s video only, as the Mega is tapped out handling 3 minutes and 39 seconds of video storage, but future work may include syncing with a second Arduino to deliver the soundtrack.
It’s a hack that shows off [Stephane]’s ability to get impressive performance out of limited platforms. We’ve seen this before, with his excellent Star Fox port to the Arduboy. Video after the break.
13 thoughts on “Bad Apple!! Via The Arduino Mega”
Reminds me of NES programming. Except this has fewer features and more limitations despite being on somewhat modern hardware. When will we start seeing official Arduino models with actual 100+ Mhz powered chips and decent amounts of both RAM and ROM memory and ideally some kind of video hardware as well inside? It’s 2019.
I guess there are a few other platforms out there that sort of offer some of this but they are all in the $100 to $200 and up per board range. Arduino (the original one or the rebranded one that split off) just doesn’t seem to value putting something like that out there and instead other people like Lady Ada or Paul Stoffregen have to make their own more advanced platforms and sort of bridge the gap to make them usable enough but still not fully supported hardware, despite being clearly more advanced in performance (and price to a degree as well).
Is Arduino or somebody actually going to start offering reasonably priced, more advanced hardware so we don’t have to hack this together by eliminating sound and making it compressed and black and white? I am happy that this project is doable but it would also be nice to not have to do it to begin with and just start with a workable platform that just supports normal video at a reasonable resolution with color and sound.
Hmm, exactly what do you want? A pi with full open source hw/sw?
What about Arm? I mean, the esp32 has two cores that can be clocked at 320Mhz each (or even higher, as per CNLohr’s awesome stuff). Won’t really get on-board video processing stuff unless you jump to a larger Arm SoC.
There are tonnes of Arm SoCs with Mali gpus on-board. Someone could totally do an Arduino core for one of those and tbh I wouldn’t be surprised if someone already had.
The processing speed is there, the ability to render graphics being primitive compared with the old Amiga and Atari systems due to being purely a CPU driven hack is quite some going, especially to have some time left for rendering the next frame, etc.
Though as for the memory limitations of the Arduino Mega (ATMega2560), Someone had hacked on a 512K extension (kinda paged/segmented in implementation, but usable).
He has been featured on HaD before, though here’s his 512K hack giving 4x the 64K max logical addressable memory:
What would be nice is if the current owner of the ATmel brand released an enhanced ATMega2560-like clone with a “hybrid Mode” that allowed it to act as a hybrid SoC+uC by having a 16-bit core and exposed a 16-bit bus (Multiplexed data bus if pin-count needs require it) with an address bus capable of native 512K and supports extending the address bus over i2c/spi (or similar) by using a “page register” of 16-bits (or 32-bits) to access memory in blocks/pages. Also an interrupt/function pin support for external memory address range unloading for making DMA a little easier by disconnecting the uC from the external memory whilst said pin is asserted. (These wishes would be something I’d consider if the price is right should such a chip be produced).
Current owner AKA Microchip Technology Inc.
That 16-bit AVR would be a bit of out of place, if it was called an enhanced ATMega2560. I don’t think Atmel even had true 16-bit MCUs at all.
A MC68SEC000 might fit your needs. Or if you want you can go old school with a MC68008 with a 8 bit external data bus and still address1MB of RAM/EPROM. All you need is a SRAM, Eprom or Flash memory and some glue logic and you’re set.
IMS the MC68008 was used in a lot of arcade games back in the 80’s.
Ahhaa, so you Mr. 1 or Mr. 2, you expected an evolution of the AVR, right? Yes, there was AVR32 (already dead?), but why on earth are the 8bit Atmegas are still so popular, and we still use them in 2019? Its a great topic itself, but the short answer is: the big quantity (& cheap) chips are not designed for hobbyists, they made for the industry. In the industry ARM is the way since 2005. Arduino lives as an educational platform, therefore obsolete tech is not a problem, however their latest boards already ARM.
I understand why it has persisted and there are nuances too with regards to Intel entering and mostly exiting the market as well. The Arduino platform or others like it have great potential to be far more than just an educational platform though but to evolve beyond what it is requires faster chips with more throughput to cover at least the basics. Basically what smart phones have evolved to today really.
In all honesty, even basic 640×480 screens with the ability to actually display and update things would be great as well as basic functionality with regards to memory and CPU and onboard storage. The technology is here and has been largely possible for almost a decade or so.
You can get this to work but you wind up spending an absurd amount of money for what is not very modern hardware.
I mean any pi has composite output if you just want the cheapest and easiest way to do it out of the box. You certainly don’t need 200 bucks.
Not much fun in it, though.
What about stm32 dev boards ? Such as Nucleos or even the stm32f103 board which is less than 2$ and has support for usb !
There are Arduino / Propeller board that use the more powerful Propeller chip as a ‘gpu’
Well, I just came to say I thought “Bad Apple!!” was going to be a (bad?) implementation of the Apple][.
Ahhhhh why do you mention [Bad Apple!!] I was nearly cured. After reading this article I was listening to 30 different versions of the song on youtube :D The build is nicely done by the way.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)