Avr для mac os

Графическая оболочка для avrdude под MacOS

Программа avrdude поддерживает все актуальные программаторы микроконтроллеров AVR и является кроссплатформенной (Linux, Windows, MacOS). Это консольная утилита и её удобно вызывать из shell/bat-скриптов. Единожды написав такой файлик и положив его в директорию с проектом, получаем возможность быстро прошить и проверить фьюзы, flash и eeprom микроконтроллера. Проблема только в том, чтобы написать этот скрипт. И тут основную головную боль вызывают fuse-биты, т.к. надо правильно сформировать их значения нигде не ошибившись. Иначе, устройство, в лучшем случае, может не заработать совсем или работать неправильно. Ну а в худшем случае можно «окипрпичить» микроконтроллер.

Для avrdue написано много разных графических оболочек под Windows, но среди всего этого многообразия не так просто найти удобный и не сильно глючный софт. Основное требование к оболочке — возможность работать с fuse-битами не как с числами или набором непонятных чекбоксов, а в нормальном человекочитаемом формате. Под MacOS вариантов оболочек совсем не много, но, к счастью, есть open-source проект AVRFuses и с фьюзами там всё относительно неплохо. Плюс открытый исходный код даёт возможность неограниченно затачивать этот инструмент под себя.

Главное окно содержит пару вкладок — работа в flash/eeprom и работа с фьюзами. Тут всё просто — можно выбрать микроконтроллер и файл(ы) прошивки, а затем записать/прочитать/сравнить с содержимым памяти микроконтроллера. Собственно, кнопка ручного выбора микроконтроллера оказалась жутко неудобной — при переключении с одного проекта на другой приходилось каждый раз нажимать её и выбирать из немаленького списка нужный микроконтроллер. Поэтому, первым делом я добавил кнопку Autodetect, нажатие на которую стартует считываение сигнатуры микроконтроллера, подключённого к программатору, и определение его модели по этой сигнатуре.

На второй вкладке показаны фьюзы. Как в виде констант, так и списком, где их можно настроить имея минимально необходимые для этого познания. Перед тем, как что-то делать с фьюзами, их категорически желательно прочитать из микроконтроллера.

Существенный недостаток подобных оболочек в том, что при одновременной работе с несколькими проектами и частым переключением между ними, приходится каждый раз заново вбивать пути к файлам, и настраивать по памяти значения фьюзов, что скучно и отнимает время. Поэтому в оболочку была добавлена работа с проектами. Выбрав путь к прошивке и настроив фьюзы выбираем в меню ->Projects->New Project. Откроется окно, где можно посмотреть, отредактировать и сохранить все параметры.

Теперь переходить от проекта к проекту можно в один клик в меню Projects. Там же можно отредактировать созданные проекты.

Ссылки

В дальнейшем приложение умеет самообновляться по сети.

Источник

Avr для mac os

Here is a ‘generic’ step-by-step to getting an AVR development platform going on your computer using the free AVR toolchain (avr-gcc, avr-libc and avrdude) Pretty much every project uses this toolset so its a good way to get going

The following two methods both place all of the files in the /usr/local/bin directory in the hard driver. Unfortunately that directory is not in the default path. That means that when you type avrdude into the terminal it cant figure out where to look. In this prep-step you’ll change the profile of your Terminal to add /usr/local/bin to the path.

Find the Terminal program, you’ll be using this to do most of this stuff. Its in the Applications/Utilities folder

In the new Terminal window, type in echo $SHELL and press return

If the output is /bin/bash then type the following command:
echo ‘PATH=$PATH:/usr/local/bin’ >>

/.bash_profile
all on one line. Press return.

If the output is /bin/csh or /bin/tcsh then type the following command:
echo ‘set path = ($path /usr/local/bin)’ >>

Читайте также:  Текстовый редактор для linux аналог word

/.cshrc
all on one line. Press return.

Close any Terminal windows and open up a new one. This makes sure the .bash_profile or .cshrc is reloaded. Now type in echo $PATH (for bash) or echo $path (for t/csh) you should get something like the following:

The important thing is that at the end of the line is /usr/local/bin

This is the suggested method

Download the ready to go nice package from ObDev, I havent tried it but a friendly email’er said its great.

This isnt suggested, and is an older method, but we leave the documentation here in case its handy

