AVR studio is the official development tool for AVR chips. Users can focus on programming rather than Makefile or configuring the tool chain. Also both the hardware and software simulation function is powerful and it is the only way for us to use the debugging tools to troubleshoot in real environment.
This is a tutorial of using PlayOnMac to run the AVR studio in Mac OS. The software functions pretty well. I haven’t tested the connection of the programming tools.
First you need to download PlayOnMac, AVR Studio and WinAVR. I’m using PlayOnMac4.0.13, AVR Studio 4.19 and WinAvr 20100110.
PlayOnMac is based on wine. Although you can download the source code and compile, it is easier to use the pre-compiled binary package.
PlayOnMac requires XQuartz2.6.3. So you need to upgrade your system to higher than 10.6.3 before installing XQuartz. You’d better logout and log back in after the installation of PlayOnMac to update your DISPLAY environment variable to point to XQuartz.app rather than X11.app. Otherwise, X11 will mess up most icons in AVRstudio just like the following pictures. I realized this problem after taking most of the screenshots.
Double click WinAvr to install it first.
Then open the configuration window in PlayOnMac and select winavr prefix. Click “Run a .exe file in this virtual drive” to install AVRStudio. If you install them separately, AVRstudio will not find the toolchain.
You can make a shortcut of AVRstudio.exe to make it easier for further use.
Now you can launch AVRstudio. If you get an error message like the second screenshot, it is cause by the separation of AVRstudio and WinAvr.
You can create a new project by project wizard. This project will make the on-board led blink on Arduino board.
Choose AVR Simulator and ATmega328P.
In “Project”->”Configuration Options”, change Frequency to 16000000.
Press F7 to compile the project (the code won’t appear automatically so you need to type or paste them).
Then you can find the compiled hex file in Finder.
As long as you can upload a sketch in Arduino IDE, you can get the avrdude command by holding shift and press upload.
Simply replace the file name and path of the target hex file; you can upload the hex file via bootloader.
The led on Arduino will blink.
Logout and log back in after installation of PlayOnMac. You can see PlayOnMac is using XQuartz instead of X11. All icons are displayed correctly.