____________________________________________________________________________________________________
1. Circuit Diagram Of LED interfacing with AVR (ATmega16) ________________________________________________________________________________________________ ____________________________________________________________________________________________________ _______________________________________________________________________________________________ Content for the tab VIDEO
1.Program of SINGLE LED GLOW With ATmega16
/******************************************************
www.firmcodes.com
DEVELOPED BY:- FIRMWARE DEVELOPER
WHAT PROGRAM DO:- BLINK LEDs ON PORTA
******************************************************/
#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRA=0XFF;
while(1)
{
PORTA=0xff;
_delay_ms(2);
PORTA=0X00;
_delay_ms(2);
}
}
PROTEUS File for SIMULATION(Password Of RAR file is :-firmcodes.com)
2. Program of ALTERNATE LED GLOW With ATmega16
/******************************************************
www.firmcodes.com
DEVELOPED BY:- FIRMWARE DEVELOPER
WHAT PROGRAM DO:-ALTERNATE LEDs BLINK ON PORT2
******************************************************/
#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRA=0XFF;
while(1)
{
PORTA=0XAA;
_delay_ms(300);
PORTA=0X55;
_delay_ms(300);
}
}
PROTEUS File for SIMULATION(Password Of RAR file is :-firmcodes.com)
3. Program of DIFFERENT PATTERN LED GLOW with ATmega16
/******************************************************
www.firmcodes.com
DEVELOPED BY:- FIRMWARE DEVELOPER
WHAT PROGRAM DO:- THREE DIFFERENT PATTERN OF LEDS ON PORTA
******************************************************/
#include<avr/io.h>
#include<util/delay.h>
#include<math.h>
#define led PORTA
void delay();
char ar[]={0x81,0x42,0x24,0x18,0x24,0x42,0x81};
void main()
{
int n,j,i;
DDRA=0XFF;
while(1)
{
n=2;
while(n--)
{
for(i=0;i<8;i++)
{
led=pow(2,i);
/* pow is function defined in math.h it make power of 2 as i
when i=0, pow(2,i)=1;
when i=1, pow(2,i)=2;
when i=2, pow(2,i)=4;
when i=3, pow(2,i)=8;*/
delay();
}
for(i=7;i>=0;i--)
{
led=pow(2,i);
/* pow is function defined in math.h it make power of 2 as i
when i=0, pow(2,i)=1;
when i=1, pow(2,i)=2;
when i=2, pow(2,i)=4;
when i=3, pow(2,i)=8;*/
delay();
}
}
n=2;
while(n--)
{
for(i=0;i<7;i++)
{
led=ar[i];
delay();
}
}
n=2;
while(n--)
{
led=0x00;
delay();
led=0x01;
delay();
led=0x03;
delay();
led=0x07;
delay();
led=0x0f;
delay();
led=0x1f;
delay();
led=0x3f;
delay();
led=0x7f;
delay();
led=0xff;
delay();
led=0xfe;
delay();
led=0xfc;
delay();
led=0xf8;
delay();
led=0xf0;
delay();
led=0xe0;
delay();
led=0xc0;
delay();
led=0x80;
delay();
led=0x00;
delay();
led=0x80;
delay();
led=0xc0;
delay();
led=0xe0;
delay();
led=0xf0;
delay();
led=0xf8;
delay();
led=0xfc;
delay();
led=0xfe;
delay();
led=0xff;
delay();
led=0x7f;
delay();
led=0x3f;
delay();
led=0x1f;
delay();
led=0x0f;
delay();
led=0x07;
delay();
led=0x03;
delay();
led=0x01;
delay();
led=0x00;
delay();
}
}
}
void delay()
{
_delay_ms(90);
}
PROTEUS File for SIMULATION(Password Of RAR file is :-firmcodes.com)
____________________________________________________________________________________________________
1. Circuit Diagram Of LED interfacing with AVR (ATmega16) ________________________________________________________________________________________________ ____________________________________________________________________________________________________ _______________________________________________________________________________________________ Content for the tab VIDEO
1.Program of SINGLE LED GLOW With ATmega16
/******************************************************
www.firmcodes.com
DEVELOPED BY:- FIRMWARE DEVELOPER
WHAT PROGRAM DO:- BLINK LEDs ON PORTA
******************************************************/
#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRA=0XFF;
while(1)
{
PORTA=0xff;
_delay_ms(2);
PORTA=0X00;
_delay_ms(2);
}
}
PROTEUS File for SIMULATION(Password Of RAR file is :-firmcodes.com)
2. Program of ALTERNATE LED GLOW With ATmega16
/******************************************************
www.firmcodes.com
DEVELOPED BY:- FIRMWARE DEVELOPER
WHAT PROGRAM DO:-ALTERNATE LEDs BLINK ON PORT2
******************************************************/
#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRA=0XFF;
while(1)
{
PORTA=0XAA;
_delay_ms(300);
PORTA=0X55;
_delay_ms(300);
}
}
PROTEUS File for SIMULATION(Password Of RAR file is :-firmcodes.com)
3. Program of DIFFERENT PATTERN LED GLOW with ATmega16
/******************************************************
www.firmcodes.com
DEVELOPED BY:- FIRMWARE DEVELOPER
WHAT PROGRAM DO:- THREE DIFFERENT PATTERN OF LEDS ON PORTA
******************************************************/
#include<avr/io.h>
#include<util/delay.h>
#include<math.h>
#define led PORTA
void delay();
char ar[]={0x81,0x42,0x24,0x18,0x24,0x42,0x81};
void main()
{
int n,j,i;
DDRA=0XFF;
while(1)
{
n=2;
while(n--)
{
for(i=0;i<8;i++)
{
led=pow(2,i);
/* pow is function defined in math.h it make power of 2 as i
when i=0, pow(2,i)=1;
when i=1, pow(2,i)=2;
when i=2, pow(2,i)=4;
when i=3, pow(2,i)=8;*/
delay();
}
for(i=7;i>=0;i--)
{
led=pow(2,i);
/* pow is function defined in math.h it make power of 2 as i
when i=0, pow(2,i)=1;
when i=1, pow(2,i)=2;
when i=2, pow(2,i)=4;
when i=3, pow(2,i)=8;*/
delay();
}
}
n=2;
while(n--)
{
for(i=0;i<7;i++)
{
led=ar[i];
delay();
}
}
n=2;
while(n--)
{
led=0x00;
delay();
led=0x01;
delay();
led=0x03;
delay();
led=0x07;
delay();
led=0x0f;
delay();
led=0x1f;
delay();
led=0x3f;
delay();
led=0x7f;
delay();
led=0xff;
delay();
led=0xfe;
delay();
led=0xfc;
delay();
led=0xf8;
delay();
led=0xf0;
delay();
led=0xe0;
delay();
led=0xc0;
delay();
led=0x80;
delay();
led=0x00;
delay();
led=0x80;
delay();
led=0xc0;
delay();
led=0xe0;
delay();
led=0xf0;
delay();
led=0xf8;
delay();
led=0xfc;
delay();
led=0xfe;
delay();
led=0xff;
delay();
led=0x7f;
delay();
led=0x3f;
delay();
led=0x1f;
delay();
led=0x0f;
delay();
led=0x07;
delay();
led=0x03;
delay();
led=0x01;
delay();
led=0x00;
delay();
}
}
}
void delay()
{
_delay_ms(90);
}
PROTEUS File for SIMULATION(Password Of RAR file is :-firmcodes.com)