Society of Robots - Robot Forum

Software => Software => Topic started by: xdlubusxd on August 08, 2010, 01:23:34 PM

Title: Programming on mac
Post by: xdlubusxd on August 08, 2010, 01:23:34 PM
Hello
My name is Arturo and I would like to know how to program using a mac?
What would be the best language for a beginner to learn?
I read that it would be C.
Can I program in C with my mac?

Thanks,

Arturo Cardoni
Title: Re: Programming on mac
Post by: Razor Concepts on August 08, 2010, 01:36:56 PM
Yes... there are many types of C for microcontrollers (each brand requires a different program) so it really just depends on which microcontroller you select.
Title: Re: Programming on mac
Post by: vinito on August 08, 2010, 05:38:20 PM
Just food for thought.

What this newbie has found is the world of microcontrollers is still heavily pointed toward Windows. I use Linux (and like it) for everything except my micro stuff. Seems like there are too many stumbling blocks to do it with anything but Windows unless you're already good at programming and pretty knowledgeable about communications protocols and text-based (terminal) computer usage.

Not sure about pic since that's not where my experience is, but both AVR and TI require Windows to run their software. Not that it can't be done on something else. It can - you just have to already be good at dealing with it, and I'm not quite there. Programming is basically just text editing so that's easy. Then you simply need a way to compile it and then send it to your chip. All this is essentially simple and doable on any OS, but it's just easier on a Windows machine for the time being since the packaged software takes care of all three facets.

So I have given up trying for now on Linux. I'm sure in a few years it will be more development and such and maybe will be able to easily use Linux (or Mac) for more of it. For now I have set up a Windows machine for my micro stuff. It has made things progress smoother and it was pretty cheap to do it.

But yea, C seems to be a pretty good way to go. It's popular and pretty versatile, both of which are helpful for the beginner (me).
Title: Re: Programming on mac
Post by: xdlubusxd on August 09, 2010, 05:22:09 PM
What programm should I use?
I heard that TextWedge runs on mac
But Is there a WinAVR for mac?
Which program should I use?

Thanks,

Arturo Cardoni
Title: Re: Programming on mac
Post by: GearMotion on August 10, 2010, 10:59:03 AM
What programm should I use?
I heard that TextWedge runs on mac
But Is there a WinAVR for mac?
Which program should I use?

Thanks,

Arturo Cardoni

http://www.obdev.at/products/crosspack/index.html (http://www.obdev.at/products/crosspack/index.html)
Title: Re: Programming on mac
Post by: garrettg84 on September 07, 2010, 12:27:52 PM
Sorry for dragging up an old post. Programming on Mac OS X is just as legitimate as programming on any other operating system. If you want to develop for micro-controllers on OS X, I would recommend taking a look at MacPorts. It allows access to an easy command line ("sudo port install avr-binutils avr-gcc avr-gdb avr-libc avrdude" - all you need for AVR) repository for bringing in open/free utilities including avr-gcc (http://www.macports.org/ports.php?by=library&substr=avr-gcc (http://www.macports.org/ports.php?by=library&substr=avr-gcc)) for AVR/Arduino development! GCC or specifically avr-gcc is the underlying compiler that both the AVR Studio and the Arduino IDE use.

I will admit, I run on OS X. I code between OS X, Linux and Windows though. I have a MBP with OS X dual booted with Ubuntu. I have virtual machines (http://www.virtualbox.org/ (http://www.virtualbox.org/)) for each of the operating systems as well. From any OS booted (I won't boot Windows on the Mac - it would feel dirty) I can access any of the other OSs through a virtual machine. I prefer Linux and the feel of the GNOME environment to anything else, but OS X still has quite a few hassle free commercial tools to I use. Don't pigeon hole yourself to a single OS.

I prefer gedit (OS X: "sudo port install gedit" Windows: "http://ftp.gnome.org/pub/gnome/binaries/win32/gedit/2.30/gedit-setup-2.30.1-1.exe" Linux: Run GNOME, its there.) as its cross platform and a reasonable GUI (programmer's) editor. Gedit, with a little configuration could even be configured/augmented to create a make file and compile AVR/Arduino source from a menu. I prefer looking at things and working on the command line, so I have not done this myself, but it is certainly possible - if not already done.

Another thing to keep in mind, for most micro-controllers a hardware programmer is usually required. It is often in the form of a dongle or a USB stick with a cable to hit ICSP or JTAG headers. Specifically speaking of AVR/Arduino, if it has a hardware USB port, you usually don't need a hardware programmer. All AVR chips with USB support have a bootloader burned from factory that allow for programming via USB without an additional hardware programmer. The Arduino platform, by design, is a mix of hardware and bootloader that allows for programming without an additional programmer as well.

Good luck!