The program file attached compiles on Win8.1 with avr-gcc and programs a
Mega2560 clone dev board, but won't blink the on-board LED.
I know the programmer, AVRdude and the dev board work fine because an old
hex file of a blink program actually does cause the LED to blink. It was
developed some years ago on Win7 using the same compiler version.
I just can't seem to recreate the program. What do you think is wrong or
missing ?
TIA, Ray
// Blink.c
#include <avr/io.h>
#include <util/delay.h> // _delay_ms()
// ----------------------------------------------
#define SHORT_DELAY 125
#define LONG_DELAY 333
#define F_CPU 16000000UL
int main(void)
{
DDRA = 0XFF ;
DDRB = 0xFF ; // Make outputS.
DDRC = 0XFF ;
DDRD = 0XFF ;
PORTA = 0xFF ;
PORTB = 0xFF ;
PORTC = 0xFF ;
PORTD = 0xFF ;
PORTA = 0x00 ;
PORTB = 0x00 ;
PORTC = 0x00 ;
PORTD = 0x00 ;
//-----
while (1)
{
PORTA = 0xFF ;
PORTB = 0xFF ;
PORTC = 0xFF ;
PORTD = 0xFF ;
_delay_ms( 125 ) ;
PORTA = 0x00 ;
PORTB = 0x00 ;
PORTC = 0x00 ;
PORTD = 0x00 ;
_delay_ms( 333 ) ;
} ;
}
_______________________________________________
AVR-chat mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avr-chat