it's only for test the compiler winavr on my vista lap-top, and it works great, including DASA programer!
please look this video of the device working . . ..
the code (C code) looks like :
/**************************************************************************
darus67
20 October 2007
**************************************************************************/
#include
#define FADE_RATE 20 // the larger this value, the slower
// the LED will fade
#define INITIAL_WIDTH 128 // the starting value of the PWM pulse
// this is about 50% pulse width
void fade(char bit){
/**************************************************************************
Use pulse width modulation to cause LEDs on Port B to fade out
LEDs corresponding to high bits in 'bit' will fade out
**************************************************************************/
unsigned char rate = FADE_RATE;
unsigned char pulse_width = INITIAL_WIDTH;
unsigned char count;
while(pulse_width){ // as long as pulse_width is non-zero
// loop through the PWM routine
PORTB |= bit; // turn on the LED
for(count=0; count
// the currently lit one
}
// scan from left to right, with the trailing LED fading out
for(b=0x40; b; b>>=1){ // We're shifting b right instead of left this time
PORTB = b; // turn on the LED
fade(b<<1);>
it compiles error free using Winavr (under PN software)
Winavr can be downloaded H E R E
PN software is also packed with the executable installer
Note that this code fade-out always the last LED emulating true oldest bulbs's filaments that were used on the original effect...
About the programmer:
The software used for download the firmware was AVRDUDE (in winavr) with
DASA variation, it is avery very simple bit-banging programmer, so you only need the serial port and some resistors, diodes and that's all.
About the circuit:
not much to tell, only connect eight LED's on PORT outputs, the oscilator used is the internal one. the con sub-db9 is for programming only.
That's all guys, See ya !
.::Dastechnik::.
.::Hack on ::.
.::Hack on ::.