Atxmega UZEBOX compatible without AD725

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 UZEBOX compatible without AD725

Post by mast3rbug »

Hi.

The UZEBOX project is really nice. I could not imagine that there was enough peoples with enough interest to build a large enough community to be fun and constructive, with a wiki, a forum, a lot of games, ect...
Congratulation to all UZEBOX contributors and programmers.

It's my first post here in the UZEBOX community. Maybe some already know me for my projects on YOUTUBE other don't. UZE666 know me a little, but not more.


So first, I will introduce myself.

My name is Cedric, and I love microcontrollers and hardware programming. I have done a lot of stuff and I have a solid experience in microcontrollers. I'm also known for my famous RGB virtual clock. (Link here: http://www.youtube.com/watch?v=l4F8UbM-1t4 )

In the past (A little before the UZEBOX project) I made my own video game console.
here a picture of it:
console1.JPG
console1.JPG (30.4 KiB) Viewed 11054 times


The design is a little more complicated than the UZEBOX because it have 128k RAM and is memory mapped instead of Tile maped.

Links here: http://www.youtube.com/watch?v=SmvFiUMfgZw
and here: http://www.youtube.com/watch?v=RYyAlQygg-k

Ok for presentation, nowLet's talk about the principal subject...


Since the atXmega is now wide available, I wanted for long time to try to generate Video with this fast MCU. So, this weekend, I have adapted my video game console code to run on an atXmega.

I have made a lot of overclocking tests with the Xmega, I know that it can run stable at 42.9546 MHZ(14 times the 3.58 Mhz color burst frequency) without problem.

Here a video of a test I made, it play a video in 65k colors in DMA (Yes the new functions available in the Xmega series, really Cool), on an 128x128 Oled screen, overclocked to 44 MHZ without any trouble

Link here: http://www.youtube.com/watch?v=LC7Ql95Xm1k (I know the quality is not really good...)

Anyway, I have ported my code and adjusted all the precise video synch to work with the Xmega at 42.9546 Mhz. I first wanted to use the integrated DAC port inside the Xmega to generate video directly with this pin, no external parts needed. It worked nicely, in black and white only. The DAC is not fast enough to do the 3.58 MHZ burst.

So I ended with a different approach... Simply using R2R resistor network to drive the signal. After all, it's only a few more resistors, and all peoples are able to solder them, and cost under 50 cent for the complete R2r DAC port...

It worked really nicely. Here is a picture of the first color signal entirely generated software and interrupt driven:
First color video generation
First color video generation
Color_Bars1.jpg (63.21 KiB) Viewed 11059 times
Here is the little schematic of the setup for the video generation:
Schematic
Schematic
Scherma.JPG (221.11 KiB) Viewed 11054 times
So, what I believe, is that is possible to adapt the video/audio drivers, to be compatible at the same time with the actual UZEBOX games(only need to recompile the source code with the new Xmega drivers) and having at the same time the new features only available to the Xmega MCU like the DMA, the 16kbyte RAM, 256k Flash, DMA access ect...

So now the first think I will do, is finishing my interrupt routine with memory mapped Pixels, and I will update this post.
I don't know if it will be realisable, I will know it when I will have completed my video routine and displayed some graphics...

See ya!

best regards, Mast3rbug.
User avatar
TonyD
Posts: 134
Joined: Mon Oct 27, 2008 2:23 pm
Location: Newcastle, UK
Contact:

Re: Atxmega UZEBOX compatible without AD725

Post by TonyD »

Mast3rbug

Great first post :D

The Xmegas are currently being discussed in the following threads:

viewtopic.php?f=4&t=792

viewtopic.php?f=4&t=808
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Atxmega UZEBOX compatible without AD725

Post by uze6666 »

Hey Mast3rbug, welcome to the Uzebox forums!

For all here, Cedric managed to do a full color Atmega console almost two years before the Uzebox and that's no small feat. When working on the Uzebox I saw his video and it was a great motivation to see that a color game console could be possible on the AVR. Since I'm at work, I'll take more time to review and answer his post later tonight. This is awesome though and if we could combine our efforts on the XMega front, I'm convinced great things will come out!

EDIT: Thanks for posting the schematic. I'm amazed at the low-part count required to generate color! Looking at it, I have some quick questions. Why use a 14.3Mhz instead of the base 3.59Mhz if you can use the clock multiplier? That would give a more granular way to overclock the mcu, or even "downclock" to a frequency closer to the 32Mhz spec in case it runs unstable (though I'm pleased to learn it's stable at 42.9Mhz). The ATMega644 was also overclockable by 30%, but the Atmega1284P was not at all.

In a nutshell how is the color modulation done in your code right now and what horizontal resolution is attainable? I can see a 6-bit DAC on which everything will come out at once. On my side I was looking at a video interface with Y and C on separate outputs and summed together at the output. Obviously, that's if I can perform some wizardry with the DMA/event system...which is, well, far from done. :)

Finally, I see you use an A3 familly chip which does not have the external bus interface. I'm still devided if a Xmega Uzebox should use it or not. Comments?

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

Re: Atxmega UZEBOX compatible without AD725

Post by mast3rbug »

Hi UZE.

Why use a 14.3Mhz instead of the base 3.59Mhz if you can use the clock multiplier?

Simply because I don't find my only one 3.58 MHZ crystal here... I will add some in my next digikey order...

In a nutshell how is the color modulation done in your code right now and what horizontal resolution is attainable? I can see a 6-bit DAC on which everything will come out at once. On my side I was looking at a video interface with Y and C on separate outputs and summed together at the output. Obviously, that's if I can perform some wizardry with the DMA/event system...which is, well, far from done

