Atxmega NEW powerkill CONSOLE

Discuss anything not related to the current Uzebox design like successors and other open source gaming hardware
User avatar
mast3rbug
Posts: 81
Joined: Sat Jan 08, 2011 8:15 am

Atxmega NEW powerkill CONSOLE

Post by mast3rbug »

Hi all.

Okey, this topic was old. I didn't know if I should start a new thread or not, so I have started a new thread here, and also a continuity here:
(Also for those that don't know me)

http://uzebox.org/forums/viewtopic.php?f=10&t=1108

I will reveal you something I have found by myself that I think was never seen before. I think it's simply the first time it's done. (Some kind of new world record?? Anyway...)

Since I work on electronic project about just on winter( in the summer, I fly helicopters instead... and of course, other outside things), I started to play with the Atxmega again. I love this MCU. What I wanted was a console with a lot of power, So, I started to look at ARM without any success with the development plateform. After thinking about some things for about a week, I had an Idea. The Atxmega have a lot of counters and PWM output. The Idea I had was to use all these counters to do an automatic 8 bits counter from the ATXMEGA to 8 outside pins without MCU intervention. The counter have to count from 0 to 255, this way, eventually we can use this counter to stream the DATA from an external RAM to the Monitor without MCU intervention. After 2 more weeks of works tweaking with counters, it finally works! I have managed to have 8 MCU pins to count automatically from 0 to 255.

I tested that with 8 leds on my breadboard. But since the external RAM is SMT and I know that a breadboard is really bad for external BUS transfer, I had to make a real prototype on a real PCB. I started last week to design a first console prototype as proof of concept. I now have finished the schematic and board routing. All I have to do now is making the board, solder the parts and start writing some test code. Here is a 3d picture of the First final prototype Console:
ATXMEGAconsole.jpg
ATXMEGAconsole.jpg (201.5 KiB) Viewed 15420 times
Ok, All SMT. But we don't have choice if we want something more powewrfull. and it's only 3 chips, not that hard to solder. And if the project works, we will have something really SOLID!

By solid, I mean that:

-Dual Page RAM buffer, 256x256 with 256 colors.
-Real RAM Video mapping, no more sprites needed. You have full control of all the DOTS in Video space.
-Horizontal and Vertical FAST scrolling. (As fast as sonic game! Really, no joke!)
-Easy to compose music .MOD with 4 Channels High resolution Audio + 2 Channels for game sound effects. (I already proven that with only 1 MHZ CPU left after all video generation... Imagine with 42 MHZ)
-And a lot lot more.

Why lot?

Because with the MCU that not need to stream the VIDEO to the VGA, you have 99% of free time to process your game. YES, 99% of free CPU time. At 42 MHZ it's a lot of power. You can even do some modest 3D graphics at this speed.

Do you remember all the demoscene made on the Commodore 64 and even Amiga, This will be possible to do that kind of stuff with this console.

here is a link to a youtube Video of a demoscene on a C64 to show you what can be possible with this console (Of course with better sound and better video)





So, This console remain Minimalist with only 3 IC, and still use AVR studio and AVR GCC (WINAVR). No need to learn a new language. I don't know how many people have an interest in this project, but I think it's the perfect alternative for a NEW challenging console. Of course, if people are interested in this project, all the Schematics and source code will be available for free. I can even start a batch of Manufactured PCB and provide The board with all parts at COST if I found enough interest in it.

Something is sure, I will push this console and I will code on it.

But for now, I must wait to the weekend to make my prototype board and I cross my fingers... I hope that all the things on paper will work in the real world. (But I can't see any reason for this project to fail) I will keep you informed, and let me know all about your interest in this wonderful project.

UZE: I will need you help, approbation and support on this for sure! I think this is what you tried to accomplished for some times and me too!

Mast3rbug.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Atxmega NEW powerkill CONSOLE

Post by uze6666 »

Hi mast3rbug,

Great work and very interesting devlopment. I have a couple questions. What devices exactly are you using? Look like a tqfp64 and I though only 100pins parts had the external bus interface? Also how is the multiplexing of video rendering by the timers goes with concurrent read/write by the cpu? I guess the main program will have to wait for hsync or vsync to write to the external RAM? Or you intend to use dual ported ram (though at 80$ for 128K I doubt it!). I'd like to know a bit more on the Is automatic 8 bit port counter..i.e.: why all counters are required, could the event system be used, etc? I guess the RAMs lower address lines are updated with the counter and higher lines "manually" during hsync? Finally what type of game controller did you intend to use?

I don't think I had seen this technique on mcus before so kudos for the idea. I order to lower bus contention, dual port RAM would be the best, though I never saw one priced reasonably.
UZE: I will need you help, approbation and support on this for sure! I think this is what you tried to accomplished for some times and me too!
Ahh my friend, you have my benediction! Though I'm not so sure I'm just ready to embark onto such an endeavor...the Uzebox already consumed 8 years of my spare time! But, it's temping thought I feel it will need more work on feature vs. power vs. simplicity balance side of things to make it really attractive. What's the real value proposition vs. what already around or have been done. Who's the target public? An all SMT console would also mean fully assembled for most, then requiring en enclosure, etc. With the Ouya coming soon, being much more powerful...I have a strong feeling of deja vu with this subject... ;) If you're still in the region of Montreal, perhaps we could go discuss that one of these days around a pint of beer! 8-)
User avatar
mast3rbug
Posts: 81
Joined: Sat Jan 08, 2011 8:15 am

Re: Atxmega NEW powerkill CONSOLE

Post by mast3rbug »

What devices exactly are you using? Look like a tqfp64 and I though only 100pins parts had the external bus interface?
I use a TQFP64, the ATXMEGA256A3U. This device doesn't have a bus interface. But anyway, the bus interface of the Atxmega is too slow for this purpose, and it's impossible to scan by counters in External memory mode. The external memory is simply mapped on normal ports. This way, we can even increment 8 Bit address bus each cycle without CPU intervention. the 10 nS external RAM will do the rest. (By the way, for 256 pixel, we only need to clock the RAM at 1 pixel each 4 cycles). All that we have to do at start of each line is generate the Hsynch, call the routine that reset Synchronise and start the counter, Enable the 573 buffer and GO! you can quit the interrupt (Or do a normal program that will generate all the sound stuff and doing all that during the scan line). The counter will increment one block of 8 bit address of the RAM automatically, and the I/O lines are routed to the 573, that is the direct output to the 8 BIT resistors for RGB signal. The programmation will be so simplified this way. At the end of each line, another interrupt is generated to Stop the counter, put all 0 on the 573 and Lock it for all the blank phase.

Also how is the multiplexing of video rendering by the timers goes with concurrent read/write by the cpu? I guess the main program will have to wait for hsync or vsync to write to the external RAM?
Exactely, the Video RAM is accessible by a 8 bit port on the Xmega, to read or write only during blanking time. You can also do special trick like on the C64 with the borders, since you can lock the 573 in any color, not just Black, and play with the synch to generate bouncing bars out of the screen with minimal CPU intervention.
Or you intend to use dual ported ram (though at 80$ for 128K I doubt it!).

Hehe no. The aim is to keep it minimalistic and low cost. I use normal RAM at 5-7$. at 42 MHZ With the initial tests I have done, I think there is enough blanking time for the CPU to read and write to the Video RAM. And your main program doesn't have to deal with waiting for Vsynch, the interrupt will manage it. If an External ram transfer was already initialized, the Interrupt routine will simply do all his music stuff, and at the end, will not return. Will simply wait for the end of the line before returning to the main program each scan line until the Main program finish the work with the video ram. Also, you don't have to work the graphics in the Video RAM, you can prepare complexe graphics and calculation from the internal FLASH and 16K ram during the 99% free CPU time, and output to the Video RAM when it's ready to display. You can send all the chunks of ready graphics in the second video buffer, and when all the graphics are ready, just switch bank.


I'd like to know a bit more on the Is automatic 8 bit port counter..i.e.: why all counters are required, could the event system be used, etc? I guess the RAMs lower address lines are updated with the counter and higher lines "manually" during hsync?
8 counters are required to generate the 8 bit Lower address thats right. these counter are compared with PWM and synchronised to Start at the same time, and each counter have a PWM speed twice slower than the previous. This way, you create a binary external counter from 0 to 255. And yes, you have to manually increment the other adressing each scan line. And depend on where you start the horizontal and vertical scan, you can create Horz and Vert scrooling. (if you start the counter at 127, it will roll to 255, and reset to 0, it will terminate at the end of the screen at 126. Anyway, you get the Idea... You only have to write one vertical line of graphics at last right display address to overlap the current ZONE to create a scroll scene).

I tried some kind of stuff with the Event system, and I didn't find a way to use it to generate a 8 bit external counter. Maybe it's doable, but I didn't find a way.
Finally what type of game controller did you intend to use?
The actual one could be fine. I have a question on that. Where do you get your Snes connectors? I seems to be a black art magic to fine some company that have some for sale... Is it a rare item? I found new controllers at low price on ebay, but no controllers. For the moment, I will use the connector from an old Dance revolution dance mat I have here. (By the way the Controller port is the one at the left, and the MCU have 0 free ports. I have to share an I/O line for the second player DATA, and also the SD card will have to be accessed software, all the 4 SPI ports are used for the counters, mapped on the same pins)

But, it's temping thought I feel it will need more work on feature vs. power vs. simplicity balance side of things to make it really attractive. What's the real value proposition vs. what already around or have been done. Who's the target public? An all SMT console would also mean fully assembled for most, then requiring en enclosure, etc
You can be surprised how It's easy to program something without sprites, and without the constraint of working critical routines ON the scan line. The target public is the actual one I think, I know that some are more advanced and sure want to made more complex things that is impossible to do with a Tile based Graphics. Anyway I will see if peoples are interested or not, The first reason I make this project is for me, but if it can serve other person in the hobby, why not. Also for soldering, Maybe I can send the boards with the 3 chips pre-soldered, and the rest of parts I can design it through hole for the purpose. I don't think that the community will be too big, maybe 9 or 10 person will be interested in this for the beginning?
With the Ouya coming soon, being much more powerful...I have a strong feeling of deja vu with this subject...
Personally, I feel that for me and for peoples here, This is not what we like to do. This is more a kind of coding a game on a PC with a lot of resource. This console have 1 GIG ram and 8 GIG flash, and run Android. Do we have someone here coding in the android? I don't think. There is no real feeling like the actual to code on something made for that purpose. It's like developing on an Android tablet.
If you're still in the region of Montreal, perhaps we could go discuss that one of these days around a pint of beer!
Ya could be great! But I don't live in Montreal, I'm at Saguenay (Chicoutimi). I goes to Montreal only 1 time in my life. (More to Quebec, It's about 2 hours. But Montreal is 6 hours...) But we can talk by MSN or Skype one time if you want. (PS, I don't speak english, only write, but I guess you talk french too.. By the way, what is your primary language? english or french?)


Also, I think that with minimal effort, all the call routines to the UZEBOX ca be rewritten easily in this console to emulate routines. It will need a re-compilation of the software, but it should work identical to the original. I didn't saw any game that move too fast to be impossible to emulate without sprite and only direct memory mapping. You remember my first console with Mario bros and frogger... When I was done with the Video synch, I didn't have to work hard to incorporate the sprites on scanlines, all was done in the main routine with copy/past of memory zones. much more easy this way. and since the scan was made with the MCU, I had only 3-4 MHZ free. And I was able to manipulate almost 1/2 of the screen at 20-30 FPS. Imagine at 42 MHZ.



Ok enough for now . Bye!
User avatar
mast3rbug
Posts: 81
Joined: Sat Jan 08, 2011 8:15 am

Re: Atxmega NEW powerkill CONSOLE

Post by mast3rbug »

Hi All.

I just finished the PCB making and part assembly yesterday. I'm debugging/making some code right now. Here some pictures of it.

I use the new ATXMEGA USB version and I made some overclocking tests, the old version without USB was stable at 42 MHZ, but this one still stable at 64 MHZ with the PLL at the maximum! Quite impressive.



This is the board under UV
Exposure2.jpg
Exposure2.jpg (85.09 KiB) Viewed 15183 times
a zoom of it.
Exposure1.jpg
Exposure1.jpg (128.63 KiB) Viewed 15193 times
And the final console prototype assembled.
console.jpg
console.jpg (279.55 KiB) Viewed 15221 times
Go for some programming now.

Mast3rbug
User avatar
mast3rbug
Posts: 81
Joined: Sat Jan 08, 2011 8:15 am

Re: Atxmega NEW powerkill CONSOLE

Post by mast3rbug »

Ok. Here result of the console test;

The video generation by the external RAM works fine in direct addressing. No problem here. But when trying to address it automatically with the counters, there is a problem. It looks like the counters are not nanosecond aligned (Looks perfect on the scope, but My scope is old), probably due to internal design difference between some counters. (Maybe some buffer added for pins fonction for other peripherals).

Here is the picture generated by the counter without CPU intervention:
tomjerry_Glitch800x600.jpg
tomjerry_Glitch800x600.jpg (233.76 KiB) Viewed 15104 times

Anyway, My console is made, and still works with the direct CPU intervention. And Since I discovered that this Atxmega is stable at 72 MHZ(I'm surprised how this can be over-clocked so much!), The result will be the same.

I will post my first Demo Soon.

Mast3rbug
greenpower
Posts: 62
Joined: Mon Jun 13, 2011 7:48 pm
Location: Benidorm, Spain

Re: Atxmega NEW powerkill CONSOLE

Post by greenpower »

Dude, overclockin' it's your middle name! 72-32 = 40 Mhz of difference! DO NOT STOP WORKING!
BTW, what resolution are you going to use in the final design? Because having a clock of 72 Mhz gives a pantagruelic resolution with the VGA standard.
Have fun while developing!
I know i'm too young, but it doesn't matters. Maybe i'm a newbie, but i can learn very fastly
Tinctu
Posts: 65
Joined: Sun Aug 31, 2008 2:22 pm

Re: Atxmega NEW powerkill CONSOLE

Post by Tinctu »

Very cool!
As MOD/XM musician I am interested in.
How big MODs will be able it play???
I was composing very small MODs for GBA.
So if you need musician for your games, projects let me know.

BTW how much it will cost???
Maybe I will buy 2x of them.
As home mod players or pixelart toys...

256x256x256 great! So games will looks like NES on steroids.
Or like on my fav AMIGA 600!

Send me email...
tinctu#gmail
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Atxmega NEW powerkill CONSOLE

Post by uze6666 »

Great progress! Those artifacts are very annoying as your solution seemed quite promising. But again at 72Mhz(!) , bitbanging the port should be no big deal.
Ya could be great! But I don't live in Montreal, I'm at Saguenay (Chicoutimi). I goes to Montreal only 1 time in my life. (More to Quebec, It's about 2 hours. But Montreal is 6 hours...) But we can talk by MSN or Skype one time if you want. (PS, I don't speak english, only write, but I guess you talk french too.. By the way, what is your primary language? english or french?)
Got some friend there in Chicoutimi...a good 5-6 hours drive from montreal, I can understand you don't come here often! And yep, I'm french too. :)
User avatar
mast3rbug
Posts: 81
Joined: Sat Jan 08, 2011 8:15 am

Re: Atxmega NEW powerkill CONSOLE

Post by mast3rbug »

Very cool!
As MOD/XM musician I am interested in.
How big MODs will be able it play???
I was composing very small MODs for GBA.
So if you need musician for your games, projects let me know.

BTW how much it will cost???
Maybe I will buy 2x of them.
As home mod players or pixelart toys...

256x256x256 great! So games will looks like NES on steroids.
Or like on my fav AMIGA 600!

If you want it only for the .MOD player, you don't need the console. You simply need an Atxmega with VCC and GND. The audio is output by the DAC port with 2 capacitors for filtering.

In theory, it can play .MOD of about 220K. But for the console I limited it to the Upper 128K

Here a list of the Cost for a single unit:
RAM 128K 10 nS: $5.83
573 Latch: $0.49
Capacitors: $0.90
Crystal: $0.56
Atxmega256: $7.36
Audio Connector $1.20
DB15 Connector: $1.80
Resistors and all decoupling capacitors about $2

The PCB will cost about 14$ each unit made in china, for QTY: 12

Ok this is the bare minimum, this not include Joystick connector. For a total of:
wow 35$. You can add 3$ for SD card connector.

Mast3rbug
Tinctu
Posts: 65
Joined: Sun Aug 31, 2008 2:22 pm

Re: Atxmega NEW powerkill CONSOLE

Post by Tinctu »

Nice 38USD - 40USD very good price.
Will you sell programed and build-up product with programed xmaga (in future)?
I have no xmega prog...

Well 220kb or 128kb. I was composing 15kb modules on GBA.
It was hardcore optimisation.

Why? I want to have full game console with SD card and loading menu on monitor
and plays some homebrew games and MODs on it.

I am from EU. I have PAY-PAL.
How much will postage cost from CAN to EU?
Post Reply