Electronics project

Project For Engineers

working of ldr (light dependent resistance)

An LDR (Light dependent resistor), as its name suggests, offers resistance in response to the ambient light. The resistance decreases as the intensity of incident light increases, and vice versa. In the absence of light, LDR exhibits a resistance of the order of mega-ohms which decreases to few hundred ohms in the presence of light. It can act as a sensor, since a varying voltage drop can be obtained in accordance with the varying light. It is made up of cadmium sulphide (CdS). 

An LDR has a zigzag cadmium sulphide track. It is a bilateral device, i.e., conducts in both directions in same fashion

This circuit based project explains the principle of operation of LDR (light dependence resistor). The circuit has various applications like shadow alarm, automatic night/morning lamp. 

As the name suggests, LDR is a type of resistor whose working depends upon only on the light falling on it. The resistor behaves as per amount of light and its output directly varies with it. In general, LDR resistance is minimum (ideally zero) when it receives maximum amount of light and goes to maximum (ideally infinite) when there is no light falling on it.

A critical factor that decides LDR’s working is the frequency of light which should cross a threshold value so as to make LDR respond. Keep on reading to find out how the circuit is designed and how it is made to work.

Plasma vs LED: How They Work

Plasma vs LED: How They Work
Updated Feb 17, 2014 By Cedric Demers
Plasma

Plasma screens works by exciting tiny pockets of gas (Xenon and Neon) turning them into a plasma state. In that state, the electrons of that gas emits ultraviolet light which is not visible to the human eye. The ultraviolet light is then absorbed and re-emitted into the visible spectrum of light by the phosphor inside each cell. Each pixel consists of 3 sub pixels, one red, one blue and one green. The more excited the gas, the brighter the color produced.
The pixel is not excited continuously, but in short pulses. The naked eye perceives this as flickering. Some people are very sensitive to this. The effect is reduced on higher end models because the flickering is a lot faster.
Because each pixel emits its own light, the blacks are really deep. When the television wants to display black, it simply emits no light at all for the selected pixels. Also, there is less motion blur as seen sometimes on an LCD screen because the gas stop emitting lights immediately when it is not excited.
Plasmas suffer from occasional image retention if they display the same image for a very long period of time. They improved a lot on this subject in the last few years and permanent burn-ins are no longer an issue. The image retention, if one occurs, will typically disappear in a few minutes.
Unless you plan on displaying a static image for days at a time, you do not need to worry about this anymore. It is more of an issue in a public display where the same static ads are shown continuously.
LCD


A backlight is behind an LCD screen
An LCD screen is composed of 2 parts, the actual liquid crystal display and a light source at the back of the screen (called backlight). A light diffuser is placed between the backlight and the LCD screen to uniform the source of light equally across the screen.
The LCD screen does not emit light by itself; it only acts as a filter to block the light on a per pixel basis. The opacity of a pixel can be controlled by applying an electric field to it. If the screen wants to display black, the LCD pixel will try to block the light completely. If it wants to display white, it will let it through. Because the display is only a filter, the blacks will not be as deep as in a plasma screen. An LCD pixel, even if it displays black, will always let through a small portion of the light.
Contrary to a plasma, an LCD panel does not flicker. It works by a sample and hold method where the picture stays on during the whole time of the frame. On some TVs though, the backlight will flickers to adjust its brightness.
Applying an electric field to the screen and illuminating the back cost less energy than exciting the electrons in the plasma display, thus the overall power consumption of the television is lower (check out the chart here). Also, the luminosity of the screen can be higher because the backlight can be very bright. This makes an LCD TV more suitable than a plasma TV for a well-lighted room.
The viewing angle of the television (the angle off the screen where you can see the picture) is limited because the LCD filter screen has a depth. This is less of a problem nowadays because the depth of the LCD layer has been considerably reduced, which has improved a lot the viewing angle range.
There are 2 main types of backlights used in LCD screens: CCFL and LEDs.
CCFL


Conventional LCD backlight
When someone refers to an LCD TV, he usually refers to a CCFL (cold-cathode fluorescent lamps) backlighted LCD screen. This is how a normal LCD screen works. The backlight is a series of light tubes placed behind the screen. These tubes are very similar to the fluorescent lamp used almost everywhere, but smaller.
LCDs with CCFL backlight are on their way out of the market. Manufacturers stopped producing them. They are getting replaced by LED TVs. They have the same screen but have LED lights instead of a CCFL tube for the backlight. This reduces the manufacturing cost of


LED

