Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Beginner, I want a simple prog

2007-12-27 by David Kelly

On Dec 26, 2007, at 4:38 PM, Youssef Kandeel wrote:

> Dear all,
>
>  Iam a beginner learning AVR,
>  Iam using ATmega8535 MCU
>  I want simple delay program by decrementing a value in a register  
> and loop .
>  If any one can help me, please write the assembly and\or C code for  
> CodeVision AVR C compiler and\or C++ for WinAVR compiler.

int
main(void)
{
	volatile int	i;

	while(1) {
		for( i = 0 ; i < 32000 ; i++ ) {
			;
		}
	}
	return(0);
}

The above exactly meets the specifications. Sadly if it teaches  
anything about C or AVR then one has a *long* way to go.

--
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.