Programming on a Windows Machine
From Free Charge Controller
Follow these stop by step directions to set up the development environment on a Windows machine. You will need to follow these directions weather you writing your own firmware or simply re-flashing the board with the latest firmware.
Install WinAVR first, then install AVR Studio second. AVR Studio will detect the installation of WinAVR and use it for compiling programs from within AVR Studio.
Here are some additonal websites that you might find helpfull:
Create A Project in AVR Studio
Unpack the firmware
Unpack the firmware into a chosen directory.
Select a New Project
Select GCC Project
- Type in a name for the project under "Project name:"
- Uncheck "Create initial file"
- Under "Location", navigate to the directory where you unpacked the source code
- Select "AVR GCC"
Note: If "AVR GCC" is not an option, then AVR Studio is not able to detect your installation of WinAVR. Exit AVR Studio and reinstall WinAVR.
Tell AVR Studio Which Microcontroller You Are Using
Version 2.0 hardware uses an ATMega16 microcontroller.
- Select "AVR Simulator" (not "AVR Simulator 2") under "Debug platform:"
- Select "ATMega16" under "Device:"
- Click on "Finish"
Load Source Files and Compile
Add Source File to Project
- Right click on "Source Files"
- Select "Add Existing Source Files(s)..."
- Select "main.c" from the directory where you unpacked the firmware
- You can now double click the "main.c" file to edit the code
Build and Run Project
- Select "Build" -> "Build & Run" to compile the source
Program Charge Controller
Connect to AVRISP
- Make sure the AVRISP is plugged into the USB port.
- Click "Tools" -> "Program AVR" -> "Connect..."
Select AVR Programmer
- Select "AVRISP mkII" under "Platform:"
- Select "USB" under "Port:"
- Click "Connect"