Insane Contraption

Discuss anything not related to the current Uzebox design like successors and other open source gaming hardware
Post Reply
User avatar
Jubatian
Posts: 1400
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Insane Contraption

Post by Jubatian » Fri Dec 27, 2019 3:49 pm

So at last I started building hardware. Quite an adventure, now hopefully I have something which should not have too many defects. That is, it didn't go up in smoke when applying power, and the programmer sees the chip!
PC277204.JPG
Power and Programmer attached
PC277204.JPG (170.04 KiB) Viewed 386 times
PC277206.JPG
Side view showing the mess inside
PC277206.JPG (142.09 KiB) Viewed 386 times
PC277208.JPG
It can be taken apart!
PC277208.JPG (161.81 KiB) Viewed 386 times
This for now is more or less an E-Uzebox with an ATmega1284 and a 18MHz crystal, otherwise I followed an E-Uzebox schematics with some changes applied here and there, such as notably putting Sync on a PWM capable pin.

There is more to it though, as I laid this one out with the intention of being compatible with a more elaborate plan involving a 32KBytes static RAM chip and a few latches. The novelty of that system is that it could palettize video through the RAM chip by diverting the chip's data to the video DAC, so you could OUT palette indices as addresses, allowing high-resolution 4bpp, while outside video, you could still use it as normal, as significantly faster random accessible external memory than an SPI RAM. So the overall design would be that game binaries created for this currently assembled system would run on the bigger one as well.

The 1284 has a quite crazy possibility for video coding (on this smaller system primarily) as the full address space is populated, there are high-resolution video modes which would rely on this. Next thing is that I am going to build a bootloader capable to support this (using only every second 128 word Flash page, leaving the upper halves of 256 word segments free, available for games).

Emulation is (will be) possible by porting CUzeBox to this or adding support for it, the overall mechanics are not too complex, even the bigger system having the RAM chip would do well, and notably due to the 18MHz clock, actually could perform better than Uzebox.

Otherwise next steps would be building a prototype of the bigger system, creating a bootloader, then eventually I might also design PCB for it (wow, building this prototype stuff, producing all that entangled mess of wiring is difficult!). NTSC support would be provided in a similar way to Uzebox, however the NTSC chip clocked on its own. It wouldn't really be a problem, the color clock could slightly drift, but that's all (there are other projects out there using this solution).

Source compatibility with Uzebox migth be possible to some degree. At least I figured out how I could sort of get Mode 3 on this thing, with some limitations, but maybe I could eventually create a kernel which provides an interface sufficiently similar to Uzebox Mode 3 for making it easier to realize a game which could be compiled for both.

Anyway, still quite a way to go to get there, first to see whether this thing ends up blowing up something else than itself and so on :P

User avatar
Jubatian
Posts: 1400
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Insane Contraption

Post by Jubatian » Sat Dec 28, 2019 8:01 pm

Anyone any weird idea on how to get a bootloader on a 1284 with USBTinyISP?