An LED screen as normally referred is actually an LCD screen, but instead of having a normal CCFL backlight, it uses light-emitting diodes (LEDs) as a source of light behind the screen. An LED is more energy efficient and a lot smaller than a CCFL, enabling a thinner television screen. Marketing made a lot of fuss about LED TVs, but it is only the backlight that changed, so there is actually no picture quality improvement over a normal LCD screen.
There have been prototypes of real LED TVs. They didn't have an LCD panel but instead had 3 small colored LEDs per pixel. These would have been a lot better but unfortunately the manufacturing cost was way too high to be profitable. OLED TVs are very similar to this and will hopefully become affordable in a few years.
There are three main configurations of LED as backlights for television screens: full array, edge lit and direct lit.
Full array

Full array LED backlight
This method is considered the best LED backlight type, but can only be found on a very limited number of models.
In a full array LED screen, the LEDs are distributed evenly behind the entire screen. This produces a more uniform backlight and it provides a more effective use of local dimming, where it can change the luminosity of only a specific part of the screen.
On some TVs, like the XBR line of Sony, they use colored LEDs instead of white ones. Technically, this can create an even greater color range gamut by matching the backlight color with the picture. In practice though, you will not really see the difference.
Edge lit

Edge-lit LED backlight
This is the most common method for LED TVs.
In an edge lit LED screen, the LEDs are placed at the peripheral of the screen. Depending on the television, it can be all around the screen or only on the sides or the bottom. This allows the screen to be very thin.
However, it can cause some spots on the screen to be brighter than others, like the edges. This problem is called flashlighting or clouding. It can be seen when watching a dark scene in a dark environment.
Direct lit

Direct lit LED backlight
This is how the lower end LED TVs are constructed.
Similarly to the full array method, the LEDs are directly behind the screen. However, there are very few of them and they cannot be controlled separately to match the luminosity of the picture.
These TVs are not very thin because of the space required behind the screen to add the LEDs and to diffuse the light over a big area.
NEXT PAGE PREVIOUS PAGE

Best LED TVs by Size of 2014

Best 32 inch LED TVs
Best 40-42 inch LED TVs
Best 46-47-48 inch LED TVs
Best 50 inch LED TVs
Best 55 inch LED TVs
Best 60 inch LED TVs
Best 65 inch LED TVs
Best LED TVs by Price of 2014

Best LED TVs under $500
Best LED TVs under $1,000
Best LED TVs under $1,500
Best LED TVs under $2,000
Questions

Mar 19, 2013
I watch a lot of sports and movies. I plan to buy a 60" for my basement home theater. The room is very dark, I'm torn between led or plasma. I'm told LEDs last longer vs Plasma. How long does a plasma usually last? What do you recommend? I'm looking at the Samsung 8000.
It is hard to compare the longevity of such products. While technically LEDs will last longer, in real life scenarios it doesn't matter. Common components (like the electronics board) will fail at around the same time. Longevity is more impacted by the quality of the model and brand. If you buy a quality set, it should last long enough for that technology to become obsolete unless you are unlucky. Most electronics will break due to a capacitor failure. For example, there was a class action lawsuit against Samsung for putting cheap capacitors in all their TVs a few years ago.

Even or odd function program in c

c program to check odd or even: We will determine whether a number is odd or even by using different methods all are provided with a code in c language. As you have study in mathematics that in decimal number system even numbers are divisible by 2 while odd are not so we may use modulus operator(%) which returns remainder, For example 4%3 gives 1 ( remainder when four is divided by three). Even numbers are of the form 2*p and odd are of the form (2*p+1) where p is is an integer.

C program to check odd or even using modulus operator
#include<stdio.h>

main()
{
   int n;

   printf("Enter an integer\n");
   scanf("%d",&n);

   if ( n%2 == 0 )
      printf("Even\n");
   else
      printf("Odd\n");

   return 0;
}
We can use bitwise AND (&) operator to check odd or even, as an example consider binary of 7 (0111) when we perform 7 & 1 the result will be one and you may observe that the least significant bit of every odd number is 1, so ( odd_number & 1 ) will be one always and also ( even_number & 1 ) is zero.

C program to check odd or even using bitwise operator
#include<stdio.h>

main()
{
   int n;

   printf("Enter an integer\n");
   scanf("%d",&n);

   if ( n & 1 == 1 )
      printf("Odd\n");
   else
      printf("Even\n");

   return 0;
}
Find odd or even using conditional operator
#include<stdio.h>

