Witam,
Po zainstalowaniu Eclipsa i innych potrzebnych programów. Po kilku nieudanych próbach w końcu wszystko zaczęło działać poprawnie. MkAVR Calculator także wykrywa podłączony mikrokontroler- Attiny2313. Problem zaczyna się gdy chcę wgrać program. Nie występuje żaden błąd podczas kompilacji i wgrywania programu na uC. Jednak po wgraniu program nie działa. Dioda podłączona przez rezystor do VCC pali się tylko przy podłączeniu do jednego pinu- PD4 bez względu na to co jest napisane w programie który wgrałem. Dodam jeszcze, że reset mam podpięty rezystorem 7,4k do VCC.
Od kilku godzin próbuję to rozwiązać, podłączyłem na nowo programator i uC, próbowałem używać innych poleceń w kodzie, innych wyjść uC i ciągle jest to samo. Co robię źle?
Kod programu:
Cytuj:
#include <avr/io.h>
#include <util/delay.h>
int main (void) {
DDRA |= (1<<PA1);
while (1); {
PORTA ^= (1<<PA1);
_delay_ms(1000);
}
}
Komunikat po kliknięciu build:
Cytuj:
**** Build of configuration Release for project projekt1 ****
make all
Invoking: Print Size
avr-size --format=avr --mcu=attiny2313 projekt1.elf
AVR Memory Usage
----------------
Device: attiny2313
Program: 62 bytes (3.0% Full)
(.text + .data + .bootloader)
Data: 0 bytes (0.0% Full)
(.data + .bss + .noinit)
Finished building: sizedummy
**** Build Finished ****
Po wgraniu na uC:
Cytuj:
Launching C:\AVRDUDE\avrdude -pt2313 -cusbasp -Uflash:w:projekt1.hex:a
Output:
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e910a
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 "projekt1.hex"
avrdude: input file projekt1.hex auto detected as Intel Hex
avrdude: writing flash (62 bytes):
Writing | ################################################## | 100% 0.04s
avrdude: 62 bytes of flash written
avrdude: verifying flash memory against projekt1.hex:
avrdude: load data flash data from input file projekt1.hex:
avrdude: input file projekt1.hex auto detected as Intel Hex
avrdude: input file projekt1.hex contains 62 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.02s
avrdude: verifying ...
avrdude: 62 bytes of flash verified
avrdude done. Thank you.
Compiled special for
http://forum.atnel.pl (v5.11.1)
avrdude finished