ISP and Controller Questions

Topics regarding the Uzebox hardware/AVCore/BaseBoard (i.e: PCB, resistors, connectors, part list, schematics, hardware issues, etc.) should go here.
Post Reply
User avatar
ry755
Posts: 226
Joined: Mon May 22, 2017 6:01 am

ISP and Controller Questions

Post by ry755 »

Hey everyone! I'm building my own Uzebox so I need to burn the bootloader myself. Can I just use the Arduino as ISP thing, or do I need a real ISP? Also, would this SNES controller work? https://www.amazon.com/CirKa-S91-Premiu ... controller
User avatar
Jubatian
Posts: 1561
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: ISP and Controller Questions

Post by Jubatian »

You should be able to program it. Just pay attention to the fuse bits, and use the right boot loader:

http://uzebox.org/wiki/ATmega644_Fuse_Settings
viewtopic.php?f=3&t=520 (Use Bootloader_0_4_5.hex from the top post)

I say you can use the Arduino as programmer by this page I found: http://www.instructables.com/id/How-to- ... -8bit-mic/

I don't know about that particular controller, though. It should work, as far as I know only wireless controllers are somewhat picky about the rate Uzebox polls them, but we are already thinking about software and hardware solutions to get around that. Anyway, it is a wired controller, I say it will possibly work.
User avatar
ry755
Posts: 226
Joined: Mon May 22, 2017 6:01 am

Re: ISP and Controller Questions

Post by ry755 »

Thanks! I'm used to Arduino programming, so coding for the Uzebox will be a bit of a challenge. But it will still be fun! :D
User avatar
nicksen782
Posts: 714
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: ISP and Controller Questions

Post by nicksen782 »

That's where I originally came from!

You'll find a few things. First thing you'll find is that there is not a "loop()". It is "main()" now.

Your "setup()" function would be in the first part of main() and then your "loop()" would be a "while(1){}" after the setup stuff in main(). Make sure to keep a "WaitVsync(1)" in your main loop somewhere or things will be timed weird or too fast.

Also, function prototypes. Arduino would take care of that for you. However, with straight C you'll need to do that yourself. You can cheat and not use function prototypes if you define them in a specific order. However, that isn't a great idea in the long run especially as your program grows. Your compiler will give you nasty messages that look like "implicit declaration of XYZ" or something.

But once you get a build environment up and a Makefile (borrow one from one of the existing projects at first) you'll get it. The Arduino.cc was a pretty good resource for certain specific C questions. But, now you'll need additional resources.

Really decent C resources:
http://www.studytonight.com/c/
http://www.c4learn.com/learn-c-programming-language/
User avatar
ry755
Posts: 226
Joined: Mon May 22, 2017 6:01 am

Re: ISP and Controller Questions

Post by ry755 »

Thanks for the tips! Also, do you know of any good AVR IDEs for Mac? Last time I checked, Atmel Studio was Windows only.
User avatar
nicksen782
Posts: 714
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: ISP and Controller Questions

Post by nicksen782 »

I don't know about Mac. However, I use one of the cloud IDEs. I use Cloud9 IDE and it has an environment (Linux) that can be used for whatever. Actually, I've built all my Uzebox tools around it.

There is a local NodeJS version of Cloud 9 IDE that you can install. I use that at work.

So, write the code, compile it then download the .hex or .uze file and play it on the online emulator, local emulator, or the real hardware.
User avatar
L4rry
Posts: 242
Joined: Sun Dec 28, 2014 7:19 am
Location: Cape Town, South Africa

Re: ISP and Controller Questions

Post by L4rry »

ry755 wrote:Also, do you know of any good AVR IDEs for Mac?
I develop on a mac too and, sadly, their doesn't seem to be a rich, AVR focused IDE around for it. I personally use CodeLite which is a bare bones open-source IDE along with command line tools for building and debugging. Here's a Uzebox wiki page for setting up your mac for development if you haven't seen it already. I used and updated this page when I got started too.
Post Reply