main()
{
   int n;

   printf("Input an integer\n");
   scanf("%d",&n);

   n%2 == 0 ? printf("Even\n") : printf("Odd\n");

   return 0;
}
C program to check odd or even without using bitwise or modulus operator
#include<stdio.h>

main()
{
   int n;

   printf("Enter an integer\n");
   scanf("%d",&n);

   if ( (n/2)*2 == n )
      printf("Even\n");
   else
      printf("Odd\n");

   return 0;
}
In c programming language when we divide two integers we get an integer result, For example the result of 7/3 will be 2.So we can take advantage of this and may use it to find whether the number is odd or even. Consider an integer n we can first divide by 2 and then multiply it by 2 if the result is the original number then the number is even otherwise the number is odd. For example 11/2 = 5, 5*2 = 10 ( which is not equal to eleven), now consider 12/2 = 6 and 6 *2 = 12 ( same as original number). These are some logic which may help you in finding if a number is odd or not.

six sense technology

WATCH VIDEO OF SIX SENCE TECHNOLOGY




It’s the beginning of a new era of technology where engineering will reach new milestones. Just like in the science fiction movies where display of computer screen appears on walls, commands are given by gestures, the smart digital environment which talks to us to do our work and so on, these all will be possible very soon. You imagine it and sixth sense technology will make it possible. Isn’t it futuristic? Now it’s time for sci-fi movie directors to think ahead because the technology shown in there fiction movies soon will become household stuff. Before few years back it was considered to be supernatural or tantalizing imagination. But now it has been made possible. Thanks to Pranav Mistry, a genius who introduced mankind to this futuristic technology.

What is sixth sense?
Sixth Sense is a wearable gestural interface that enhances the physical world around us with digital information and lets us use natural hand gestures to interact with that information. It is based on the concepts of augmented reality and has well implemented the perceptions of it. Sixth sense technology has integrated the real world objects with digital world. The fabulous 6th sense technology is a blend of many exquisite technologies. The thing which makes it magnificent is the marvelous integration of all those technologies and presents it into a single portable and economical product. It associates technologies like hand gesture recognition, image capturing, processing, and manipulation, etc. It superimposes the digital world on the real world.

Sixth sense technology is a perception of augmented reality concept. Like senses enable us to perceive information about the environment in different ways it also aims at perceiving information. Sixth sense is in fact, about comprehending information more than our available senses. And today there is not just this physical world from where we get information but also the digital world which has become a part of our life. This digital world is now as important to us as this physical world. And with the internet the digital world can be expanded many times the physical world. God hasn’t given us sense to interact with the digital world so we have created them like smart phones, tablets, computers, laptops, net books, PDAs, music players, and others gadgets. These gadgets enable us to communicate with the digital world around us.
But we’re humans and our physical body isn’t meant for digital world so we can’t interact directly to the digital world. For instance we press keys to dial a number; we type text to search it and so on. This means for an individual to communicate with the digital world he/she must learn it. We don’t communicate directly and efficiently to the digital world as we do with the real world. The sixth sense technology is all about interacting to the digital world in most efficient and direct way. Hence, it wouldn’t be wrong to conclude sixth sense technology as gateway between digital and real world.  Before Wear Ur World (WuW) came there were other methods like speech recognition software, touch recognition etc., which empowered us with direct interfacing.

This WuW or sixth sense device invented by Pranav Mistry is a prototype of next level of digital to real world interfacing. It comprises of a camera, a projector, a mobile cum computing device and colored sensors which are put on the fingers of a human being. The device efficiently senses the motion of the colored markers. Using them it provides us the freedom of directly interacting with the digital world. This technology enables people to interact in the digital world as if they are interacting in the real world.




Why choose sixth sense technology?
Humans take decisions after acquiring inputs from the senses. But the information we collect aren’t enough to result in the right decisions. But the information which could help making a good decision is largely available on internet. Although the information can be gathered by connecting devices like computers and mobiles but they are restricted to the screen and there is no direct interaction between the tangible physical world and intangible digital world. This sixth sense technology provides us with the freedom of interacting with the digital world with hand gestures. This technology has a wide application in the field of artificial intelligence. This methodology can aid in synthesis of bots that will be able to interact with humans.

solar mailbox project



The purpose of this project is to develop a self sufficient Mailbox (real one) that will be powered only by the sun and that will display the number of the house, but only in accordance with the battery level. The system must work autonomously when there is or not enough light to charge the battery.


