Zeig doch mal die Kommandozeile
Werbung
Zeig doch mal die Kommandozeile
Bild hier
Atmel’s products are not intended, authorized, or warranted for use
as components in applications intended to support or sustain life!
zum bauen und um daraus ne hex zu machenCode:avr-gcc -o test.elf main.c -Os -DF_CPU=1000000UL -mmcu=atmega8 -std=gnu99
Und noch ein paar infosCode:avr-objcopy -O ihex test.elf test.hex
Hoffe das hilft.Code:$avr-gcc --version avr-gcc (GCC) 4.5.3 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $avr-objcopy --version GNU objcopy (GNU Binutils) 2.20.1.20100303 Copyright 2009 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) any later version. This program has absolutely no warranty.
Watchdog ist aus?
Stannungsversorgung ist sauber?
Welchen Code macht der Compiler?
Setze mal zusätzlich -dp -save-temps und zeige das s-File (ist Text)
Disclaimer: none. Sue me.
Das sollte das *.hex File sein mit den zwei Leds.
@ SprinterSB ich geh mal davon aus dass er aus ist, ich hab den AVR in meinen Probierereien schon auf Werkseinstellungen zurückgesetzt.
@Hubert.G Werd ich heute ausprobieren
Ich weis zwar nicht was das Programm hätte tun sollen, aber ich weis was es tut, nähmlich nichts.
Keine Sichtbare Reaktion des Microcontrollers.
Auch erscheint mir das Programm mit 202 byte ein wenig klein.
Ich werde mir mal noch den ASM output des GCC ansehen.
Geändert von Thalhammer (09.10.2012 um 16:13 Uhr)
Also bei mir tut die Hex vom Hubert genau das was sie soll: 5x PB1 an/aus, PB0 an, 5x PB1 an/aus, PB0 aus und wieder von vorne...
Wo der Fehler bei Dir liegt kann ich nicht sagen, ich tippe: Frequenz...oder einfach falschrum eingesetzt
viele grüße
Geändert von HeXPloreR (09.10.2012 um 16:37 Uhr)
Hm also ich hab jetzt nochmal mein Programm auf das wesentlich wichtige beschränkt:
was von GCC wie folgt übersetzt wird:Code:#define F_CPU 8000000UL #include <avr/io.h> #include <util/delay.h> #include "port.h" int main(void) { DDRB=0xFF; while(1) { _delay_ms(100); toogle_pin(PORTB,PB0); } return 0; }
Und erstaunlicherweise funktionierd.Code:.file "main.c" __SREG__ = 0x3f __SP_H__ = 0x3e __SP_L__ = 0x3d __CCP__ = 0x34 __tmp_reg__ = 0 __zero_reg__ = 1 .text .global main .type main, @function main: /* prologue: function */ /* frame size = 0 */ /* stack size = 0 */ .L__stack_usage = 0 ldi r24,lo8(-1) out 55-32,r24 ldi r25,lo8(1) .L2: ldi r18,lo8(159999) ldi r19,hi8(159999) ldi r20,hlo8(159999) 1:subi r18,1 sbci r19,0 sbci r20,0 brne 1b rjmp . nop in r24,56-32 eor r24,r25 out 56-32,r24 rjmp .L2 .size main, .-main
Ich hab keine Ahnung woran es lag, aber jetzt schein alles zu funktionieren.
Auch sachen ala
gehen plötzlich.Code:for(uint8_t i=0;i<10;i++) _delay_ms(100);
Obwohl ich schwören könnte vorher alles richtig gemacht zu haben.
Lesezeichen