A little glowing Halloween ghost: PWM control of the LED
This software is mainly written for atmega8.
See the following article for details:
http://tuxgraphics.org/electronics/electronics/200910/halloween-ghost-kit.shtml
Mac and Linux
To compile type the command:
make
To compile and load use:
make load
Setting the fuse bytes:
make fuse
What are fuses?
Microcontroller fuses are like the BIOS on a PC. It initializes the
hardware before the actual program loads.
In this case we need to set the clock speed to 8MHz
For this the fuses need to be set as follows:
avrdude: lfuse reads as E4
avrdude: hfuse reads as D9
That is you need to change the lfuse from the factory default to:
avrdude -p m8 -c stk500v2 -u -v -U lfuse:w:0xe4:m
This changing of fuses needs to be done only once and the settings
are persistent even if you erase the program on the chip.
The fuses can be change but there are some combinations which lock
up the chip so be careful.
Windows
If you run Windows and you have winavr installed then check the winmake.bat
file. Edit it and adjust the path as needed. After that just double click
on the winmake.bat file to compile.
There is also a winload.bat file to load the pre-compiled software.
Edit this file before using it and adjust the COM-port to the port
where avrusb500 appears to be connected.
Files
halloweenled.c # the c source code for ATmega8
halloweenled_pre.hex # pre-compiled loadable object in case you have
# trouble to compile the software
Makefile # Makefile
README.htm # this file
History:
version 0.1: 2009-10-11, first Version
-------------------------------------------
Copyright: GPL
Written by guido socher (guido at tuxgraphics.org)
-------------------------------------------