You will need make which is included in XCode, as OSX-AVR doesn’t come with it (ugh)

Step 1. Download and install the mac developer tools (XCode).

You need to have make installed, but it doesn’t come with the OSXAVR package. You can try installing it with fink, which will require a lot less space but the following is guaranteed. If you want to have the latest avr-gcc you may also have to do it the «old way» which guarantees the most recent tools will be installed.

To install XCode you will need the official packages. These are available on your Mac OS X Install CD, or from apple at: apple developer tools. The file is about 900MB so unless you have a fast connection I strongly encourage grabbing it off of the Install CDs that came with your Mac (you do still have those, right?) Basically we need the native Mac OS X compiler tools so that we can generate the AVR compiler tools.

There’s finally a good/fast way of installing all these tools under Mac OS X PPC or i386! First, download the OSX-AVR packge for PPC (older macs) or i386 (Intel macs, latest ones) from sourceforge.

Run the OSX-AVR.mpkg

(Images of installation and process are forthcoming but its rather easy so go ahead and try it anyways)

Don’t forget you have to install XCode as make doesn’t come with this package.

Can’t get it working? Dont worry, help is available in the forums!

This is the advanced method, for when you need bleeding-edge development and hackability. Not suggested

The following steps are essentially the same for MacOS X or Linux, BSD or any other unixy OS. This is the ‘old style’ of installing avr-gcc, its longer and more tedious but you are guaranteed to have the latest version.

(Note that this doesn’t seem to work on Intel Macs for unknown reasons, we’re investigating. )

