Video working -> Thanks Fellow Freaks!

Go To Last Post
41 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would just like to drop in and say thanks to all those who offered advice during my assembly learning experience. I know a double buffered video system is not the best way to learn AVR assembly, but I always choose the hard way!

After a lot of late night learning, my video system is now generating perfect sprites, text, and can pull of 60 frames per second with over 100 sprites on the screen at once!

The system is made of nothing more than a single Mega324P with a handful of 20 cent gates. My goal is to write a few decent classic arcade conversions and then post the entire thing as an open source project.

I will post a lot more details soon, but here is a video of the unit in action...

http://www.lucidscience.com/laza...

The video capability is VGA or NTSC at 256x240 using 256 colors. Sprites are unlimited in size, number, and shape and have full transparency, collision detection and priority. Graphics capabilities are about the same as a Super Nintendo, or a C64 on steroids.

I also plan on adding another 324P to create a stereo sound option that can handle speech, wave tables and simply FM synthesis.

Again, thanks to all who humored my beginner questions. The experience was certainly worth it.

Cheers,
Brad

I Like to Build Stuff : http://www.AtomicZombie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brad, your new video system is sweet! Real sweet!!!

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Very nice, Brad. I look forward to seeing the project when you post it. Congratulations!

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nice report, Brad. Congratulations on an excellent system!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow... that's pretty cool. How long till it can do 1080p video? :wink:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are clearly insane. In a good way.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Very cool! I always love to see what these things can do when pushed to the limits.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are some, starting with a flashing led and there are some ... just creating a video system :D

Congratulations!

UC3 => You see free [to your release] :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
There are some, starting with a flashing led and there are some ... just creating a video system :D
Very well said. Impressive result, Brad

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have to go put a hat on, just so that I can take it off for you. Most impressing!

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you somehow turn that into a video monitor for AVR projects? It would be nice to be able to connect to a VGA color monitor without having to use a PC.

That would be cool! Connect my RS-232 port to your VGA board, and have text & graphics from my project being directly displayed on a VGA monitor.

I want one!!!

When do you expect a PCB to be available, as well as a completed unit for sale?

Just way cool!!!

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Damn..... You make me feel so dumb (I was impressed with my flashing LED's!!!)

Very cool, looking forward to seeing the whole project :D

Dys.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for all the positive feedback!

I added a moving background, 1 more ball sprite and a pair of cars (taken from Amiga Test-Drive)...

http://www.lucidscience.com/laza...

That pretty much fills up the code space on the 32K Mega324p.

As for a final version, I will probably get some circuit boards made and install a 40 pin socket so any of the 40 pin Megas can be used.

By dropping in your own 324 or 644, you could do anything from make arcade quality games to displaying a realtime signal on a monitor.

Lazarus consists of a 324P (sync generator), a bunch of 74HC157 switches, an AD724 RGB to NTSC converter IC, and a pair of 74HC245s. Nothing more.

The demo in the video is being generated realtime by another 324P connected to the system.

Now I am working on the multi channel sound and joystick upgrade - yet another 324p.

Cheers,
Brad

I Like to Build Stuff : http://www.AtomicZombie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It just keeps getting better Brad. Nice Job

Roger

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess while we are talking about graphics, this is a good learning moment to refresh my memory of what a sprite is and how it works... is it: an arbitrary x by y bitmap stored off screen? To display it, you must cut a hunk out of the frame buffer x by y, then blit the sprite into that loc from offscreen? Hopefully, the current frame buffer is the back frame and you dont see this happen. Now to move the sprite one or more pixels in x and/or y, you must first undraw it, then repeat above process at new loc? Man, thats a LOT of getpixel and setpixel calls in a loop.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It gets even a little more complicated than that Bob because it looks like he is also handling z-order so each sprite would basically have layer assigned to decide if it is in the front or behind overlapping sprites. Great piece of work he has done. Graphics such as this can even put a strain on a full blown desktop PC.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is that what they call 'painters algorithm'? Paint everything from the back to the front? (That might mean many things in the first deep layers get overwritten... wasted draw... slow...)

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I know a double buffered video system is not the best way to learn AVR assembly,
So, are you saying that the whole thing is written in ASM. Perhaps you may want to reply to this privately as an affirmative answer WILL KILL several people on this list :mrgreen:

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
Quote:
I know a double buffered video system is not the best way to learn AVR assembly,
So, are you saying that the whole thing is written in ASM. Perhaps you may want to reply to this privately as an affirmative answer WILL KILL several people on this list :mrgreen:

No, let him post publicly! I for one am quite interested.

Come on now John, just because I choose to program in C, that doesn't mean I can't program in assembly! I just haven't used assembly a whole lot with the AVR - but the MC6800, MC6801, MC6808, MC68HC11, HD6301, MC68701, F8, Z80, and others... Well, it's just like a "A Hand in a well fitting glove !" Though, I do admit, I'm a bit rusty. I can learn to deal with AVR assembly programming, just as I have with all of the other controllers I've used.

It will not kill me, I hope...

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To answer a few questions...

1) Yes it is pure assembly. I find ASM easier to work with. For me assembly is like a direct conversation with the hardware. C is more like a conversation through a foreign interpreter. Basic is like a conversation on a bad phone line through a drunk foreign language interpreter with a hearing problem!