At night: Central Digit On, other one in PWM Modes
The Mailbox is powered by a 5V/80mA Polysilicon solar cell. The sun energy is used to charge a 3 AA NiMH battery.
At night, when there is no light, the PIC is driving the 3 Digit according with a sequence which is defined in its program given in Annex.

  

Schematic Explanation


click on image to download full resolution schematic


Charger_Control: The Solar Cell is charging the 3 AA NiMH cell trough the “Sziklai pair” composed by the T5 (2N2907) and T4 (1N1711). This is necessary to ensure a very low reverse current when the sun is off and the battery at full charge. Control of the charge can be applied on D5 with a "1" level from the PIC , which will reverse the T6 that define the current in T5 base. For Battery protection purpose, the value of Zener diode DZ6 must be 4.6V to prevent the battery for over-charging which will degrade significantly its life time. This function is not yet managed by the PIC program and is reserved for further use.

LED_OR_control: The 3 digits are controlled by 3 separate 2N1711 (each digit is compose about 20 white LED). The control signal is the OR between a PWM signal, that ensure a constant background level of light plus a "blinking" part which is the sequence generated by the PIC.

Sun_Sense: Just a low pas filter composed of R8 and C6. Beware that leakage current from the PIC can affect the level. This prevent R8 to be bellow 39KOhms.

Vbat_sense: These 2 diodes in serial create a 1.3V constant voltage that can be measured by the PIC to determine the level of the battery. This function is not yet managed by the PIC program and is reserved for further use.

Cpu: The PIC16F628 operates with a 32.768KHz crystal oscillator. This frequency have been selected, not to consume too much. In this condition, the PIC is able to operate down to 3V.


Internal Wiring



PCB zoom


Behavioral Explanations

Apart when the Battery is totally low, the PIC is running and infinity loop which period is approximately 1 second, the red led is blinking accordingly.
During day light the SunSense signal is high and the PIC is not performing any operation (than the 1 second blinking loop). The Green led is on. If the battery voltage is low enough, the Solar cell is charging it. If the Battery voltage is above 4.6V (3 times 1.3V), then the DZ6 is drawing the current to ground protecting the battery cells. In the future Vbat_sense and Stop_Charge should be used.
During night the SunSense signal get low and the PIC is programmed to:

- Generate a PWM signal (100Hz, Duty Cycle of 5%) on the PWM pin

- Generate a "blinking" sequence on the 3 separate control signals (1 minute period)

Simple optical switch


Introduction
The 555 is proved to be the most versatile and ubiquitous IC all over the world.This is a possible use: simple inverting schmitt trigger.

Circuit explanation

When the phototransistor is stroken by IR light it conducts and the voltage between the 1Mohm resistor(arbitrary) and the phototrans drops from VCC to lower values. When the voltage drops lower than VCC/3 the 555 is triggered and goes high (from 0 TO VCC). The amount of light that strike the phototrans necessary to bring his collector to VCC/3 is determined by the resistor (Vdrop = Icollector * R , so , if Vdrop= 2*VCC/3, the resistance needed to set the threshold on current is R=2*VCC/(Icollector*3)). High sensibility phototrans would need a smaller resistor, and weaker phototransistors higher value resistor, you can also use a trimmer to set the on threshold level with precision. The time of phototransistor isn't critical. The 555 has high current capability and can drive various devices, such as Bipolars, relays, bipolars+relays, mosfets, mosfets + totem pole , or give a logic output (see pic).




In case you need to trigger something when the gate is blocked (for example a burglar alarm, or a multistage coilgun) you need to invert the output, which is accomplished using a small bipolar transistor wired in an inverting setup (see pic) or swapping the positions of phototransistor with the resistor, so the voltage will drop under VCC/3 when blocked: The formula to determine the resistance to turn off at Icollector is R=VCC/(Icollector*3).

Have fun!

Led effect





This project I made for my little daughter. It is 24 channel light illumination. The schematic is very simple – 24 LED’s, 1 MCU and some additional components. The main principle is dynamic indication, which is usually implemented for control of 7-segment digital indicators. Here is the same, as for indicators are used traditional 5-mm LED’s.
For control unit is implemented not expensive MCU ATTYNI2313 (Atmel), which can drive direct LED (up to 20 mA on each pin). As you can see on the schematic, 24 LED’s are grouped in 4 groups, each one consist 6 LED’s. LED’s in group 1 indicate the content of register r0 of MCU, LED’s in group 2 – r1, LED’s in group 3 – r3 and LED’s in group 4 indicate the content of register r3. Dynamic indication do this, as in each moment of time indicates content of one register and scans them consecutive. For instance, when the content of r1 is loaded in output port (PORTB), the transistor Q2 is switched "ON", and the LED of group 2 indicate the bits in r1.


