Uzebox Quick Start

What is a Uzebox? How can I get one? Check here!
RafaelDPerez
Posts: 20
Joined: Fri Mar 16, 2012 2:52 pm

Re: Uzebox Quick Start

Post by RafaelDPerez »

Hello!
I just ordered the uzebox kit from the iTead Studio page. I'm new and not familiar at all to uzebox and I have a couple of questions. First of all, I want to know if the kit I ordered is the same as the one that was in the uzebox official page. And the other thing is, I would like to know if you are able to help me (with a tutorial) on how to program my uzebox. i just want to load 3 games in it, and create some kind of customized menu with my name in front.

I would really appreciate the help,

Rafael David Pérez
From Dominican Republic
User avatar
Harty123
Posts: 467
Joined: Wed Jan 12, 2011 9:30 pm
Location: PM, Germany
Contact:

Re: Uzebox Quick Start

Post by Harty123 »

Hi Rafael,

welcome in the Uzebox community!

About your questions:

Yes, the kit from the shop and from iTeadStudio is the same (not assembled from Uze but with the same parts and PCB)...

You will find a lot of tutorials in the wiki about the programming mostly in mode 3. It's not possible to load 3 games at the same time. The Uzebox comes with an bootloader (so called gameloader). You can copy 3 or more games to an SD card and load the games with this Gameloader. The software and also the gameloader are OpenSource. So it is possible to create a gameloader with your name for example. But attention the Gameloader and also most of the games are licensed under GPLv3. You have to distribute the source code for this changed gameloader...

-Harty
RafaelDPerez
Posts: 20
Joined: Fri Mar 16, 2012 2:52 pm

Re: Uzebox Quick Start

Post by RafaelDPerez »

Hello Harty:

Thank you very much for your help. I want to know how can I modify the bootloader. Other thing is, the .HEX and .UZE files can't be opened by my AVR Studio 4 software... How can I see the code? Because the Uzebox will be my project of Microcontrollers in my university, and I wnat to display at least my partner's name and mine...

Thank you very much,

Rafael David Pérez
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Uzebox Quick Start

Post by D3thAdd3r »

Hi Rafael,
The .uze/.hex files are basically the binaries the uzebox uses as it's program. The actual source code is separate, that is what you need to open in avr studio. So you get the source code, modify is to fit your needs and compile it to create hex/uze files that will run and display your name on the uzebox
RafaelDPerez
Posts: 20
Joined: Fri Mar 16, 2012 2:52 pm

Re: Uzebox Quick Start

Post by RafaelDPerez »

Hi Lee:

Thans for the info. One more question... Where can I find the source code of the games and the bootloader?

Rafael David Pérez
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzebox Quick Start

Post by uze6666 »

Hey Rafael,

All game sources and the bootloader can be found in google code here:http://code.google.com/p/uzebox/source/browse/ , code is under the trunk folder :)

-Uze who incidentaly is enjoying some great vacation (and free wifi) in Samana, Dominican Republic! :D
RafaelDPerez
Posts: 20
Joined: Fri Mar 16, 2012 2:52 pm

Re: Uzebox Quick Start

Post by RafaelDPerez »

Hey Uze!

It's great to hear that you're here in the Dominican enjoying our finest destination! I hope you're having a great time! One more question, the code is under trunk/demos/bootloader/data/ and then I guess the one I can modify and compile with the modifications is bootloader.aps... I would really appreciate if you could explain to me if I'm correct and how can I flash my own bootloader to my Atmega644. Another question is, the Kit from iTead Studio (where I ordered) comes with all the same parts as the one in the Uzebox store? Cause I was reading the list of components they have in their page and there are a couple of things that were missing, like the ISP programmer port...

Thanks a lot!

Rafael David Pérez
From Santo Domingo, Dominican Republic
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzebox Quick Start

Post by uze6666 »

Hi Rafael,

Having a great time here so far! :)

I made some recommendation to ITead for their kit, but in the end they decided. I know they made some parts substitution in order to lower the price as much as possible. That said, it should be functionnaly equivalent. Now that you mention it though, looking at the kit's page, it seems they did not include a header for the ISP port. :| I will let them know about this (let me know if other parts are missing). In the mean time you can use any 2.54mm dual row header for the ISP port.

Bootloader.aps is indeed the project to open in AVR Studio. In there you will see bootloader.c, the C source file you can modify. But beware when compiling the resulting binary must be at most 4096 bytes!

Once you compile the bootloader, its easy to flash on the '644. You simply flash from within AVR studio (menu tools->program AVR). For that you will naturally need to solder a 6-pin header for the ISP port and have a ISP programmer like Atmel's AVRISP MKII.

Btw, I don't know if you are familliar with AVR programming. If not you will need to download and install these tools: AVR Studio 4 from Atmel site and WinAVR, the GNU GCC compiler tool chain.

-Uze
RafaelDPerez
Posts: 20
Joined: Fri Mar 16, 2012 2:52 pm

Re: Uzebox Quick Start

Post by RafaelDPerez »

Hi Uze!

I already have the AVR studio 4 and the WinAVR. I guess that's all I need to flash the bootloader (modified) but I don't know what does the WinAVR do, and how I compile the bootloader, sorry :( About the ISP port, I have some 2.54 mm male ports, I guees I can solder those and I'll be ok. I'm very sorry if I ask too much

Thanks

Rafael David Pérez
From Santo Domingo, Dominican Republic
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzebox Quick Start

Post by uze6666 »

Hi Rafael,

WinAVR is a tool chain that allows to program AVRs in C/C++ (by default AVR Studio only supports assembler). It includes the GCC compiler and C libraries. Compiling the bootloader is very easy. I assume you have checked out all the sources (or unzipped them from uzebox_bin_Win32_dev_trunk_r212.zip ). Double-click \trunk\demos\Bootloader\Bottloadder.aps to start AVR Studio. Then go to menu Build->Build. That's it! :D If all goes well the build console should read:

Code: Select all

Build started 18.3.2012 at 20:17:38

AVR Memory Usage
----------------
Device: atmega644

Program:    4022 bytes (6.1% Full)
(.text + .data + .bootloader)

Data:       3813 bytes (93.1% Full)
(.data + .bss + .noinit)


Build succeeded with 0 Warnings...
Note the 4022 bytes bit, that the program size. The bootloader must not exceed 4096 bytes. To add your name or some other text, you will want to edit the topMenu() function in bootloader.c (expand the source files folder in AvrStudio left pane). The function that prints text is a little tricky to use because it is designed to use the less code as possible. The video memory is a 16bit array, the msb is the tile index while the msb is the background color. The print function takes 3 parameter: 1) the adress in VRAM to print the screen. Formula is (Y*40*2)+(x*2). 2) The string to print. PSTR() is a macro that takes care of putting the specified string in flash. 3) the background color.

Code: Select all

	Print((40*2)+(5*2),PSTR("HELLO WORLD!"),0x50);
	Print((3*40*2)+(14*2),PSTR("< PAGE 1/1 >"),0);
With this info you should be able to set the text you want and center the string on the screen.

Hope that help. Feel free to ask if you need help. :)

Cheers,

-Uze
Post Reply