Witajcie, ostatnimi czasy chciałem powrócić do programowania mikrokontrlerów AVR w języku C, napotkałem jednak kilka problemów, część już rozwiązałem, o pomoc przy reszcie proszę Was. Nie wiedzieć czemu program nie działa.
Oto komenda dla Atmel Studio:
-p Attiny13 -c usbasp -P usb -U flash:w:"$(ProjectDir)Debug\$(TargetName).hex":i
jest ona w ramach external toolsi wywołuje AVRdude 5.8
a to dane zwrotne:
Kod:
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware up
date.
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.05s
avrdude.exe: Device signature = 0x1e9007
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be perfo
rmed
To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware up
date.
avrdude.exe: reading input file "c:\users\dell\Documents\Atmel Studio\7.0\GccApp
lication4\GccApplication4\Debug\GccApplication4.hex"
avrdude.exe: writing flash (84 bytes):
Writing | ################################################## | 100% 0.09s
avrdude.exe: 84 bytes of flash written
avrdude.exe: verifying flash memory against c:\users\dell\Documents\Atmel Studio
\7.0\GccApplication4\GccApplication4\Debug\GccApplication4.hex:
avrdude.exe: load data flash data from input file c:\users\dell\Documents\Atmel
Studio\7.0\GccApplication4\GccApplication4\Debug\GccApplication4.hex:
avrdude.exe: input file c:\users\dell\Documents\Atmel Studio\7.0\GccApplication4
\GccApplication4\Debug\GccApplication4.hex contains 84 bytes
avrdude.exe: reading on-chip flash data:
Reading | ################################################## | 100% 0.06s
avrdude.exe: verifying ...
avrdude.exe: 84 bytes of flash verified
avrdude.exe: safemode: Fuses OK
avrdude.exe done. Thank you.
Aby kontynuować, naciśnij dowolny klawisz . . .
Dodam jeszcze, że dawnej (może pół roku temu), wszystko działało w takiej samej konfiguracji. Podłączenie attiny sprawdzone na wszystkie sposoby, jako że z założenia miał to być prosty program sprawdzający, do portu B4 podpiąłem diod LED, poprzez rezystor 300 Ohm.
Dla pewności podaję jeszcze kod:
Kod:
#define F_CPU 1000000L
#include<avr/io.h>
#include<util/delay.h>
int main(void)
{
DDRB=0x0F;
while(1)
{
PORTB=0x0F;
_delay_ms(500);
PORTB=0x0F;
_delay_ms(500);
}
}
Za wszelką próbę pomocy z góry dziękuję i pozdrawiam!