newbie questions

What is a Uzebox? How can I get one? Check here!
1mpar
Posts: 13
Joined: Tue Mar 29, 2011 6:22 pm

newbie questions

Post by 1mpar »

Hi, I just received my uzebox from sparkfun and I got some doubts.

How do I program it? do I need a specific interface?
can I program it using only a SD card? Is there a way to plug the card in my computer, program it and then put it into the board?

the board hasn't got a midi port as I thought it would. How can I connect it to a midi keyboard?

sorry for the basic questions, but I'm an absolute beginner in this area.

thanks,
1mpar
User avatar
uze6666
Site Admin
Posts: 4813
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: newbie questions

Post by uze6666 »

Hey,

I'm afraid your doubts are justified. First, the not so bad news. To program the Uzebox you need an ISP programmer. Something like the AVRISP or the USBTinyUSB . Now the bad news: the AVCore does not have MIDI and does not even expose the UART pin required. If I knew you were considering it, I would have warned you (I assumed you would build one)! Since it won't be of very much use to you for your project, I guess you can return it to Sparkfun...unless, of course, you would like to program some games! ;)

-Uze
1mpar
Posts: 13
Joined: Tue Mar 29, 2011 6:22 pm

Re: newbie questions

Post by 1mpar »

hi, Uze

is there a way I can build an external midi interface (i already have an arduino midi shield) or even connect its wires straight to some pins on the board?
which board has the midi input? after I received it I saw that the midi in was optional...

another option would be control/change some midi files using the joystick. it's not what I need, but could be kind of a solution,

BTW, what is the SD card for?

1mpar
1mpar
Posts: 13
Joined: Tue Mar 29, 2011 6:22 pm

Re: newbie questions

Post by 1mpar »

can you tell me if this programmer would work for uzebox?
http://www.pololu.com/catalog/product/1300
there's a shop they sell it here in Brazil, so it would be easier and faster.

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

Re: newbie questions

Post by uze6666 »

Hi 1mpar,
BTW, what is the SD card for?
Flash game, stream music and even play movies! Naturally, anyone is free to use one of many AVR FAT driver to read/write whatever they want on the card.
is there a way I can build an external midi interface (i already have an arduino midi shield) or even connect its wires straight to some pins on the board?
which board has the midi input? after I received it I saw that the midi in was optional...
*In theory*, you could use the joypad ports to expose a MIDI interface via a software UART. However, since the kernel is most of the time busy rendering video, it is not practically feasible. A couple options:
  • As you suggested, if your arduino shield exposes some extra pins, use those to communicate with the Uzebox via the joypad port via some bit-bang approach. However implementing a robust serial software communication protocol won't be trivial
  • Use an external atmega to buffer MIDI IN data and push to the Uzebox via the joypad port. Obviously adding yet another MCU add complexity to the solution
  • Use the ISP port. All Uzeboxes have an ISP programming header. That could be the simplest and most elegant solution. I'm not too familiar with the Arduino, but it seems to expose the ISP pins as digital pins 11,12 and 13. With this, exchanging data with the Uzebox would be trivial and even more reliable than MIDI. Downsides are that you can't use SD card at the same time and will have to continually swap the cable to program the Uzebox. That said, it's my recommendation in your case.
can you tell me if this programmer would work for uzebox?
http://www.pololu.com/catalog/product/1300
there's a shop they sell it here in Brazil, so it would be easier and faster.
Yes, that's an AVR ISP programmer which you can use with the Uzebox. According to the product page, it emulate Atmel's own AVRISP, so that 's a good thing since you can flash you program natively from AVR Studio.

Hope that helped!

-Uze