Ok, all the languages have their place, but I always choose the most difficult route as it is all about the challenge. I will admit, I have never used the debugger either! Most of the time, I write the code on paper along with the schematics and then just type it all in. When you are doing video progs, your mistakes are always visible.

2) Yes, a sprite is just a block of memory at some XY location with a width and height. In the demo, the balls are 32x32 and have 255 colors plus a transparency color.

Each frame of the demo has to move ~63,700 bytes. A screen clearing operations has to blank 224x200 memory locations before any new graphics are computed. This happens 60 times a second. Drawing happens on an inactive memory bank while the SYNC AVR writes the active bank to the screen. The GPU then waits for a pin toggle from the SYNC to signal the last blank line. This way the animation is flicker free and 100% smooth.

This system is very fast due to the fact that the GPU has full control over the inactive video page due to the full address line and data line switching system. Many retro systems forced the GPU to wait while graphics memory was accessed.

Thanks,
Brad

I Like to Build Stuff : http://www.AtomicZombie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Yes it is pure assembly. I find ASM easier to work with. For me assembly is like a direct conversation with the hardware. C is more like a conversation through a foreign interpreter. Basic is like a conversation on a bad phone line through a drunk foreign language interpreter with a hearing problem!

You've just made John S's day. No, probably week. This post is in his browser's bookmarks by now.

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zbaird wrote:
Quote:
Yes it is pure assembly. I find ASM easier to work with. For me assembly is like a direct conversation with the hardware. C is more like a conversation through a foreign interpreter. Basic is like a conversation on a bad phone line through a drunk foreign language interpreter with a hearing problem!

You've just made John S's day. No, probably week. This post is in his browser's bookmarks by now.

Yes, John is probably bouncing against the six sides of his playroom, in an attempt to emulate AtomicZombie's graphics video sprites. :lol:

Can you just picture John's mug bouncing across that video screen? :roll:

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
This post is in his browser's bookmarks by now.
...along with
https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=58565&highlight=basic
Another 40K+ of pure ASM code...what joy..now I have 3 grandchildren.... :lol:

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Can you just picture John's mug bouncing across that video screen? Rolling Eyes

Your system is brilliant. It is certainly shows what can be done with small hardware.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks again! Without all the great info and expertise on this forum, I would not have been able to get very far on this project in such a short time. I am looking forward to making the final hardwired board so I can post the completed Lazarus project here. Hopefully, it will show others who are thinking about attempting an NTSC or VGA project the basics without having to weed through the massive pile of contradictory info on the web regarding the subject.

The goal was to make a powerful 8 bit game console that would use any microcontroller as a GPU (game cartridge), and the goal has been met. Drop in a basic stamp, and you could write asteroids in basic. Drop in a 644P, and you could pull off a fast 3D game with amazing quality.

The only IC that is not common logic is the AD724 (RGB to NTSC converter) but I am in the process of actually creating my own 8 bit chroma phase modulator out of gate logic to replace it. This way my system can be made with 100% DIP parts available from any supplier.

This is why I did not choose to use an FPGA or CPLD. Sure, 15 ICs could be "mopped" up by a CPLD, but then you need a dev kit and are stuck with whatever CPLD is available at the time. Also, the logic ICs are only worth ~$10, so the CPLD would actually cost more. A 100 pin TQFP is also a real pain to work with.

Hardwired version #1 will be done on a breadboard, but I will probably get some circuit boards done as well if there is enough interest.

Cheers!
Brad

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Mon. Mar 24, 2008 - 06:35 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, I'm certainly interested. Thanks for the great work!

Chuck Baird

"I wish I were dumber so I could be more certain about my opinions. It looks fun." -- Scott Adams

http://www.cbaird.org

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brad, really sweet work. If you need/want someone to layout PCBs, just drop me a line.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Speaking of PCB layout, here is prototype #1 getting a new home on some perforated board...

Once the hardwired version is working, I will begin to add all the info to my website. It will be nice to give back to this community. Hopefully there are other freaks out there who think AVRs make great high speed video generators!

I am already thinking about version #2, which will generate 640x480 and have access to 1MB of scratch RAM for sprites and data. But that idea will have to wait until I can write a few decent arcade came classics for the current version to see what improvements it might need. The DMA abilities of the XMega sure might come in handy.

Cheers,
Brad
[/img]

I Like to Build Stuff : http://www.AtomicZombie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What a lot of breadboard you have there! I just had two and I think that is much!