I spent a few hours to end up figuring out that I have the problem that the USBTinyISP can not program above 64K (thankfully I didn't end up tearing the prototype apart to "fix" the problem, I just spent the time meticulously verifying that every connection everywhere is correct). So I ran into this problem described here on an Arduino forum.

Right now it seems like I am stuck with 64K (which I checked, I can indeed upload stuff fine to this prototype as long as it is below 64K), and no bootloader. SPM as far as I understand the datasheet is only available in the bootloader area, so as of now, with the existing tools, it seems like I can not create some code which would write a bootloader into its intended location.

The programmer is Pocket AVR programmer, which seems to be programmable itself using an ISP header, but that would need another programmer. One possibility of course given that I have a bunch of ATmegas and random components to build things is building my own programmer :P Still, maybe I will rather buy one later that case (or pick up a smaller AVR and DIY one, hurling a 44 pin ATmega644 at the task feels pretty much an overkill).

Anyway, it is good enough for now to do random prototyping and experimenting, but if you have any idea on how to get around this (any tricky AVR code does, just keep in mind that the Flash is erased, so bootloader area is all 0xFF, no random SPM instruction there to hijack) without shopping anything (or DIY-ing a programmer), it is welcomed! :D

CunningFellow
Posts: 1190
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Insane Contraption

Post by CunningFellow » Sat Dec 28, 2019 9:39 pm

If you have a parallel port

http://www.lancos.com/prog.html

Most modern motherboards STILL do have a parallel port - it is just as a 26 pin header on the board and not broken out to a DB25 on the backplane.

User avatar
Jubatian
Posts: 1400
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Insane Contraption

Post by Jubatian » Sun Dec 29, 2019 4:52 pm

CunningFellow wrote:
Sat Dec 28, 2019 9:39 pm
If you have a parallel port

http://www.lancos.com/prog.html

Most modern motherboards STILL do have a parallel port - it is just as a 26 pin header on the board and not broken out to a DB25 on the backplane.
Eh, I hoped for some dirty trick making an empty ROM somehow still appear as an SPM instruction for something loaded in the low half :D Nice, but it still needs a couple of parts I don't have at the moment (nor did I dig into my PC yet to see if there was a parallel port somewhere). Anyway, will see later.

For now I managed to produce proper sync, and it is displaying stuff.
PC297212.JPG
First display test
PC297212.JPG (128.26 KiB) Viewed 361 times
Doing sync using PWM is a lot easier! It only needs properly setting up the timer doing it, with a few reprogramming from interrupt to produce the VSync waveform, but nothing timing sensitive there (it would even swallow 500 clocks interrupt disable periods just fine, thanks to the buffered OCR1A & OCR1B registers). The display would be just a cycle through the 256 colors, same palette as Uzebox (intentionally), the camera didn't manage to capture it very well (especially the green ramp), but I see here that everything looks like it should. So slowly it is ongoing, first likely focusing on bootloader related things.

User avatar
nicksen782
Posts: 677
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: Insane Contraption

Post by nicksen782 » Thu Jan 02, 2020 4:16 pm

This is exciting! I look forward to seeing more.

User avatar
Jubatian
Posts: 1400
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Insane Contraption

Post by Jubatian » Sun Jan 12, 2020 12:42 am

Today I managed to complete (well, mostly) the hardware of IC32, the system with the 32K SRAM, powered it up, successfully uploaded some stuff to the ATmega.
P1127218_sm.JPG
IC32 powered up
P1127218_sm.JPG (176.47 KiB) Viewed 248 times
P1127220_sm.JPG
IC32 Bottom
P1127220_sm.JPG (186.25 KiB) Viewed 248 times
Actual software is still quite some way to go, but the hardware is hopefully ready now! (I still didn't connect the Audio, I would like to look at something in that regard on the other HW first, but compared to all the rest, it is just a few wires and done)

There are two octal latches, an octal buffer, and the 32K SRAM in this system apart from the ATmega1284, still hoping that all these are OK, I made sure wirings are all fine (things which should be connected are connected, and what shouldn't isn't), at least as far as my intentions went. No smoke, which is a good sign. Will see what I can get out of it otherwise!

Sure will take quite some time, but hopefully eventually I will get there.

User avatar
Jubatian
Posts: 1400
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Insane Contraption

Post by Jubatian » Sun Jan 19, 2020 10:39 pm

The adventure continues, now also using the 32K SRAM system. I sorted out the differences, now I have code (including video mode) which is running on both. So one further step forth.
IC32_test.jpg
A bit of bootloader graphics
IC32_test.jpg (237.5 KiB) Viewed 153 times
There is quite some clutter on my desk :P The metal box below the TV is an actual E-Uzebox (with an SPI RAM extension), then by the multimeter there is the simple system which I first posted, and the 32K SRAM one is displaying the graphics. The initialization code works by setting up the SRAM and then the latches / bus buffer proper for hiding them, as if it was the smaller system without these components. So this way the code runs on both, games designed for the small system would also run on the larger one.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests