Page 1 of 9

Uzebox Quick Start

Posted: Wed Nov 26, 2008 5:36 pm
by uze6666
Welcome to the Uzebox(tm) forums! The place to share thoughts, ideas and knowledge about building retro games.

So you may ask, what is the Uzebox exactly? Well, the Uzebox is a retro-minimalist, open source game console. It is based on an AVR 8-bit general purpose microcontroller made by Atmel. The particularity of the system is that it's based on an interrupt driven kernel and has no frame buffer. Functions such as video sync generation, tile rendering and music mixing is done realtime by a background task so games can easily be developed in C. The design goal was to be as simple as possible yet have good enough sound and graphics while leaving enough resources to implement interesting games. Emphasis was put on making it easy and fun to assemble and/or program for most hobbyists. The final design contains only two chips: an ATmega644 and an AD725 RGB-to-NTSC converter.

The Uzebox platform is evolving since its inception in August 2008. We've defined a standard platform with a specific minimum feature set so games written on any version or clone will work with each other. The current 'official' spec is:
  • ATmega644 microcontroller (4K RAM, 64K Flash)
  • Frequency: 28.61616Mhz
  • Video standard: NTSC (For PAL support see this topic)
  • Controllers interface: SNES
  • SD/MicroSD or MMC card interface
Since the Uzebox is an open platform (only the name is reserved) , anybody can build one or even make clones and sell them. Right now there's two products out there you can buy! Both are 100% compatible with the reference design.
  • The Uzebox 'Gamer Edition' made by Embedded Engineering LLC. It's a fully assembled board with a reusable AVCore module (basically a complete Uzebox on a 40-pins DIP footprint!). It's currently available direct from them here and through Sparkfun Electronics.
  • The Fuzebox made by Adafruit industries. It's a kit that you assemble yourself! Complete with a PCB (the surface mount video chip is even conveniently pre-soldered), case, power supply and SNES controller. Very fun to assemble! You can buy it here!
Hope you enjoy! :mrgreen:

Cheers,

Uze


Official Site
http://belogic.com/uzebox

API Documentation
http://uzebox.org/wiki/index.php?title=API_Functions

Source Code (Hosted at Google Code)
http://code.google.com/p/uzebox

Video Showcase
[youtube]http://www.youtube.com/watch?v=oHKiBjiAg8o[/youtube] [youtube]http://www.youtube.com/watch?v=0u1Q3kpV1B0[/youtube]

Re: Uzebox Quick Start

Posted: Fri Sep 23, 2011 2:25 pm
by derek21
hello, first of all i am very new with uc and i don t use "c language" or" win avr "or "avr studio" i only know a lil of bascom.
I am waiting the parts and pcb to arrive and i don t know how to program the atmega 644p and the sd card. I am sorry i know you talk already about this but i really don t understand :)
Can you pls put the hex for the atm 644p and everithing else for it?
i know that are exposed but i don t know what to put in flash and what to put in sram....is very confused for me. English is not my first language.
1. Is ok to work only with avr studio to put the hex and the other part in sram for the atmega 644p without GNU or other softaware? i didn t work before but i think is better this way...i just want to put the hex directly cause is easy this way without "c file"
and i don t know how to select to fuse in generall and for 28,636 mhz externall oscilator.(i saw in forums 2 print screens different of how to set fuses)

2. what software i use to put the games on sd card?
Pls excuse me if i put stupid questions but for me is very important and i will apreciate if u help me:)

thank you in advance!

Re: Uzebox Quick Start

Posted: Fri Sep 23, 2011 4:00 pm
by uze6666
Hi Derek21,

If you know how to program in Basic, that's a good start. I highly recommend you search the net for some tutorials on getting started with AVR microntrollers. Learn the architecture, type of memories, etc. If you want to program games, you will need to learn C, since it's the only language supported (with assembler of cource ;) ).

Here's a quick crash course. The ATmega644 like all AVR microcontrollers, uses an Harvard architecture. This means that internally it has two separate buses: one for flash (ROM) and one for data (RAM). Code can only execute from ROM, so it means that your game must be programmed (flashed) in ROM before executing, it can't run from RAM like for most microprocessors. AVR Studio is Atmel's tool for developping applications for the AVR microcontrollers. With it you can only code in assembler. You must also install WIN-AVR to develop for the Uzebox. This provide C development to AVR Studio.

When you program something (say a simple Hello World) and hit "compile", a .HEX file will be generated, which represent the binary form of your program. AVR Studio programming menu takes .HEX files and flashes them on your Atmega644. However, for that you will need an external programmer device named an "ISP programmer" (In-System programming) like Atmel's AVRISPMKII. If you ordered the Uzebox kit via the Uzebox store, the ATmega644 fuses are already set correctly and is already flashed with Megatris and the boot loader HEX. That allows you to load and program games stored on a SD card without an ISP programmer. But if you are serious about coding on the Uzebox, you will need an ISP programmer since it's the only way to upgrade the bootloader and program the fuses.

