Homemade 100 HP Motor Controller for an Electric Car


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:

And download the free AVR Studio development environment:

The hex file of the code is available here.  Use "coug-unified-16k.hex":

Here's the code:

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!