Page 1 of 4

Linux Uzebox how-to

Posted: Thu Nov 27, 2008 6:49 am
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 !

Re: Linux Uzebox how-to

Posted: Thu Apr 16, 2009 12:10 pm
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)

Re: Linux Uzebox how-to

Posted: Thu Apr 16, 2009 3:35 pm
by uze6666
I'll ask codecrank to post a binary.

Uze

Re: Linux Uzebox how-to

Posted: Fri Sep 02, 2011 1:29 pm
by rob
I'm trying to run the resulting .hex files in the linux emulator (uzem). It just hangs. I am missing a step?

Re: Linux Uzebox how-to

Posted: Sat Sep 03, 2011 2:59 am
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?

Re: Linux Uzebox how-to

Posted: Sat Nov 26, 2011 6:20 pm
by Blue Protoman
Would this work at all? http://www.adafruit.com/products/26

Re: Linux Uzebox how-to

Posted: Sat Nov 26, 2011 10:11 pm
by uze6666
If your computer (still) actually has a serial port, sure, it can be used to program the 644.

-Uze

Re: Linux Uzebox how-to

Posted: Sat Nov 26, 2011 11:56 pm
by Blue Protoman
Oh my, that's not USB, didn't see. Is there a cheaper alternative to the one that codecrank mentioned, then?

Re: Linux Uzebox how-to

Posted: Sun Nov 27, 2011 3:56 am
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

Re: Linux Uzebox how-to

Posted: Sun Nov 27, 2011 6:45 am
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.