Instructables

Homemade 100 HP Motor Controller for an Electric Car

Featured

Step 5: Program the ATMega168 Microcontroller

Once the ATMega168 arrives with all the other stuff, you need to program it with the motor controller code.  Either make your own code, or use/modify the code below.  

You can make a very cheap ATMega168 programmer, or buy an AVRISP MK2:
http://search.digikey.com/scripts/DkSearch/dksus.dll?Cat=2621880&k=avrisp

And download the free AVR Studio development environment:
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725

The hex file of the code is available here.  Use "coug-unified-16k.hex":
http://www.adambrunette.com/firmware/cougar-v1.11b/hexfiles-m168/

Here's the code:
http://ecomodder.com/wiki/index.php/Open_ReVolt/Software

The fuse bits are Extended High Low = F8 DC F7.  But if you are using Ponyprog, the fuse bits are 08 DC F7.

If you don't want to bother to program it yourself, then you can buy a preprogrammed one.

 
Remove these adsRemove these ads by Signing Up
Those are quite possibly the creepiest eyes I have ever seen!