Hallo,
ich hab schon seit einer Zeit Probleme selbst ein einfaches
Blink-Programm auf einem ATMega8 zum laufen zu bringen. Hab alles
gecheckt, Fuses, verschiedene Frequenzen, verschiedene ISP-Adapter,
unterschiedliche avr-gcc-Versionen, alte Ubuntu-Version, neue ATMega8s
und langsam weiß ich nicht mehr weiter...
main.c:
1 | #include <avr/io.h>
|
2 | #include <util/delay.h>
|
3 |
|
4 | int main(void) {
|
5 | DDRB = 0xff;
|
6 | //setup();
|
7 | while(1) {
|
8 | PORTB = 0xff;
|
9 | _delay_ms(1000);
|
10 | PORTB = 0;
|
11 | _delay_ms(1000);
|
12 | //loop();
|
13 | }
|
14 |
|
15 | // Never reached:
|
16 | return 0;
|
17 | }
|
Kompiliert:
1 | avrdude -c usbasp -p m8 -U lfuse:w:0xC1:m -U hfuse:w:0x99:m -U lock:w:0xFF:m
|
2 |
|
3 | /opt/ubuntu.bionic/usr/bin/avr-gcc -g -Wall -mcall-prologues -mmcu=atmega8 -DF_CPU=1000000L -O2 -c -o main.o main.c
|
4 | /opt/ubuntu.bionic/usr/bin/avr-gcc -g -Wall -mcall-prologues -mmcu=atmega8 -DF_CPU=1000000L -O2 main.o -Wl,-gc-sections -Wl,-relax -o Blink.obj
|
5 | /opt/ubuntu.bionic/usr/bin/avr-objcopy -R .eeprom -O ihex Blink.obj Blink.hex
|
6 | rm Blink.obj main.o
|
7 |
|
8 | avrdude -p atmega8 -c usbasp -U flash:w:Blink.hex
|
Versionen:
1 | /opt/ubuntu.bionic/usr/bin/avr-gcc -v
|
2 | Es werden eingebaute Spezifikationen verwendet.
|
3 | Lesen der Spezifikationen von /opt/ubuntu.bionic/usr/bin/../lib/gcc/avr/5.4.0/device-specs/specs-avr2
|
4 | COLLECT_GCC=/opt/ubuntu.bionic/usr/bin/avr-gcc
|
5 | COLLECT_LTO_WRAPPER=/opt/ubuntu.bionic/usr/bin/../lib/gcc/avr/5.4.0/lto-wrapper
|
6 | Ziel: avr
|
7 | Konfiguriert mit: ../gcc/configure -v --enable-languages=c,c++ --prefix=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man --bindir=/usr/bin --libexecdir=/usr/lib --libdir=/usr/lib --enable-shared --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-libssp --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=avr CFLAGS='-g -O2 -fdebug-prefix-map=/build/gcc-avr-n0nSsH/gcc-avr-5.4.0+Atmel3.6.0=. -fstack-protector-strong -Wformat ' CPPFLAGS='-Wdate-time -D_FORTIFY_SOURCE=2' CXXFLAGS='-g -O2 -fdebug-prefix-map=/build/gcc-avr-n0nSsH/gcc-avr-5.4.0+Atmel3.6.0=. -fstack-protector-strong -Wformat ' FCFLAGS='-g -O2 -fdebug-prefix-map=/build/gcc-avr-n0nSsH/gcc-avr-5.4.0+Atmel3.6.0=. -fstack-protector-strong' FFLAGS='-g -O2 -fdebug-prefix-map=/build/gcc-avr-n0nSsH/gcc-avr-5.4.0+Atmel3.6.0=. -fstack-protector-strong' GCJFLAGS='-g -O2 -fdebug-prefix-map=/build/gcc-avr-n0nSsH/gcc-avr-5.4.0+Atmel3.6.0=. -fstack-protector-strong' LDFLAGS='-Wl,-Bsymbolic-functions -Wl,-z,relro' OBJCFLAGS='-g -O2 -fdebug-prefix-map=/build/gcc-avr-n0nSsH/gcc-avr-5.4.0+Atmel3.6.0=. -fstack-protector-strong -Wformat ' OBJCXXFLAGS='-g -O2 -fdebug-prefix-map=/build/gcc-avr-n0nSsH/gcc-avr-5.4.0+Atmel3.6.0=. -fstack-protector-strong -Wformat '
|
8 | Thread-Modell: single
|
9 | gcc-Version 5.4.0 (GCC)
|
10 |
|
11 | avrdude -v
|
12 |
|
13 | avrdude: Version 6.3-20171130
|
14 | Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
|
15 | Copyright (c) 2007-2014 Joerg Wunsch
|
16 |
|
17 | System wide configuration file is "/etc/avrdude.conf"
|
18 | User configuration file is "/home/alex/.avrduderc"
|
19 | User configuration file does not exist or is not a regular file, skipping
|
20 |
|
21 |
|
22 | avrdude: no programmer has been specified on the command line or the config file
|
23 | Specify a programmer using the -c option and try again
|
Und compiliere ich das Programm mit einem ATTiny85 funktioniert es
einwandfrei, es ist zum Mäuse melken...
Mein Oszilloskop, zeigt nur einen ganz kurzen Pulldown auf der Leitung.
Spannung am MC: 4,5V
Langsam weiß ich nicht mehr weiter. Ist ja nicht so, dass ich nicht
schon Schaltungen mit einem ATMega8 gebaut und programmiert hätte, aber
was mach ich dieses mal falsch?
Liebe Grüße
Alex
PS: Sorry für das zweifache Bild.