PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : KontrollerLab zur Assemblerprogrammierung



Alex444
16.08.2010, 15:09
Hallo,

ich arbeite mich gerade in die Kontrollerprogrammierug ein und habe Probleme mit dem KontrollerLab. Ich konnte schon C-Code auf den Kontroller spielen aber mit Assembler geht nichts...

Was ich nutze/habe:
avrdude
avra
avr-gcc
KontrollerLab
Atmel AVR ISP mkII (über USB)
ATMega32
Kann mir jemand helfen die richtigen Einstellungen zusammenzustellen und eventuell helfen ein auf avra zugeschnittenes Makefile zu erstellen [-o<

Ich danke euch schon mal

Richard
16.08.2010, 17:27
Makefile bei ASM????? ASM wird binär (.bin) oder Hex (.hex) übertragen
die ASM Datei muss natürlich auch compiliert werden, z.B. in intel Hex
Format. Dafür wird aber kein Makefile gebraucht.

Gruß Richard

Alex444
16.08.2010, 17:51
Ah ok - das Makefile ist dann nur für Hochsprache zu Maschinencode verantwortlich. Ja?

Kannst Du mir mal so ein Schritt für Schritt aufschreiben?

Am besten fürs KontrollerLab

Richard
17.08.2010, 12:54
Ah ok - das Makefile ist dann nur für Hochsprache zu Maschinencode verantwortlich. Ja?

Kannst Du mir mal so ein Schritt für Schritt aufschreiben?

Am besten fürs KontrollerLab

Leider liegt meine Assembler Zeit rund 30 Jahre zurück, so genau
habe ich das nicht mehr im Kopf. Suche einmal bei Google nach
ASM file intel Hex format oder Bin Format. Ich hatte damals noch
unter DOS ein Konsolen Programm das hat aus der .asm eine .Hex
gemacht.

Sollte heute noch einfacher gehen?

Gruß Richard

Alex444
17.08.2010, 15:13
Habs jetzt endlich raus...

So geht es:

################################################## ##################################
1.Schritt - Assembler-Datei assemblieren mit avra
*.hex -> für den Flash
*.eep.hex -> für den EEPROM
------------------------------------------------------------------------------------

nutzer@PC:~$ avra *.s

AVRA: advanced AVR macro assembler Version 1.2.3 Build 1 (15. November 2007)
Copyright (C) 1998-2007. Check out README file for more info

AVRA is an open source assembler for Atmel AVR microcontroller family
It can be used as a replacement of 'AVRASM32.EXE' the original assembler
shipped with AVR Studio. We do not guarantee full compatibility for avra.

AVRA comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of avra under the terms
of the GNU General Public License.
For more information about these matters, see the files named COPYING.

Pass 1...
Pass 2...
done

Used memory blocks:
Code : Start = 0x0000, End = 0x0004, Length = 0x0005

Assembly complete with no errors.
Segment usage:
Code : 5 words (10 bytes)
Data : 0 bytes
EEPROM : 0 bytes

################################################## ##################################
2.Schritt - Speicher löschen mit AVRDUDE
Parameter:
-c Programmer ID (avrdude -c?)
-p Kontrollerkürzel (avrdude -p?)
-P Portkenzeichnung
-e Speicher löschen
------------------------------------------------------------------------------------

nutzer@PC:~$ avrdude -c avrispmkII -p m32 -P usb -e

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9502
avrdude: erasing chip

avrdude: safemode: Fuses OK

avrdude done. Thank you.

################################################## ##################################
3.Schritt - Speicher schreiben mit AVRDUDE
Parameter:
-c Programmer ID (avrdude -c?)
-p Kontrollerkürzel (avrdude -p?)
-P Portkenzeichnung
-U Speichertyp:Operation:Datei
Speichertyp - welcher Speicher soll bearbeitet werden
Operation - lesen(r) / schreiben(w) / vergleichen(v)
Datei - Ziel- oder Quelldatei der Daten, bzw Bytes
------------------------------------------------------------------------------------

nutzer@PC:~$ avrdude -c avrispmkII -p m32 -P usb -U flash:w:main.s.hex -U eeprom:w:main.s.eep.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9502
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 "main.s.hex"
avrdude: input file main.s.hex auto detected as Intel Hex
avrdude: writing flash (10 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 10 bytes of flash written
avrdude: verifying flash memory against main.s.hex:
avrdude: load data flash data from input file main.s.hex:
avrdude: input file main.s.hex auto detected as Intel Hex
avrdude: input file main.s.hex contains 10 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.01s

avrdude: verifying ...
avrdude: 10 bytes of flash verified
avrdude: reading input file "main.s.eep.hex"
avrdude: input file main.s.eep.hex auto detected as Intel Hex
avrdude: writing eeprom (0 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 0 bytes of eeprom written
avrdude: verifying eeprom memory against main.s.eep.hex:
avrdude: load data eeprom data from input file main.s.eep.hex:
avrdude: input file main.s.eep.hex auto detected as Intel Hex
avrdude: input file main.s.eep.hex contains 0 bytes
avrdude: reading on-chip eeprom data:

Reading | ################################################## | 100% 0.53s

avrdude: verifying ...
avrdude: 0 bytes of eeprom verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.

################################################## ##################################
FERTIG \:D/

Richard
17.08.2010, 15:19
G******Na geht doch. :-)

Gruß Richard

Alex444
17.08.2010, 15:23
Vielleich sollte man sowas mal besser aufgeschrieben ins Wiki nehmen, ich denke über sowas stolpern bestimmt einige