📄 !readme-mac.txt
字号:
To install the programming infrastructure on your Mac, do the following beforefollowing the instructions in the !README.txt file.# Follow the instructions found here: http://www.avrfreaks.net/index.php?module=FreaksAcademy&func=viewItem&item_id=602&item_type=project and download and install avr-gcc, avr-libc and libc. Use the second download on the page, but do NOT install the AVRDUDE package! I don't think it matters if you install the AVRA package, the AVRGCC... one is the one you want. All this stuff will end up in /usr/local/bin. # Go to http://www.ladyada.net/make/minipov3/download.html and download the "executable and updated avrdude.conf" file. Move the avdude file to /usr/local/bin. Assuming it downloaded into your desktop, once the file is unpacked, then from a new terminal window: cd desktop cd avrdude-macosx (or whatever the file is mv avrdude /usr/local/bin and change permissions so everyone has rwx access to it chmod ugo+rwx /usr/local/bin/avrdude Similarly, move the avrdude.conf file to /usr/local/etc and chmod it. # Make a .bash_profile file in your home directory. BBEdit or any decent text editor will let you do this. This is the directory that terminal windows start pointing at. This file has two lines in it: PATH=$PATH:/usr/local/bin export PATH and these let the terminal shells find the new applications. # Close the terminal window, open a new one. This executes the .bash_profile. You can check everything is OK by typing echo $PATH and you should see: /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin # Next, find out what serial port you will be using. Type ls -l /dev for a list of all the unix devices. You're looking for ones that start with cu AFAIK. For example, with both a Keyspan and generic Radio Shack USB adapter plugged in, I see: ... crw-rw-rw- 1 root wheel 9, 7 Aug 7 17:56 cu.Bluetooth-Modem crw-rw-rw- 1 root wheel 9, 5 Aug 7 17:56 cu.Bluetooth-PDA-Sync crw-rw-rw- 1 root wheel 9, 1 Aug 7 17:56 cu.KeySerial1 crw-rw-rw- 1 root wheel 9, 9 Aug 7 18:10 cu.PL2303-000012FD crw-rw-rw- 1 root wheel 9, 3 Aug 7 17:56 cu.USA19H3d1P1.1 ... You need to have the right drivers installed to get things to work -- and I haven't managed to get the Keyspan to work correctly yet. The latest universal keyspan drivers are on http://www.keyspan.com/. The correct drivers for devices using the PL2303 chip can be found here: http://sourceforge.net/projects/osx-pl2303 So if using the Radio Shack USB/Serial adapter, your serial device is: /dev/cu.PL2303-000012FD # Now go to your firmware directory (say, wherever you stuffed one of my firmware versions) and edit the Makefile file. You need to change two lines in this file to tell avrdude how to program the flash memory. Change the AVRDUDE_PROGRAMMER line so it uses the dasa programmer: AVRDUDE_PROGRAMMER = dasa and change the AVRDUDE_PORT line so it says what device you want to use: AVRDUDE_PORT = /dev/cu.USA19H3d1P1.1 (or whatever) Save the file. # Now, in a terminal window, cd to the firmware directory. Edit the main.c file, add a blank line, then save it. This will tell the make processor it needs to be compiled. To do this, and test your install of avr-gcc, type: make all Assuming that worked (if it said it could not find avr-gcc, you probably messed up your .bash_profile file. That file may have gone invisible, but BBEDIT can open hidden files for you if you need to mess with it) To compile and upload the firmware to flash, type: make full Some comments: Flashing using the Radio Shack serial device is horribly slow. Uncomment the two lines reading AVRDUDE_FLAGS += -V AVRDUDE_FLAGS += -v -v and remove the -q in AVRDUDE_FLAGS = -q -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) to make things go a little faster, and to at least see that things are progressing. You may also want to comment out the make verify line in the make full command, full: $(TARGET).hex make burn-fuse make program # make verify to avoid waiting a second hour (!) for the verify! However, if you get a "smart" programmer that does not use the "bitbashing" protocol the simple programmers use, then things go incredibly fast. The problem with bitbashing is that the usb/serial drivers are not set up to do it well, so they spend a lot of time state-changing. But when using a smart programmer, the serial port is used as a regular serial port, and everything works fine. I have used the Atmel STK500 programmer with no problems in this way.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -