Witam,rzeczywiście nie zapisałem zmian w procku,teraz w MK jest 8Mhz i w Eclips 8 Mhz i przeszło ale nie miga dioda ,a komunikat jest taki...Proszę o wyrozumiałość bo to mój pierwszy program i pierwsza kompilacja...
Launching C:\WinAVR-20100110\bin\avrdude -pm8 -cusbasp -Uflash:w:TEST_DIODE.hex:a
Output:
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e9307
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "TEST_DIODE.hex"
avrdude: input file TEST_DIODE.hex auto detected as Intel Hex
avrdude: writing flash (100 bytes):
Writing | ################################################## | 100% 0.05s
avrdude: 100 bytes of flash written
avrdude: verifying flash memory against TEST_DIODE.hex:
avrdude: load data flash data from input file TEST_DIODE.hex:
avrdude: input file TEST_DIODE.hex auto detected as Intel Hex
avrdude: input file TEST_DIODE.hex contains 100 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.03s
avrdude: verifying ...
avrdude: 100 bytes of flash verified
avrdude done. Thank you.
Compiled special for
http://forum.atnel.pl (v5.11.1)
avrdude finished
Program wyglada tak:(oczywiście przepisany z ksiązki Pana Mirka)
* main.c
*
* Created on: 03-01-2015
* Author: Marcin
*/
//dołączenie potrzebnych plików nagłówkowych
#include<avr/io.h>
#include<util/delay.h>
//definicje dla preprocesora
#define LED_PIN (1<<PB1) //Definicja portu do któredo jest podłączona dioda
#define LED_ON PORTC &= ~LED_PIN //Makrodefinicja-załączenie diody
#define LED_OFF PORTC |= LED_PIN //Makrodefinicja-wyłączenie diody
#define LED_TOG PORTC ^= LED_PIN //makrodefinicja-zmiana stanu diody
//pierwsza wersja
int main(void)
{
//inicjalizacja
DDRC |= LED_PIN; //kierunek pinu PC5-wyjciowy
//pętla programu
while(1)
{
LED_ON; //zapal diode
_delay_ms(1000); //oczekiwanie 1 s.(1000 ms)
LED_OFF; //zgas diode
_delay_ms(1000); //oczekiwanie 1 s (1000 ms)
}
}