Rubashka Vasiliy , Ukraine , 2007
In eve of the New Year is accepted present the gift.
Particularly expensive and remembering become create
their own hand.
The Idea of the snowflake much forgive; pardon - a
catch "alive" snowflake, consider, catch following and etc until will
come lighting up. Better, than created the Creator, us not under power, but
here is try to do the cheap copy with this amazing original I have tried. That
was thereof got, judge You.
The Snowflake is physically collected on two printed
charges - 259 very bright lightly blue led on one and microcontroller ATMEGA16
with transistor key - on another. The Charge attach between itself
single-in-line connector - by manifold valve. It is more comfortable for
montage and further service. The Electronic scheme on microcontroller forms 32
independent channels with width-pulse inflexion. The Circuitry of the screen -
a snowflakes is collected in 32 channels with mixed (parallel-consequent) by
cut-in led. The Location led on screen was perfected on simulator, but their
12-beam symmetry was "spy on". Unique software has allowed to create
bright, colorful, dynamic effect, which will decorate any holiday. The Program
(BASCOM AVR) generates non-recurring, is sailing going friend in friend patterns. At start program
reads from nonvolatile memory EEPROM casual number, which is seasonally updated
in operation always to start with
miscellaneous of the effect that will add else greater showing.
At repetition of the designs montage
follows to begin with board of the controller. The having Interweaved
controller and having exposed FUSE for functioning (working) from internal RC
generator on 8 MHZ, as well as unplugged JTAG, install its on a board. Unsolder
transistor keys with stud, possible proceed the scheme with checking. The
Resistor 1 lump connect to cathode of the led, anode of the led on +12В, free drumstick of the resistor alternately to each
of 32 outputs. We Observe fluent change to brightness of the led. If all
orderly, go to the following stage - a montage of the board with led. In the
beginning jumpers and comb, then several light-emitting diod channel, as from
the centre. Under switched off power supply стыкуем the board and check functioning a device. The Main
error - a wrong cut-in led. We Continue the montage before full victory. One
advice: if you want that snowflake to be
on glory, do not feel sorry the money on leds. Recommend to use with angle of
the review 180 degrees and brightness more 0,5 cd. Power supply from network
adapter 12В 500мА. The Snowflake will gain the more noble type if its decorate the
decorative bracket. In is made from PVH plastic arts and is painted in steel color
by aerosol enamel for cars. I was
made several snowflakes of the miscellaneous of the color. But the most
striking, in my glance, are snowflake from blue led. If will use red or yellow
leds, come to change the resistances a resistor, noted asterisk, on the
following: R1- 560 Ohm, R2, R4 - 82 Ohm,
R3, R5 - 160 Ohm. For blue, green and
white led of the resistance is specified on scheme. Schematic:
PCB:
Program:
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'@ Filename : SNOWFLAKE * * * @
'@ Revision : 1.0 * * * * * * @
'@ Controller : ATMEGA16 * * * * * * * * @
'@ Compiler : BASCOM-AVR 1.11.9.0 * * * *** * * *** @
'@ Author : Rubashka Vasiliy, Ukraine, 2008 * * * * * @
'@ WWW * : http://ledeffects.net * * * @
'@ Mail : info@ledeffects.net * * @
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'
' !!!!! F U S E B I T !!!!!
'
'LOCKBITS [FF] --------------------------------------------------------------------------------
'Lockbit 65 11:No restrictions for SPM or LPM accessing the boot loader section
'Lockbit 43 11:No restrictions for SPM or LPM accessing the application section
'Lockbit 21 11:No memory lock features enabled for parallel and serial programming
'FUSEBITS [E4] --------------------------------------------------------------------------------
'Fusebit C 1:BODLEVEL 2.7V
'Fusebit B 1:BODEN disabled
'Fusebit KLA987 100100:Int. RC Osc. 8 MHz; Start-up time: 6 CK + 64 ms; [CKSEL=0100 SUT=10]
'FUSEBITS HIGH [DF] --------------------------------------------------------------------------------
'Fusebit High M 1:Disable OCD
'Fusebit High J 1:Disable JTAG
'Fusebit High l 0:SPI enabled
'Fusebit High H 1:CKOPT 1
'Fusebit High G 1:Erase EEPROM when chip erase
'Fusebit High FE 11:128 Words boot size , F80
'Fusebit High D 1:Reset vector is $0000
'#####################################################################################################
$crystal = 8000000 'internal generator 8 MHz
$regfile = "m16def.dat"
'Âńĺ ďîđňű - íŕ âűőîä
Config Porta = Output
Config Portb = Output
Config Portc = Output
Config Portd = Output
Enable Interrupts 'we allow interruptions
Config Timer0 = Timer , Prescale = 1 'we adjust timer
Enable Timer0 'we allow functioning(working) the timer 0
On Timer0 Pwms 'work on taymer 0
Stop Timer0 'stop timer 0
Dim Led(32) As Byte 'variable brightness led
Dim X(32) As Byte 'brightness led from table of brightness
Dim Channel As Byte 'counter channel
Dim Lamda As Byte 'additional variable
Dim Tetta As Byte 'additional variable
Dim Tik As Byte 'counter teak timer
'#####################################################################################################
'Reading to variable brightness led recorded in previous session of the work
'that effect began with new place every time
For Channel = 1 To 32
Readeeprom Led(channel) , Channel
Next
Start Timer0 'start timer 0
'#####################################################################################################
Do 'Main cycle
'Perebor brightness all 32 channels from table of brightness on circle
'length of the circle of each channel differs on unit from other,
'so repetition effect does not exist.
'Small calculation: 1 channel - 32 steps, 2 channels - 31 steps, coincidence approaches through 32*31=992 step
'In our event 32 channels with at a walk from 192 before 160: 192*191*190* ... *162*161*160 = 1,2 e+74. !!!!!!!!!!
For Tetta = 1 To 32
For Channel = 1 To 32
Incr Led(channel)
Lamda = 192 - Channel
If Led(channel) = Lamda Then Led(channel) = 0
X(channel) = Lookup(led(channel) , Pwm_led)
Next
Writeeeprom Led(tetta) , Tetta 'Record to variable brightness led, for following session of the work
Next
Loop 'End main cycle
'#####################################################################################################
Pwms: 'work on timer 0 - an organization PWM
Incr Tik
If Tik = 255 Then
Tik = 0
Porta = 0
Portb = 0
Portc = 0
Portd = 0
End If
If Tik > X(1) Then Portb.0 = 1
If Tik > X(2) Then Portb.1 = 1
If Tik > X(3) Then Portb.2 = 1
If Tik > X(4) Then Portb.3 = 1
If Tik > X(5) Then Portb.4 = 1
If Tik > X(6) Then Porta.5 = 1
If Tik > X(7) Then Porta.4 = 1
If Tik > X(8) Then Porta.3 = 1
If Tik > X(9) Then Porta.2 = 1
If Tik > X(10) Then Porta.0 = 1
If Tik > X(11) Then Porta.1 = 1
If Tik > X(12) Then Porta.6 = 1
If Tik > X(13) Then Porta.7 = 1
If Tik > X(14) Then Portc.7 = 1
If Tik > X(15) Then Portb.7 = 1
If Tik > X(16) Then Portd.0 = 1
If Tik > X(17) Then Portb.6 = 1
If Tik > X(18) Then Portb.5 = 1
If Tik > X(19) Then Portc.6 = 1
If Tik > X(20) Then Portc.5 = 1
If Tik > X(21) Then Portd.1 = 1
If Tik > X(22) Then Portd.2 = 1
If Tik > X(23) Then Portd.3 = 1
If Tik > X(24) Then Portc.3 = 1
If Tik > X(25) Then Portc.4 = 1
If Tik > X(26) Then Portd.4 = 1
If Tik > X(27) Then Portd.5 = 1
If Tik > X(28) Then Portd.6 = 1
If Tik > X(29) Then Portc.2 = 1
If Tik > X(30) Then Portc.1 = 1
If Tik > X(31) Then Portc.0 = 1
If Tik > X(32) Then Portd.7 = 1
Return
'#####################################################################################################
Pwm_led: 'Table to brightness led
'special location of importances of brightness in table allows under consequent choice is sailled light - extinguish leds,
'herewith being more halfs of time in switched off condition for building pattern , filled less than by half
Data 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255
Data 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255
Data 254 , 253 , 252 , 250 , 249 , 247 , 244 , 241 , 237 , 231 , 224 , 204 , 202 , 186 , 166 , 139 , 105 , 59
Data 0 , 59 , 105 , 139 , 166 , 186 , 202 , 204 , 224 , 231 , 237 , 241 , 244 , 247 , 249 , 250 , 252 , 253
Data 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255
Data 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255
Data 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255
Data 254 , 253 , 252 , 250 , 249 , 247 , 244 , 241 , 237 , 231 , 224 , 204 , 202 , 186 , 166 , 139 , 105 , 59
Data 0 , 59 , 105 , 139 , 166 , 186 , 202 , 204 , 224 , 231 , 237 , 241 , 244 , 247 , 249 , 250 , 252 , 253
Data 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255
Data 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255
'##################################################################################################### |