Basic notes on shells
- Shells (aka "command prompts", "terminals") give you a typing interface to your operating system. UNIX shells (e.g., Linux, Mac) are case-sensitive, Windows isn't. All shells are very sensitive to spacing.
- In Windows, shift+right click a folder in an Explorer window, then select Open Command Line Window.
- Basic commands: ls shows the contents of the current folder, cd folder_name changes the current folder to "folder_name", mkdir folder_name creates a new folder named "folder_name" in the current folder.
- Use the tab extensively to save typing: type the first few characters of a file name or a folder name, hit ,tab and it will complete the name for you.
Installing the USBTinyISP driver
- Windows: download the driver here. Extract to a folder of your choice. Then go to Device Manager and Update Driver for FabISP pointing to that folder.
- Mac: might be recognized automatically (please correct me if you know better).
Install AVR C:
AVR C is the compiler we use for our Atmel microcontrollers.
What do Neil's makefiles do? The plain make command (the one we run without any additional parameters) turns the (sort of) human-readable C code into machine code the microcontroller can understand. make program-usbtiny-fuses sets the external clock (crystal), so you should only run it if your board has such a crystal. make program-usbtiny loads the code unto the microcontroller.
Download and install WinAVR for Windows or CrossPack for Mac.
Install Python
Python is pre-installed on Mac, cygwin, and on some (all?) Linux distributions. To test your installation, open a terminal window and type python. You should see the Python header and the version number, followed by a prompt. Type exit() then hit enter to quit. If your get an error message saying python isn't recognized, you should install Python.
Also, on Windows you will need to install Python yourself.
- Download the latest Python 2.x version and install it. Python 2.x is still more common than 3.x (as of November 2011), and it's recommended to use it to avoid compatibility issues with existing code.
- Add the Python folder to the system path: Press Start and type Edit the Environment Variables. From the window that opens, click Environment Variables. In the bottom section, scroll down to PATH, double-click it, and at (at the beginning) C:\Python27 (or whatever folder you chose to install Python to).
- From the Windows command prompt (Start then cmd), test your installation as explained above.
Install Python Modules
When you run Neil's Python scripts you may get an error message from Python saying certain modules (e.g., serial) are not recognized and there the script cannot be run. This means you need to install the packages that contain these modules.
Simplest way to add a package to your local installation of Python is by using easy_install (or similar utilities such as apt_get or pip). Type easy_install from a terminal window to check if it's already installed. If not, go get it:
- Go to the Python setuptools page.
- Windows 64-bit: download ez_setup.py to your Python directory, then open a command prompt at that directory and run python ez_setup.py.
- Windows 32-bit, Mac, cygwin: download the respective installation files and run them. If you get an error message that says something like "permission denied", you need to run the command as administrator (aka superuser). Do this by adding sudo before the command, e.g., sudo sh setuptools....
- On Windows, add either of the following directories to your system path: C:\Python27\Tools\Scripts\ or C:\Python27\Scripts -- inspect both to see to which one easy_install was added.
- Now use easy_install to install pySerial: easy_install pyserial
- If you use Python on cygwin, you should also install python-tk: easy_install python-tk
Install FTDI drivers
To be expanded...
- Install FTDI from FTDIchip site.
Debug with serial terminals
To be expanded...
- Find your serial port on Windows/Mac
- Find baud in the code.
All platforms: Arduino 1.0 (set port, board). Make sure to use release 1.0 that supports ATTiny (not 0.x)!
Windows only: PuTTY
Mac and Linux: screen
Note: the serial port can only be opened by one application at a time!