ps: Btw, (and unless it's secret so far), what kind of stuff/visuals are you expecting from the Uzebox for your project?
1mpar
Posts: 13
Joined: Tue Mar 29, 2011 6:22 pm

Re: newbie questions

Post by 1mpar »

Hi, uze

Thanks for the info.

I think the last option would be the best for me.

When I ask you about the midi in is because I thought the board had this input. But I'll send the notes straight from the arduino. I don't need to use midi. It would be even better if I could send the signal as a variable (or 2 Variables so that I could play 2 instruments live).

Is it possible to receive variables in real time via the ISP pin on uzebox so that I could play melodies? Do you know if it's simple to send these variables from arduino?

About my project, I'm on an artistic residency and my project is about building an autonomous audiovisual instrument to use on a realtime performance. The theme of the performance will be "a game with no winner" and I'll use the retro game aesthetics to produce low resolution animations that will be in synchronized with the music. This images will probably abstract. My idea is to play a live a/v performance the same way I would play a video game.

This performance will be part of my a/v project HOL, where I create generative compositions and play them live.
If you wish, you can view details on my website: http://hol.1mpar.com

Ps: this project using uzebox will have a completely different aesthetic from my other compositions as you may see on the site. The common point is the use of synchronized sounds and images.

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

Re: newbie questions

Post by uze6666 »

I looked at you website, awesome stuff!

You can exchange any data in realtime via the ISP. That include the data of variable(s). You will have to define a simple protocol. In your case the protocol could be messages made of two bytes: [Variable ID][Variable Value]. To avoid loosing sync, I would have the Msbit of the [Variable ID] always 1 and the MSbit of [Variable value] always 0.

After that, on the Arduino side, you activate the ISP port and send these two bytes back to back. On the Uzebox size, you will need a small handler that will poll the ISP port, buffer the received bytes and then invoke an event procedure in your C program. If you plan up to 30 events/variables sent per seconds, that can be done in C. More than that and things gets a bit trickier in order to avoid buffer overrun. The handler would need to be coded in assembler and would replace the MIDI one. I could help you with those handlers.

-Uze
1mpar
Posts: 13
Joined: Tue Mar 29, 2011 6:22 pm

Re: newbie questions

Post by 1mpar »

Hi, uze

I finally started the project, but I'm having a lot of trouble.
I tried the uzebox site, tutorial and forums, but I couldn't find the answers. Could you please give me some help?

I bought a USBtinyISP and downloaded AVR studio 4. I also installed the software usbtiny500a.
I'm on win7 64 bits. I installed all the drivers, created a virtual com port with com0com and connected to the board using AVR studio.

My problems and doubts are:
- When I try to connect to the board I always get this message: "entering programming mode... FAILED" it happens at the connect/main tab and at the program tab when I click on verify or program. What's wrong?
- How and where do I preview the animations?
- Is there a way to preview the programming in avr studio? to emulator I can only initialize when I drag and drop a HEX file on it. Isn´t there a interface for the emulator where I can modify the code?
- What type of file should I upload to the board? at the program tab there are flash, eeprom and elf. which one should I use? Is this the right place to upload the programming to the board?

Sorry for the dummies questions, but I'm completely new to AVR programming.

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

Re: newbie questions

Post by uze6666 »

Hi 1mpar,

I don't run Windows 7 nor do I have an USBtinyISP, so bare with me.
- When I try to connect to the board I always get this message: "entering programming mode... FAILED" it happens at the connect/main tab and at the program tab when I click on verify or program. What's wrong?

I assume you followed instructions at http://www.ladyada.net/make/usbtinyisp/ ... ompat.html? Can you post print screens of all the tabs in the AVRISP box? i.e: Main, Program, Fuses, etc.
- How and where do I preview the animations?
What animations are you referring to?
- Is there a way to preview the programming in avr studio? to emulator I can only initialize when I drag and drop a HEX file on it. Isn´t there a interface for the emulator where I can modify the code?
There no quick way for that unfortunately. What I do is define an external tool. Go to menu Tools->Customize, select Tools tab. Click new icon and enter a name like "Emulator". In the command field enter the name of the location of uzem.exe, like "C:\uzebox\sources\trunk\bin\uzem.exe". In Arguments enter the full path to the HEX file, like ""C:\uzebox\sources\trunk\demos\Megatris\default\megatris.hex". Then go back to the commands tab and locate the "Emulator" command you created and drag-and-drop it onto one of the toolbar of the main window.
- What type of file should I upload to the board? at the program tab there are flash, eeprom and elf. which one should I use? Is this the right place to upload the programming to the board?
You use the "Flash" section and upload a HEX file.

Btw, If not already done, you need to download WinAVR. It's the pack that will allow you to use C to program stuff.

-Uze
1mpar
Posts: 13
Joined: Tue Mar 29, 2011 6:22 pm

Re: newbie questions

Post by 1mpar »

I assume you followed instructions at http://www.ladyada.net/make/usbtinyisp/ ... ompat.html? Can you post print screens of all the tabs in the AVRISP box? i.e: Main, Program, Fuses, etc.
Yes, I follewd the instructions. these are the previews:

Image
Image
Image
Image
Image
Image
Image
Image
What animations are you referring to?
I mean the game itself.
Btw, If not already done, you need to download WinAVR. It's the pack that will allow you to use C to program stuff.
I had already downloaded the WinAVR-20100110. Can't I use AVR Studio to program?
Post Reply