There are 3 buttons – "F", "+" and "-". The button F is for change of effect, and buttons "+" and "–" are for increasing or decreasing the speed of effect. For example, each time when you press button "-" changing of lights go more slowly. For fast changing of speed you can press and hold the appropriate button.
The speed of effects is independent of speed of dynamic indication, which is constant.
The schematic can be powered by any DC adapter for 8 to 15 V / 100mA. I use 12V adapter and for the stabilizer 7805 there is no need of heat sink for them – this is one of advantages of implementation of dynamic indication. Others advantages are simple schematic and PCB, lower pin count of MCU etc.


Software is written in assembler of IDE AVRStudio 4. The program code is below. There are a lot of comments for explanation how the program works. With simple changes in code everyone can make different effects and/or add them. Each effect can be up to 24 stages.
If the LED pins are made longer with additional wires, LED effects can be used for Christmas tree or for advertising text on shop window (for instance). If there is need, LED number can be easy increased up to 32 LED’s and stages. Enjoy!





Schematic




Download design files in Proteus 7 format

Source Code


;*****************************************************************
;LED illumination
;rev. 4, 06/09/2010god
;MCU ATtiny2313 , internal RC generator, 4 MHZ
;*****************************************************************
.include "2313def.inc" ;Done some changes for ATtiny2313 !
; r0 - consits group 1
; r1 - consits group 2
; r2 - consits group 3
; r3 - consits group 4
; r4 - counter of groups for Effect 1
; r5 - counter of groups for Dynamic Indication
; r6 - counter of effects
.cseg
.org $000
                rjmp RESET ;Reset Handle
                reti ;LabINT0; External Interrupt0 Vector Address
                reti ;LabINT1; External Interrupt1 Vector Address
                reti ;TIM1_CAPT; Timer/Counter1 Capture Event
                reti ;TIM1_COMP; Timer/Counter1 Compare Match A
                reti ;TIM1_OVF; Timer/Counter1 Overflow
                rjmp TIM0_OVF; Timer/Counter0 Overflow
                reti
                reti
                reti
                reti
;************************************************
TIM0_OVF: ;it does dynimic indication
                mov r16, r5 ; couter is loaded
                clz
                cpi r16, 0 ; if is 0 then group 1
                breq Tvar1
                clz
                cpi r16, 1 ; if is 1 then group 2
                breq Tvar2
                clz
                cpi r16, 2 ; if is 2 then group 3
                breq Tvar3
                rjmp Tvar4 ; else group 4
Tvar1:  
                mov r16, r0
                out PORTB, r16
                cbi PORTD, PD3 ; clear group 4
                sbi PORTD, PD0 ; indicate group 1
                inc r5
                rjmp Tizhod
Tvar2:
                mov r16, r1
                out PORTB, r16
                cbi PORTD, PD0 ; clear group 1
                sbi PORTD, PD1 ; indicate group 2
                inc r5
                rjmp Tizhod
Tvar3:
                mov r16, r2
                out PORTB, r16
                cbi PORTD, PD1 ; clear group 2
                sbi PORTD, PD2 ; indicate group 3
                inc r5
                rjmp Tizhod
Tvar4:
                mov r16, r3
                out PORTB, r16
                cbi PORTD, PD2 ; clear group 3
                sbi PORTD, PD3 ; indicate group 4
                clr r5
Tizhod:
                sei
                reti
;************************************************
Efekt1:
                in r17, TIFR ;chek if TMR1 is overtime
                sbrs r17, TOV1
                rjmp E1izh ;if not overtime -> go out
                ldi r17, $80 ; clear interrupt flag
                out TIFR, r16
                sec ; flag C = 1
                rol r0 ; load 1 through flag C
                bst r0,6 ; load the bit through flag T into next register
                rol r1 ;
                bld r1,0
                bst r1,6
                rol r2
                bld r2,0
                bst r2,6
                rol r3
                bld r3,0
                bst r3,6
                brts E1Clr ; check for finishing (last bit in last register)
                rjmp E1izh
E1Clr:
                clr r0 ; clear all registers
                clr r1
                clr r2
                clr r3
E1izh:
                ret
