Which Bootloader to use with Alec Bourque's original design?

What is a Uzebox? How can I get one? Check here!
Post Reply
Andraos
Posts: 6
Joined: Fri Nov 19, 2010 8:59 pm

Which Bootloader to use with Alec Bourque's original design?

Post by Andraos »

Hello Uzees,

Allow me to first introduce myself. Old time Software Developer (Borland Turbo C 1.0 (c. 1989) - .NET 3.5 C# (current)). About a year ago I stumbled across embedded development and I immediately fell in love with it (8051 architecture). And as of two days ago, I am hooked on AVR! Bought myself a few 644's and now I'm here.

I assembled Bourque's original design (see fig. 1). I don't need/want color (no AD725). I just want a simple "Hello World" diplayed on the TV (for learning and experimental purposes). I downloaded uzebox_src_3.1.

Now to my questions:
- Do I need to flash the 644 with the uzebox bootloader or can I keep the Atmel bootloader on the chip?
- And if I need to flash with the uzebox loader, is uzebox_src_3.1 the right loader for the original non-AD725 design?

Using:
- ATmega644 40-pin PDIP
- AVRISP mkII
- AVRStudio SP3
- WinAVR Toolchain

Thanks for the help,
Salim

P.S.: I love the concept of an open source game console! Great job and thanks a lot. Great site.

Image
fig. 1
User avatar
uze6666
Site Admin
Posts: 4812
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Which Bootloader to use with Alec Bourque's original design?

Post by uze6666 »

Hi Salim,

First, welcome on board! I got hooked too on microntrollers years ago by discovering the AVR devices. And that led me to this project.
- Do I need to flash the 644 with the uzebox bootloader or can I keep the Atmel bootloader on the chip?
AVR devices don't come with any bootloader. The devices provides for user boot loaders to be developed (4k or less for the 644) and put in a special location in flash memory. By programming fuses, you tell the AVR to execute from that location instead of 0x0000. As for the Uzebox bootloader, it is not required to run games, just if you want the "gameloader" to read and re-flash the mcu with roms located on a SD card. So if you are building the minimalist design, you won't need it.

In general, you can see the boot loader as a permanently resident program that extends the way the AVR device can be reprogrammed. One thing to keep in mind is that using one reduces the available space for the main program. For the Uzebox it means all games must be less than 60k if they want to be flashed from the gameloader (the gameloader is exactly 4096 bytes).
- And if I need to flash with the uzebox loader, is uzebox_src_3.1 the right loader for the original non-AD725 design?
The bootloader is self-contained and totally independent to the game being run, so you can use any sdk version with any bootloader version. Moreover 3.1 is compatible with all Uzebox hardware versions. So you can use it without any changes with the non-AD725 version.

Hope that helps. If you get time, report on your experience, Uzebox hacking is reportedly known to be wickedly addictive! :lol:

Cheers,

Uze
Andraos
Posts: 6
Joined: Fri Nov 19, 2010 8:59 pm

Re: Which Bootloader to use with Alec Bourque's original design?

Post by Andraos »

Thanks for all the information Uze.

Here's an experience report. Hopefully someone might find this helpful:

I tried to build the 'tutorial' project but received the following error: "system cannot find the file specified - tutorial.uze"
I figured it might have something to do with packrom.

I tried to 'make' packrom but once again received "system cannot find the file specified - packrom.o"
I used cl.exe to make the object file 'packrom.o'.

I built 'tutorial' again and everything was peaches.

With the chip programmed, I went on to assembling the circuit (see fig. 1). I know, it's ugly as sin but it gets the job done :D (not quiet)

Here's where I'm at currently:
I can make out letters on the screen but horizontal static make it nearly impossible to make out the words.
It probably has something to do with the fact that I'm running the controller with a 16 MHz crystal.
I searched through the 'make' and 'include' files and came across this -DF_CPU=28636360UL.

I changed the fuse settings to ext. osc. 8+ Mhz 65ns and -DF_CPU to 16000000 in the hope that that would make a difference.
Unfortunately, it did not. Is there a way to run this design with a 16 MHz oscillator?

Thanks again,
Salim

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

Re: Which Bootloader to use with Alec Bourque's original design?

Post by uze6666 »

It's not possible to use anything but the 28.63636Mhz crystal for the Uzebox. Anything else will produce scrambled images. This comes from the fact that all video timing code is made for this specific frequency. Although it could be possible to rewrite the kernel for a 16Mhz crystal, it could not be used with the AD725 which requires 28.63636Mhz/2. Moreover the best attainable resolution would be quite lower. The -DF_CPU=28636360UL thing is for AVR studio emulator if I recall.

-Uze
Andraos
Posts: 6
Joined: Fri Nov 19, 2010 8:59 pm

Re: Which Bootloader to use with Alec Bourque's original design?

Post by Andraos »

Thanks uze!

I m up and running. Never thought I would be playing Tetris of a bread board. I love this project!
User avatar
uze6666
Site Admin
Posts: 4812
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Which Bootloader to use with Alec Bourque's original design?

Post by uze6666 »

My pleasure! :mrgreen:
Post Reply