05/25/2017 at 20:14 •
Dodo is now available on Tindie!
Also, the Documentation is now complete and live and is a great resource for anyone looking into how a single board computer (or in this case double board!) is put together.
Updates are regularly posted on Twitter
Thanks for following!
04/16/2017 at 21:47 •
The past few months have been spent getting Dodo ready to be available as a kit. Its a lot of work to get a kit together of this complexity! The hardware is final, the firmware final, parts have arrived, and most importably the documentation is complete!
Check out the documentation at docs.dodolabs.io. I have provided both assembly instructions and information pages on the sub-systems of Dodo.
The last change to the firmware was to support versioning and improved flashing. There is now a version number built in that can be queried over the serial connection. Games record what version of the firmware they were built to target. Semantic versioning has been adopted and there is a version check when games load to avoid unexpected behaviors and allow for continued development.
There is no longer a flash button on the splash screen. The flash button has been replaced with an Info button that will show the firmware version. Dodo listens for a flash command as it sits on the splash screen indefinitely. The user experience is now much improved.
Be sure to check out dodolabs.io, follow on twitter, and sign up for the e-mail list to stay updated on the latest Dodo news! The Tindie page will go live soon!
12/23/2016 at 04:24 •
For fun I hacked together a Christmas demo for Dodo. I found an animated GIF of a retro graphics style Santa which I then manually converted to monochrome. I use the program Pixen for laying out sprites. From there I took the 7 frames and dumped them as byte arrays and wrote a quick little program to cycle through the frames. The resulting sprite size was 42x48 so there were room to show 3 of them. The finishing touch was to get Jingle Bells playing in the background. Unfortunately 256 bytes are not enough to hold the complete song. I will go back and update the firmware to support longer music.
See it in the playground here: https://play.dodolabs.io/?code=f281ce54
Here is the original GIF: http://pug-of-war.tumblr.com/post/68955867425/its-pixel-tinsel-time-ho-ho-ho
12/20/2016 at 02:56 •
The Dodo Playground now supports writing games in 6502 assembly. Some of the initial feedback I received for Dodo is that C is great and all, but a big part of the nostalgia for a 6502 retro system is to be able to write in 6502 assembly. I totally get it, I have had a lot of fun writing the system firmware in assembly. Now in the Playground, it is easy to make a language choice using the dropdown in the top navigation bar.
Here is a working example in Assembly
Making the change wasn't all that difficult, the back end compilation still uses cc65. Basically I just needed to author a thin set of assembly routines for calling each API, and update the backend with two different make files. The thin wrappers each hardcode an index into the API's jump table. The calling convention for C is pretty friendly for making assembly calls so that is left in place. Basically each parameter needs to be pushed onto a stack and I incorporated helper functions to do so. Here is a simple API call example:
lda #<message ldx #>message jsr pushax jsr draw_string
To support this new functionality involved making changes across the board so it was a good opportunity to finally make the last changes to fully take advantage of the updated address space in Dodo 1.2 and above. Video memory and user code space are now moved around to now give a game 22KB of available RAM.
Another reason for supporting assembly in the playground is to make it much easier to iterate while implementing my 1KB challenge submission, which is to implement image compression for Dodo.
The challenge for 1KB is to compress a single image such that the image data and algorithm all fit under the 1KB limit. As an extension to this I also want to challenge myself to fit 20 compressed images into 8KB. With 20 images, the new 22KB of avilable RAM and the fact that Dodo operates at 20FPS, it should be possible to store 1s of looping video in memory and be able to play it back! I just need to find the perfect idea for a 1s monochrome video loop. Any ideas?
12/16/2016 at 05:42 •
Dodo has nearly reached its final form by now having integrated batteries! The Hackaday Superconference badge gave me the inspiration I needed to finally figure out a way to mount the batteries. By mounting the battery holders sideways on either side of the board, they are unobtrusive yet still accessible. To fit, I needed to downside to AAA batteries, but I think the tradeoff is worth it.
I also now have a working boost regulator circuit on board. The previous revision (Rev 2) had the MAX756 but it didn't work. For Rev 3 I switched to the LT1303 and very carefully laid out the PCB after researching the best practices for laying out such a circuit. I also experimented with different capacitors. I am happy to report that it is running at 85% efficiency, which is as good as expected for this part.
Unfortunately, Dodo does not run for long on typical alkaline batteries. However, with Ni-MH rechargeable batteries, or with lithium batteries the life is much better. My rechargeable batteries yield a life of around 3 hours and the lithium batteries from Energizer last nearly 5 hours.
Dodo uses around 100mA at 5V. Below is the formula for the current draw from the batteries based upon the 85% efficiency. At 3v, the current draw is around 200mA. Once the batteries are nearly depleted at 2V, the current draw is nearly 300mA.
200-300mA is quite high for an alkaline battery and significantly degrades the capacity. For instance, a 750mAh alkaline battery might instead only provide 500mAh when the current is large. The voltage also falls quickly with the alkaline batteries. On the other hand, a lithium battery holds a voltage closer to 1.5V for much longer. Also, the lithium battery is able to provide a high current without losing capacity. The rechargeable batteries seem to behave similar to the lithium batteries. I therefore recommend that rechargeable batteries be used with Dodo.
The battery indicator is also working spot on. I have it tweaked to go off when the voltage reaches 2V. The LT1303 has an internal voltage comparator and the LBO pin goes low when that threshold is reached. The trip voltage is 1.24v which is too low for a pair of AAA batteries. I use a voltage divider to scale that threshold. I am using values of 255k and 412k resistors for the divider. For my rechargeable batteries, the battery indicator goes off when there is right around 10 minutes of life remaining.
Unfortunately, version 1.3 is still not right :( There is a problem with the wiring of the low battery indicator on the top board. I was able to fix it with patch wires but a new PCB will be needed. I guess the 4th try will be a charm.
11/16/2016 at 06:06 •
One of the big remaining tasks before Dodo is ready to be available as a kit is to support in-circuit flashing of the 32kb EEPROM that holds the system firmware. I want to continue to add functionality and it would be a major bummer to require everyone to pull a chip out and use a separate EEPROM burner. As of this week, Dodo now officially supports EEPROM flashing over the serial cable!
Version 1.2 of the hardware hooked up the control signals such that in theory the flashing could work, but it took software changes to make it a reality. The trickiest part is that the system code basically needs to overwrite itself which is not straightforward. I ended up creating a small standalone routine that reads from the serial port and writes to the ROM and it is embedded as a resource in the system firmware. This routine is copied into a reserved area in RAM and then executed from there so that no code is read from the ROM while its being written to.
I am pretty happy for my own sake that this now works. I have pulled the chip and reprogrammed it over 100 times during development. I can now iterate much faster when making firmware changes.
In other news, I ported a simple version of Tetris to Dodo. Here is a playable version in the playground.
11/05/2016 at 07:27 •
I will be at SuperCon tomorrow with version 1.2 of the Dodo hardware!
This new revision was a bit painful to get up and running. There were two mistakes made on the PCB, the MAX756 battery regulator doesn't have enough oomph for Dodo, and there is a mechanical clearance problem. The wires coming out the top of Dodo in the picture above are a patch to fix one of the PCB issues.
The good news is that I have found a replacement regulator that works (I have a breadboard of it), the new memory decoding scheme works and gives close to the full 32KB of RAM. And, I got to buy a logic analyzer to help troubleshooting!
With hopefully all the issues now resolved I plan to start offering kits soon on Tindie. If anyone is interested hop on over to www.dodolabs.io to get on a mailing list for updates. Also, I ported the old QBASIC classic Nibbles over to Dodo and there is a link to play it on the same page.
10/12/2016 at 03:29 •
At this point, there is only one working Dodo in existence, so not quite extinct ;-), but this needs to change! The next step in getting more Dodos out there is a new hardware revision.
For a bit of history, the version 1.0 boards had several known problems, so it never seemed worth it to make any more prototypes. There was a version 1.1 that was designed to correct the most glaring issues, but no boards were ever fabricated because a more extensive update is really what was needed. Well, the time is now! Version 1.2 boards are off for fabrication.
Here are the highlights:
- RAM Upgrade. Now all 32KB is accessible
- In place firmware updates
- Faster game flashing
- Thinner, no longer uses IDC cables between boards
- Battery powered. Will run off of 2 AA Batteries.
Above is a mockup of the new PCBs that I printed out. I have learned my lesson and will now always print these out and do some test placements of components.
The RAM upgrade opens up the possibility of adding a BASIC interpreter to Dodo. The plan is to allow 6502 Assembly, C, and BASIC as different options for game development, but all using the same API.
Dodo 1.0 supported flashing game cartridges over serial, but updating the firmware stored in the EEPROM required extracting the chip and using a dedicated programmer. The new Dodo will be able to program the EEPROM over the serial port.
The new Dodo will also have RS232 control lines connected which will enable more efficient communication that will ultimately result in faster game flashing.
Now the boards will be able to be mounted closer together, which means that the overall thickness of the device will be substantially less.
Finally the new Dodo is battery powered. Two AA batteries should last around 10 hours. There will even be a low battery indicator!
The battery circuit uses the Max756CPA+ which is able to boost the voltage of 2 AA batteries up to the 5V that Dodo needs. In the video above I am showing the test circuit I breadboarded to help fine tune the resistor values needed for the low battery indicator. The Max756 chip has an open drain low battery output pin that is driven low when a reference voltage falls below a 1.25v threshold. I wanted to show the low battery indicator when the voltage is 2v, so a voltage divider is needed to drop it down to around the threshold. In the video you see the second LED turn on as soon as the voltage falls to 2v, which is exactly what I want! The 2v is chosen based upon looking at the discharge curve of AA batteries and that is around the inflection point where the voltage really starts to tailspin.
Once I have the new boards in my hands and have assembled a few prototypes, the next step will be to make some software updates to take advantage of the new hardware features. At that point the project is basically complete. If there is interest I will make a kit available on Tindie.
10/01/2016 at 04:00 •
Last update introduced the Playground, where games can be written in simulated all from within the web browser. Now, users of Chrome will be able to flash games right from within the browser, with the help of a Chrome App. Chrome Apps have the capability of interfacing directly with hardware, such as USB, Serial, and Bluetooth. Additionally, web pages can send and receive messages with Chrome Apps if they are white-listed by the App. With those two pieces web flashing is possible!
When the playground website loads, it checks for the existence of the App and if found it reveals a flash button. The website queries the App for a list of COM ports, and then when flashing commences, it sends the App the compiled game binary that was built in the cloud and then the App sends the bytes over Serial to the real Dodo hardware. As the bytes are transmitted, progress messages are sent back so that a progress bar can be updated. Check out the video to see how it all works.
Additionally, this means that a Chromebook can be used as a complete development environment for Dodo. The only feature missing from the Playground at this point is a way to more easily save games as they are being developed. Right now, a user would have to save a unique hyperlink every time they want to 'save' to get back to where they were. The problem is that for persistent storage I probably need to introduce the concept of a logged in user as an option to the playground. Perhaps I will use Github for single sign on using OAuth2.
09/15/2016 at 05:03 •
I am back! I had to take a hiatus from working on this project for the past several months, but over the past few weeks I have been busy. My most recent advancement is a playground!
The playground is a web application that simplifies developing games for Dodo by having an IDE and Simulator that run as a hosted service. For everything developed there is a shareable link that is generated.
For instance here is a a link to the game 0xDEADBEEF
Note that it is not playable on a mobile device at the moment
The playground was a concept that I wanted to pursue since the beginning of the project. I thought it would be awesome to bring 6502 development into the cloud era. Having a Web IDE with an integrated simulator lowers the barrier to entry to get people to experiment with the project, and for my own development it seriously improves the speed at which I can iterate.
The first step was to write a simulator, which I did a while back in the language Go. The initial simulator ran as a console application. I then developed a web version that used Websockets to stream the graphics from a backend server to the client in real-time. The approach of running the simulation in the cloud worked, but it just consumed too many resources and scaling it would be difficult.
The development language for Dodo is 'C' and it is compiled using cc65. The playground works by hosting cc65 in the cloud.
Here is roughly how the whole system works:
- The code starts by requesting the firmware from the website, as well as the 'C' code associated with the particular hyperlink
- The code is then placed within the Ace editor that is running locally in the browser
- When the user clicks Run it sends the 'C' code back up to the cloud where it attempts to compile it.
- The web service returns either with the compiled game as a chunk of bytes, or an error message
- If it gets the firmware it then fires up the simulator with the game and it all runs local
With this design the heavy lifting is mostly done by the client. The server just has to compile the code. This is also scaleable.
I also made some advancements with the simulator. Because there is an easy to use Audio API in most browsers, I was able to get sound simulated fairly easily. I also pulled it into its own library so it could be embedded in other contexts.
Here are some other playground links:
Here is the repository on Github