The boot loader (aka GameLoader) is a small program that take 4K of the total 64K of program space and stays always flashed on the mega644. When you reset the console, this program executes and display the boot menu with all games it founds on the SD card. When you select a game, it flashes the remaining 60K of program space with the game and jumps to that game's first instruction. It important to note that the bootloader requires special .UZE files to be put the SD card. .UZE files are special binary version of .HEX files with an added header block. The packrom Uzebox tool is used to convert HEX to UZE. You can dowload the game pack with all UZE file from Google Code repository here.

Games in .UZE format can then be simply dragged on a SD card from you Windows/Linux/Mac shell. The SD card must not be SDHC ( <= 2 Gigs) and it must not be fragmented, so re-format the card before putting games on it.

Hope that helps,

-Uze

Re: Uzebox Quick Start

Posted: Fri Sep 23, 2011 4:39 pm
by derek21
thank you very much :)

so all i have to do is to put the .hex file on the rom of the atm644p with a isp programmer( i have one on paralel port- stk200/300).
And the last step i simply drag the . uze files on sd card in windows xp like a normaly file on sd card.

I was very confused first time, i know .hex goes in rom but never use sd card with avr and .uze file maked me not understand.


Btw thx for the description of how it works, really help me and now i understand very well :)
I didn t buy it preprogramed chip so in the future i will annoy you again with fuses.
THANK YOU VERY MUCH AND CONGRATULATIONS FOR THIS WONDERFULL PROJECT!!!

Re: Uzebox Quick Start

Posted: Fri Sep 23, 2011 4:45 pm
by uze6666
so all i have to do is to put the .hex file on the rom of the atm644p with a isp programmer( i have one on paralel port- stk200/300).
And the last step i simply drag the . uze files on sd card in windows xp like a normaly file on sd card.
Exactly. :)
I didn t buy it preprogramed chip so in the future i will annoy you again with fuses.
No problems, just let me know when you're there.

Cheers,

-Uze

Re: Uzebox Quick Start

Posted: Thu Oct 20, 2011 10:53 am
by derek21
Hi again!
Now i have soldered all the parts and the hardware is ready for the show:P

I want to ask u very much if u can post again the bootloader hex and the corect fusebits in AvrStudio. I have found here in forum 2 answers about fusebits and i don t know what is correct. I want to mentioned that i use atmega644P so probably u can compile the soft and give me the corect hex for the "p" version(i know that they are similr but i don t want to missed up)

And the second question is do u think i can enter the video signal in a portable dvd player Amstrad?
i don t have tv :P and i wanted from the begining a portable console.

The third question (the last): i have a terminator video console that doesn t work but the remotes are ok.
i look inside a remote controller and they don t have "latch", "clock" they have different names for th 5 pins(except vcc and gnd). Can i use these remotes?

Re: Uzebox Quick Start

Posted: Thu Oct 20, 2011 6:07 pm
by uze6666
Hi Derek,

This post is the latest and greatest for the bootloader and fuse settings. Settings and HEX works equally for the 644 and 644P. Video signal should work, but its not guaranteed. For instance, I have a Sony portable DVD player that won't just work. What is a "terminator video console "? In any cases the controllers are most probably not SNES/NES compatible and won't work.

-Uze

Re: Uzebox Quick Start

Posted: Thu Oct 20, 2011 11:26 pm
by derek21
I have good news and bad news
I beggin with good news: my dvd player has print an mesage from the uzebox on the screen, these means the dvd player works with uzebox.
bad news: the mesagge is " sd initialize failed: sd card exist?"
i don t have card and snes controller, i try to push the power and reset button but nothing happend. I believed that the tetris will begin without sd card, i have the version 4.0 and this apears on the screen

Re: Uzebox Quick Start

Posted: Thu Oct 20, 2011 11:41 pm
by uze6666
Hmmm, it's possible I didn't set the eeprom flag for your chip (human error :oops: ). By default it tries to start the menu. You will need a controller to enter the game (and will need one anyway to play uh? ;) ). Thought I'm suprised, I'm pretty sure the bootloader should start the game when there's no SD card. Maybe a bug that was fixed in 4.0.2. Do you have an ISP programmer?

-Uze

Re: Uzebox Quick Start

Posted: Fri Oct 21, 2011 12:07 am
by derek21
yes i have stk200, avrdopper,avr910.
Which of them u advise me to use and can u post here vers 4,2?