Discussion in "AVR Discussion Forum" started by    Ouin85    Feb 9, 2015.
Mon Feb 09 2015, 04:10 pm
#1
Hello,
I wish to make a LED flash with Atmega32.
I banged the program WinAVR, I compiled him and sent on the flash memory of Atmega32 successfully.
But, nothing works.
I noticed that the hexadecimal file and the contents of the memory are not identical.
What that can be.
I tried with AvrStudio, the same result.
Thank you.

The program is :

#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
	DDRD = 0b10000000;

	while(1)
	{
		PORTD = 0b10000000;
		_delay_ms(1000);
		PORTD = 0b00000000;
		_delay_ms(1000);
	}
	return 0;

}


[ Edited Tue Feb 10 2015, 10:13 am ]
Tue Feb 10 2015, 12:01 am
#2
As such a simple test does not work we will need your full
circuit diagram.
Are you sure the LED is the right way round ?
 Ouin85 like this.
Tue Feb 10 2015, 10:16 am
#3
You need to provide CPU frequency for _delay_ms() function to work properly.
/* F_CPU must be defined to your CPU frequency */
#define F_CPU 4000000UL /* This is just example 4Mhz */
#include <avr/io.h>
#include <util/delay.h>

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Clydehet
Wed May 01 2024, 06:44 pm
Davidoried
Wed May 01 2024, 06:11 pm
KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am
Adamsaf
Sat Apr 27 2024, 07:12 am
Robertphype
Sat Apr 27 2024, 12:23 am