;************************************************
Efekt2:
                in r17, TIFR ;;chek if TMR1 is overtime
                sbrs r17, TOV1
                rjmp E2izh ;if it is not -> go out
                ldi r17, $80 ;clear interrupt flag
                out TIFR, r16
                mov r17, r4 ; load counter
                clz
                cpi r17, 0 ; if 0 rolling r0
                breq E2var0
                clz
                cpi r17, 1 ; if 1 rolling r1
                breq E2var1
                clz
                cpi r17, 2 ; if 2 rolling r3
                breq E2var2
                rjmp E2var3 ; else rolling r3
E2var0:
                clc ; flag C = 0
                rol r0 ; load 1 through flag C
                sbrc r0, 6 ;check if first 6 bits are 0's
                rjmp E2izh ; if are not -> go out
                clc ; if it is -> rolling next register
                rol r1 ; (in this case r1)
                rjmp E2izINC
E2var1:
                clc ; flag C = 0
                rol r1 ; load 1 through flag C
                sbrc r1, 6 ;check if first 6 bits are 0's
                rjmp E2izh ; if are not -> go out
                clc ;if it is -> rolling next register
                rol r2 ; (in this case r2)
                rjmp E2izINC
E2var2:
                clc ; flag C = 0
                rol r2 ; load 1 through flag C
                sbrc r2, 6 ;check if first 6 bits are 0's
                rjmp E2izh ; if are not -> go out
                clc ;if it is -> rolling next register
                rol r3 ; (in this case r3)
                rjmp E2izINC
E2var3:
                clc ; flag C = 1
                rol r3 ; load 1 through flag C
                sbrc r3, 6 ;check if first 6 bits are 0's
                rjmp E2izh ; if are not -> go out
                ldi r17, $FF ;if they are -> each bit is set
                mov r0, r17
                mov r1, r17
                mov r2, r17
                mov r3, r17
E2izINC:
                inc r4 ;this fragment increase counter (r4)
                mov r17, r4
                clc
                cpi r17, 4 ;if it is = 4, then it is cleared
                brlo E2izh ;to start again
                clr r4 ;r4=0 , or it pointes r0
E2izh:
                ret
;************************************************
Prog1: ;Main program
                sbis PORTD, PD4 ;check for pressing button "+"
                rjmp IncTmr
                sbis PORTD, PD5 ;check for pressing button "-"
                rjmp DecTmr
                sbis PORTD, PD6 ;check for pressing button "F"
                rjmp EfSel ;(for change of effect
                mov r17, r6 ; load effect counter
                clz
                cpi r17, 0 ; if 0 then roll r0
                breq PRvar0
                rcall Efekt2
                rjmp Prog1
PRvar0:
                rcall Efekt1
                rjmp Prog1
IncTmr:
                ldi r17,TCNT1H
                clz
                cpi r17, $FC ;check for max value
                breq IncOut ;$FC is max value
                inc r17
                out TCNT1H, r17
IncOut:
                rjmp Prog1
DecTmr:
                ldi r17,TCNT1H
                clz
                cpi r17, $CC ;check for max value
                breq DecOut ;$CC is max value
                dec r17
                out TCNT1H, r17
DecOut:
                rjmp Prog1
EfSel:
                mov r17, r6
                clz
                cpi r17, 1 ;check for max value
                breq EfSel1 ;$1 is max value
                inc r6 ;(2 effects)
                rjmp Prog1
EfSel1:
                clr r6
                rjmp Prog1
;************************************************
Reset: ;Initiation section
                ldi r16, $DF ;STACK forming
                out SPL, r16        
                ldi r16,$FF ;Init. Port B
                out DDRB, r16 ;B0 - B7 are outputs
                ldi r16,$0F ;Init. Port D
                out DDRD, r16 ;D0 - D3 are outputs
; D4, D5 and D6 are inputs
                clr r16
                out PORTD, r16 ;clear all groups
                clr r0 ;clear all registers
                clr r1
                clr r2
                clr r3
                clr r4 ;clear counter for Effect 1
                clr r5 ;clear counter for Dynimic Indication
                clr r6 ;clear counter of effects
                ldi r16, 3  ; 8-bit Timer
                out TCCR0B, r16 ;Prescaler=1/64
                ldi r16, 3  ; 16-bit Timer
                out TCCR1B, r16 ;Prescaler=1/64
                ldi r16, $E7 ;load E795 for time interval 0,1s
                ldi r17, $FF
                out TCNT1H, r16 ; first is high Byte
                out TCNT1L, r17 ; second is low Byte
                sei  ; enable global interrupt
                ldi r16, 2 ; enable TMR0 interrupt
                out TIMSK, r16
                rjmp Prog1 ; end of initialisation section
.exit




PCB