Linux Uzebox how-to

What is a Uzebox? How can I get one? Check here!
User avatar
codecrank
Posts: 66
Joined: Sun Nov 16, 2008 10:13 pm
Location: Denver, Co

Linux Uzebox how-to

Post by codecrank »

If you're a windows hater like myself, this post is for you.

Hardware needed
  • Uzebox: I'm using this Clay's fully assembled kit ( here ), but there is also the fuzebox.
  • Atmel ISP loader. The Atmel MegaAVR 644 supports what's called "in system programming" ( ISP ), allowing you to flash the chip after it's installed. The Uzebox provides a 6 pin header on which to connect the loader. I'm using the Atmel AVRISPmkII ( available here for 35$ )
Software needed
  • Atmel AVR compiler tools ( if you're a debian guy, they're also available via apt-get )

    Code: Select all

    sudo yum -y install avr-libc-docs avr-binutils avrdude avr-gdb avr-gcc avr-libc
    
  • Uzebox source: ( version 1 here )
  • Makefile: use the one attached
Compiling
  • the uzebox source also contains sample programs: tetris.c and composer.c
  • open up the Makefile, locate "TARGET= tetris" at the top, if you want to compile composer.c , set TARGET = composer
  • Code: Select all

    make
Programming/Loading
  • if you got an AVRISPmkII , you need to set its clock to a sane value, or it will be horribly slow. Give your Uzebox some juice, hook up the ISP, and run the following. You only need to do this once.

    Code: Select all

    sudo avrdude -v  -p m644 -P usb  -c avrispmkII -t
    ...
    avrdude> sck 5
    avrdude> quit
    
  • if you have another ISP, refer to the avrdude man page for the correct port and model values, then modify the avrdude arguments in the makefile
  • Code: Select all

    sudo make flash
Your first program ?
  • copy and paste the following in tutorial.c ( from Uze's tutorial here )

    Code: Select all

    #include <avr/io.h>
    #include <stdlib.h>
    #include <avr/pgmspace.h>
    #include "kernel/video.h"
    #include "data/fonts.pic.inc"
    
    const char strHello[] PROGMEM ="HELLO WORLD FROM THE UZEBOX!";
    
    int main(){
    
       SetFontTable(fonts);
       ClearVram();
       Print(8,12,strHello);
    
       while(1);
    
    } 
    
  • edt the makefile : TARGET = tutorial
  • Code: Select all

    make ; sudo make flash 
Optional
  • Tile Studio : runs perfect under wine ( just needs lpng.dll )


That's it , Enjoy !
Attachments
Makefile.gz
had to gzip it, the forum didn't like the lack of extension :/
(1006 Bytes) Downloaded 1172 times
User avatar
nitrofurano
Posts: 38
Joined: Wed Apr 15, 2009 11:10 pm
Location: Porto, Portugal
Contact:

Re: Linux Uzebox how-to

Post by nitrofurano »

thanks, but it's too hard for newbies, specially the ones wanted to try the emulator and roms before buying uzebox or its electronic kit for diy
did someone create a binary i386 .deb or tarball of the uzem, and having the ready roms for testing? (this is just for encouraging newbies)
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Linux Uzebox how-to

Post by uze6666 »

I'll ask codecrank to post a binary.

Uze
rob
Posts: 1
Joined: Fri Sep 02, 2011 1:22 pm

Re: Linux Uzebox how-to

Post by rob »

I'm trying to run the resulting .hex files in the linux emulator (uzem). It just hangs. I am missing a step?
User avatar
nebososo
Posts: 188
Joined: Sun Oct 04, 2009 10:33 pm

Re: Linux Uzebox how-to

Post by nebososo »

rob wrote:I'm trying to run the resulting .hex files in the linux emulator (uzem). It just hangs. I am missing a step?
It might be a bad hex file. Are you using latest SVN? Did you compile it yourself?
Blue Protoman
Posts: 11
Joined: Wed Nov 16, 2011 1:32 am

Re: Linux Uzebox how-to

Post by Blue Protoman »

Would this work at all? http://www.adafruit.com/products/26
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Linux Uzebox how-to

Post by uze6666 »

If your computer (still) actually has a serial port, sure, it can be used to program the 644.

-Uze
Blue Protoman
Posts: 11
Joined: Wed Nov 16, 2011 1:32 am

Re: Linux Uzebox how-to

Post by Blue Protoman »

Oh my, that's not USB, didn't see. Is there a cheaper alternative to the one that codecrank mentioned, then?
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Linux Uzebox how-to

Post by uze6666 »

Well, the AVRISPMKII is already pretty darn cheap at ~35$ and that's the one I always recommend. As a cheaper alternative you can get Adafruit's USBTinyISP for 22$. But beware, it won't work in AVR studio.

-Uze
Blue Protoman
Posts: 11
Joined: Wed Nov 16, 2011 1:32 am

Re: Linux Uzebox how-to

Post by Blue Protoman »

Wow, $35, cheap? That's not right. Then again, I'm Jewish. :P I'd need a damn good reason to use that with both a Uzebox and my Arduino.
Post Reply