KISS - Keep It Simple Stupid!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looking good Brad. I have a couple of Mega2561s that are already mounted listed in the trading forum here. If you think one of them would work well for developing the games I'd be happy to donate one to the project. If you want one just PM me with a shipping address and I'll send one out.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the offer!

If only it would run at 20MHz, as that is the clock speed of the sync generator, and for best efficiency, I like to keep the external CPU at 20MHz as well. Of course, even a 6502 at 1MHz could probably pull off "Space Invaders" with this system!

If you do find a source for board mounted AVR3250s or 3290s, then I would be interested as those ZIFF sockets on the STK boards are super quirky. I spent many nights messing around before I realized you need to align all the tiny pins by hand while looking under a magnifier as the 3290/3250 usually does not line up straight. I have 3 of the 100pin ZIFF adapter boards for my STK, and they all suffer from this problem.

A 3250 on a carrier board would be great if there was a source.

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AtomicZombie wrote:

Quote:
Of course, even a 6502 at 1MHz could probably pull off "Space Invaders" with this system!

Easily. The 6502 running at 1MHz was the power behind many of Atari's first computer controlled games. IIRC Space Invaders had the lowly 8080, but had a hardware barrel shifter that improved performance somewhat.

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is a similar example which shows of a lot of video and audio effects:

https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=61752

Now, I am just waiting for someone to create videogame console with one Raven connected to the monitor, and the other being used as joystick :-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is Proto-1 with all 300 or so wires installed...

Higher res photo....
http://www.lucidscience.com/lazarus/temp/az641.3.jpg

To make life more difficult I did all the wiring on one side of the board so it would look cool when I added the circuit to a box with a clear lid.

Now to add the cartridge port, which will actually carry the Mega326/644 or whatever uC will be used to write code into.

Next photo should be a working game console playing some arcade classic straight out of a single AVR.

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now that's what I call a real work of beauty! But back in the days of old, we would have called it a real "Rats Nest !" And it would have been deliberate - but for different reasons then just looking cool. The more ruffled the wiring is, the less coupling of noise there is between the adjacent wires.

SuperFreak Lee can tell you all about those rats nests, I'm sure. But he's probably eliminated them all, with the presence of several cool cats. Meow!!!

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks!

Yep, I bet there are a few rats hiding in there someplace...

With the original breadboard system connected to the prototype, it sure looks like a mess.

Higher res...

http://www.lucidscience.com/lazarus/temp/az641.4.jpg

That massive solderless breadboard is actually 6 smaller units bolted to a baking pan. You can never have enough real estate when making a 4 bus computer.

Brad

microcarl wrote:
Now that's what I call a real work of beauty! But back in the days of old, we would have called it a real "Rats Nest !" And it would have been deliberate - but for different reasons then just looking cool. The more ruffled the wiring is, the less coupling of noise there is between the adjacent wires.

SuperFreak Lee can tell you all about those rats nests, I'm sure. But he's probably eliminated them all, with the presence of several cool cats. Meow!!!

[img][/img]

I Like to Build Stuff : http://www.AtomicZombie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

WOOOOOwwwww

Great Stuff, man...
How did you manage to solder all those wires without any mistake? :?

Man congrats, im truly impressed.
Keep up,

Rui

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks!

Just started with a huge breadboard, then copied it one wire at a time to the protoboard...

http://www.lucidscience.com/az64...

Now I am doing a version on cardboard using a printout template i made for those that like to do things on the cheap.

Entire system for less than 20 bucks!

Brad

Procopio wrote:
WOOOOOwwwww

Great Stuff, man...
How did you manage to solder all those wires without any mistake? :?

Man congrats, im truly impressed.
Keep up,

Rui

I Like to Build Stuff : http://www.AtomicZombie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

LOL I would hate to be the sucker SWAT bomb unit to have to defuse that bomb... ;)

Very nice work... If you are making this a somewhat open project I would really love to adapt the schematic to all SMD and layout a tiny version of this board. With some thinking I can probably get this down to maybe 6 inches x 4 inches cheap all SOIC.. Maybe even add in a LCD connector and controller or something... ;)

BTW I understand that the datasheet for those other lowly mega's say maximum clock is 16mhz, but because this is a breadboarded project, you could have just as well overclocked it to 20MHz without any problems, even got up to 24mhz stable @ 5.5v vcc on an Mega128 for shorter whiles... Old schoolers will tell you thats bad, but honestly, it's not like you're sending it up to production that way. :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hiya!

I was just wondering if the lazarus is still alive? I think I checked before Christmas and was able to get the videos. Now, just 404's.

Anyone? Anyone?

-Ken

:?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I was just wondering if the lazarus is still alive?

Not now, but it will be back later ;)

Actually, it was moved here. It took a little while to load for me, but it did work.

Regards,
Steve A.

The Board helps those that help themselves.