Right now, the code is done simply with two constant, (BurstHi, BurstLow) and I output them directly with the OUT command to the 6 bit DAC. But it was on my first test. I was so happy to see color on the screen generated only software!

But after some testing, I think this method is good only to maybe, 80 pixel resolution and spaces between each pixel... too much manipulation to do in the realtime process...

So, what I am trying now is that (It's like what you are trying with separate Y and C):

The atxmega have a lot of counters... 8 different counters, with 4 output for some of these... I use 4 counters for the phase, Each counter is started with 1 cycle of difference between each and all the 4 counter have his inverted equivalent... So 8 in total. All will be output and mixed together with a 4 bit DAC (For Y). In the interrupt routine, all we have to do is put the PIN in INPUT to disable the signal, and in OUTPUT to enable it, without stopping the counter to count... This way, we have all the phases needed to make colors without having to generate them manually to get the 3.58 mhz clock. Simply, we enable the output, and we disable the output. For another color, just enable another counter output. So 4 counter with equivalent inverted= 8 possibility, for each possibility 16 level of luminance, 8x16=128 colors. Not bad for something software... I have only tested with one counter for now, I can confirm that it works... (No color for now, I have another problem to solve, but on the scope, it's fine).


Finally, I see you use an A3 familly chip which does not have the external bus interface. I'm still devided if a Xmega Uzebox should use it or not. Comments?

The Atxmega256A3 and the Atxmega192A3 are the only one available at digikey with 16k of RAM and DMA. I think DMA is more important than external memory for the moment... I think with the DMA we can have a sound routine 4 voice with drums and percussion, at 22 khz real time in game... the 256K flash is enough to do some nice ingame song...

UPDATE: I managed to make the color work with the Timers output. I have a little problem with my interrupt routine, Causing the Color burst to not phase correctly. I will rewrite it from start, too much patch here and there...


Mast3rbug.
User avatar
paul
Posts: 457
Joined: Sat May 02, 2009 8:41 am
Location: Brisbane, Australia

Re: Atxmega UZEBOX compatible without AD725

Post by paul »

Great, this could lead to some exciting developments!

And thanks to that youtube link, I know what to get for a few techie friends/relatives for next xmas :ugeek:
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Atxmega UZEBOX compatible without AD725

Post by uze6666 »

I'd like to experiment with the Atxmega256A3 but I'd also like to prototype in wire wrap. I'm looking for a breakout board similar to Spakfun's one but can't seem to find a tqfp board with a .8 mm pitch. Anyone here knows were I could buy one in Canada? Digikey has some but they don't seem to have the good pitch (plus they are listed in mil intead of mm :? )...

Thanks!

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

Re: Atxmega UZEBOX compatible without AD725

Post by mast3rbug »

I do my own boards with UV and Ferric Chloride. A kit is under 100$ with all the kit, including the UV lamp.

It'as easy, even fine pitch double sided boards. It's better and faster than wire wrap. I can give you some advide if you want.

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

Re: Atxmega UZEBOX compatible without AD725

Post by uze6666 »

Etched board...aaah, last time I did those, I was in college...I could give it another spin. Got some pointers or tutorial somewhere to get started? What and where to buy would also help (ie Digikey).

What I like about wire-wrap is that when you don't know exactly how the circuit will end up and will do many simple reroutings, personnaly it ends up being more quick than making some new board or cutting traces and soldering jumpers.

Thanks!

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

Re: Atxmega UZEBOX compatible without AD725

Post by mast3rbug »

Yeah I know with wirewrap you can build step by step, but instead, I do some sections on my breadboard, and when ready I make a board. There is some things not working on wirewrap, like external memory on an Atmega... Too much problem with crosstalk between Data Lines on the Memory chip.



I bought my kit here in a local shop, but you can have a better price at active electronic.

Also, I think in Montreal, you have active electronic stores. So you can buy directly!

Ferric Chlorid:
http://www.active123.com/eng/storeSecti ... orylevel2=

Positive Photo resist:
http://www.active123.com/eng/storeSecti ... orylevel2=

Exposure kit:
http://www.active123.com/eng/storeSecti ... orylevel2=

SINGLE SIDED COPPER CLAD BOARD PRESENSITIZED - 1/32 in
http://www.active123.com/eng/storeSecti ... orylevel2=

OR depend if you have more complex boards:

DOUBLE SIDED COPPER CLAD BOARD PRESENSITIZED - 1/32 in
http://www.active123.com/eng/storeSecti ... orylevel2=

That's it! With this equipment, I can do ultra fine pitch double sided without problem (8 mil (0.21 mm)trace, 8 mil space).


For the tutorial, here is a link:
http://www.youritronics.com/diy-printed ... ng-method/

But if you are decided to purchase the kit, I can give you my advice and my method. It's easier and better than the tutorial.

Mast3rbug.
HardlyUnique
Posts: 65
Joined: Tue Dec 08, 2009 7:44 pm

Re: Atxmega UZEBOX compatible without AD725

Post by HardlyUnique »

uze6666 wrote:I'd like to experiment with the Atxmega256A3 but I'd also like to prototype in wire wrap. I'm looking for a breakout board similar to Spakfun's one but can't seem to find a tqfp board with a .8 mm pitch. Anyone here knows were I could buy one in Canada? Digikey has some but they don't seem to have the good pitch (plus they are listed in mil intead of mm :? )...

Thanks!

Uze
I know that I'm ages late in responding to this but for what it's worth, I've recently discovered that you can get proto / breakout boards at eBay for dirt-cheap and I've been geeking-out ever since. :P

I've also been kicking myself for not realizing this at least a year ago. :|
Post Reply