Leah Buchley has an excellent tutorial, and you should follow it. I’ve reduplicated it here in case the site goes down. (also with a few minor ‘improvements’ and images

Step 2. Download & install binutils (an essential utility for the C compiler)

Download the current release of binutils from : http://www.gnu.org/software/binutils/ (you can also go straight to the download site here) For these examples, we’ll be using binutils-2.17.tar.gz but you should use whatever is most recent. Save it into your home directory, not the desktop.

Decompress the downloaded file and double click on it to decompress it (or use Stuffit Expander, in the Applications folder). You should now have a folder called binutils-2.17 which you should drag into your Home directory

Open up a Terminal window and navigate to the binutils directory. Type: cd binutils-2.17 (or whatever you downloaded) theb type in ls to verify everythings there

Configure binutils for AVR. type: ./configure —target=avr
this will start a long process that will spit out a lot of text.

Читайте также:  Утилита для скриншотов windows

Once its done, compile binutils. type: make
this will start an even longer compilation process

Once that’s done, install binutils. type: sudo make install
You will be prompted to enter your password. Only administrators can install software thats why the password is necessary.

Step 3. Download & install gcc (the C compiler)
First, download the current release of gcc from: http://gcc.gnu.org/mirrors.html currently thats gcc 4.2.0

Decompress the downloaded file and put the decompressed folder in your home directory. Open up a new Terminal window in your home directory, type cd gcc-4.2.0 and then ls to verify its all in there.

Next, c reate another directory to install gcc into.
type: cd .. to go back into the home directory, then
type: mkdir avrgcc-4.2 (substituting your gcc version for the 4.2)
Navigate to the folder you created.
type: cd avrgcc-4.2 (or whatever you named your folder)
C onfigure gcc for AVR.
Type: ../gcc-4.2.0/configure —target=avr —enable-languages=c —disable-libssp
(substituting the name of the folder you decompressed for the gcc-4.2.0)
**thanks to Seth Raphael for the —disable-libssp ti p

Once the configuration is done, compile gcc.
type: make CC=»cc —no-cpp-precomp»

This will take a long time so go have a sandwich

When its done and you’ve washed your plate and silverware, install gcc. type: sudo make install
and enter your password when prompted

Step 4. Download and install avr-libc (an essential C library for AVR chips)

Decompress the downloaded file and put the decompressed folder in your home directory

In a new Terminal window, navigagte to the avr-libc directory. from your home directory
type: cd avr-libc-1.4.6 (or whatever you downloaded)

Configure avr-libc. type: ./configure —host=avr

Compile avr-libc. type: make

Install avr-libc. type: sudo make install

Step 5. Download and install avrdude (the software that loads programs from your machine onto the chips)

Decompress the downloaded file and put the decompressed folder in your home directory

In a Terminal window, navigate to the avrdude directory. From your home directory type: cd avrdude-5.2 (or whatever you downloaded)
Configure avrdude. type: ./configure
Compile avrdude. type: make
Install avrdude. type: sudo make install

Yay all the software is installed!

Can’t get it working? Dont worry, help is available in the forums!

Источник

MightyOhm

Mitch Altman and I are in the process of writing a book about Making Cool Things with Microcontrollers (for people who know nothing.)

The book features several DIY projects that use AVR microcontrollers. We’re aiming to teach absolute beginners how to solder, basic electronics, and the process of turning a cool idea into reality by using microcontrollers.

I wrote these instructions about setting up a working avr-gcc environment in Windows, Mac OS X, or Linux. Mitch and I felt that they could use some beta testing in the real world before bring included in the book, so we decided to make them available here. We also felt that they might help some people get started with AVRs before the book is available.

We want to make the process of writing and compiling code for the AVR simple and accessible, so we’re not using any fancy IDEs (eg. no AVR Studio). We also wanted to use the same software on all three operating systems, so Windows-only tools were out. Instead, we’re using avr-gcc, the compiler behind WinAVR, CrossPack, and Arduino.

I would appreciate any feedback on these instructions.

AVR Toolchain Installation Instructions – Mac OS X

Note: At the time of this writing, following the step-by-step instructions below will result in a working AVR toolchain being installed on your computer. However, computers, operating systems, and software are constantly changing. This means that while these instructions are valid today, they may not be by the time you read this. If you run into trouble, fear not! Entering a few carefully chosen keywords into your favorite search engine will often yield just the information you need to resolve the issue.

Читайте также:  Acer w700 как установить windows

Installing the AVR toolchain on OS X is fairly straightforward, thanks to a software bundle called CrossPack. CrossPack, which is similar to WinAVR for Windows, includes all of the software you need to get started working with AVR microcontrollers in one easy to install package.

The instructions below were developed and tested with Mac OS X Snow Leopard 10.6.4 and CrossPack version 20100115. CrossPack should run on PowerPC and Intel-based Macs. It requires approximately 100MB of hard drive space and OS X 10.3 or higher.

To install the AVR toolchain within Mac OS X:

1. Open your favorite web browser and visit the CrossPack website at http://www.obdev.at/products/crosspack/.

Click the Download button and find the latest version, which at the time of this writing is CrossPack-AVR-20100115.dmg. Click to download the disk image (dmg) file and save it to your computer.

2. Wait for CrossPack to download. If you are using Safari, the disk image should open automatically. Otherwise you may need to find the file on your hard drive (try looking in your Downloads folder) and double-click to open it.

Once the disk image has opened, double-click CrossPack-AVR.pkg to install CrossPack. The package installer should open.

You can install with the default options. Click Continue to start the guided setup. A few clicks later, and CrossPack should be installed on your Mac. Close the installer.

3. Open a Terminal window. You can do this by opening a Finder window and browsing to the Utilities folder inside Applications. Double-click on the Terminal application to open it. (You can also launch Terminal with Spotlight.)

To make it easier to open in the future, right click on the Terminal icon in the Dock and select Options -> Keep in Dock.

4. You can test the installation by entering the command

You should see the response

and a copyright notice. Note that the version number might be different.

5. OS X includes built-in drivers for the Adafruit Industries USBTinyISP. If you are using the Atmel AVRISP mk II, substitute “avrisp2” for “usbtiny” in the command below. If you are using another programmer, follow the manufacturer’s instructions or consult your favorite search engine.
To test the USBTinyISP, plug it into an open USB port. When used with OS X, the programmer’s green LED may not immediately turn on. It should be on after executing the command below.

Type the command

and press enter while you watch the USBTinyISP’s red LED. The red LED will flash once and you should see the following message:

If you don’t see the red LED flash, try executing the command again. The LED flashes quickly and is easy to miss!

If you see the error message

double check your USB connections.

The initialization failed error shown above is not a problem, it is displayed because there is no microcontroller connected to the programmer. At this point, if the red LED flashes, the programmer is working.

This completes the OS X AVR toolchain installation. You are now ready to start programming microcontrollers!

Источник

Оцените статью