generating 50Hz sine wave using atmega8

Status
Not open for further replies.

Mithun_K_Das

Advanced Member level 3
Joined
Apr 24, 2010
Messages
899
Helped
24
Reputation
48
Reaction score
26
Trophy points
1,318
Location
Dhaka, Bangladesh, Bangladesh
Activity points
8,254
void main()
// xtal = 20MHz
{
int cnt,i;
DDRD = 0b00001111;

while(1)
{


for(i=0;i<15;i++)
{



PORTD = (i);
Delay_us(32);
}

for(i=15;i>0;i--)
{


PORTD = (i);
Delay_us(32);
}

}
}



[url]https://obrazki.elektroda.pl/90_1297835551.png[/url]

[url]https://obrazki.elektroda.pl/22_1297835552.png[/url][COLOR="Silver"]

[SIZE=1]---------- Post added at 06:59 ---------- Previous post was at 06:53 ----------[/SIZE]

[/COLOR][url]https://obrazki.elektroda.pl/83_1297835929.png[/url]
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…