Home
C-Compiler und AVR Studio
Contents
1. JEEREGE CE Taste 1 Taste 2 Taste 3 Taste 4 RESET Bild 6 5 01 Beschaltung der LEDs und Taster Bildvergr erung i Tools_206 06 02 2014 Seite 30 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio Dann wird das Board mit seinem Netzteil mit Spannung versorgt Der ISP Programmieradapter wird mit seinem USB Stecker in einen freien USB Steckplatz des PCs gesteckt in dem das neue Programm abgespeichert wurde berfl ssige Schaltkreise und die Stromversorgung wurden in dem Beschaltungsbild weggelassen AVR Studio wird nun erneut gestartet Dann wird die logische Verbindung zum CC2 AVR Programmer ISP Programmieradapter herge stellt Die Einstellungen wurden ja schon im Abschnitt 4 3 2 Mikrocontroller Einstellungen im AVR Studio von Teil 204 AVR Studio vorgenommen so dass man sich damit nicht mehr aufhalten muss AVR Studio File Project Build View Tools Debug Help JA vis ng r SR MAAAALRE EZ AX DBaG C Use Curent Simulator Ermuilator FLASH Menon C Use Current simulstoy Eniuletor EEPROM Memar Input HEX File jem Verify Read Save From 7 FLASH 7 EEPROM FUSES LOCKBITS Fuses and lockbits settings Bild 6 5 03 Objektdatei hex File suchen Tools_206 06 02 2014 Seite 31 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio gt Wechsel LW2 160
2. 5 2 Ein neues Projekt erzeugen 5 2 1 Der Projekt Bereich 5 2 2 Bearbeiten der Assemblerdatei 5 2 3 Assemblieren des Quell Codes 5 3 Simulation des Codes 5 3 1 Programmausf hrung im Einzelschrittverfahren 5 3 2 Debugger Stopp Punkte 5 4 Ver ndern des Programmtextes Tools_206 06 02 2014 Seite 1 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio 5 4 1 Uberwachen von Variablen 5 4 2 Anzeigen der Prozessordetails 5 4 3 Speichern des Projekts 5 5 Erzeugen eines weiteren ASM Projektes im Schnelldurchgang 5 6 Flashen eines ASM Programms in ein Mikrocontroller ATmega88 Teil 206 C Compiler und AVR Studio 6 CodeVisionAVR C Compiler und AVR Studio 6 1 CodeVisionAVR C Compiler installieren 6 2 Erzeugen eines C Projektes 6 2 1 Ein neues Projekt beginnen 6 2 2 Ein C Projekt generieren 6 3 Einbinden von AVR Studio in den CVAVR 6 4 AVR Studio Debugger f r CVAVR 6 5 Flashen eines C Programms in ein Mikrocontroller ATmega88 amp Teil 207 Editor UltraEdit 7 Editor UltraEdit 7 1 Kopf und Fuss Zeile 7 1 1 Einstellungen f r Assembler Programme 7 1 2 Einstellungen f r C Compiler Programme 7 2 Eintr ge in das WORDFILE TXT 7 2 1 Grunds tzliches Format 7 2 2 Syntax Befehle 7 3 Wortsammlung f r AVR Assembler 7 4 Wortsammlung f r CodeVisionAVR C Compiler Hinweis Externe Anschaltungen und Hardware Erweiterungen werden in der Gruppe 400 ASM Projekte und in der Gruppe
3. Build 1 15441 linefs compiled Mo errors G04 wain Bit variables size byte s Data Stack area 0x100 to 0x1FF Data Stack size 25b byte s Estimated Data stack usage U byte s RAM Global variables area 0x200 to 0x204 RAM Global variables size 5 byte s Hardware Stack area 0 lt 205 to Ox4FF Hardware Stack size 763 byte s Heap size 0 bytefs EEPROM usage 0 byte s 0 0 of EEFROM Program size 182 words 364 bytes 4 4 of FLASH words 0 bytes 00 reduced by Code Compression Bild 6 2 3 05 Compiler Meldungen Bild 6 2 3 06 Assembler Meldungen Tools_206 06 02 2014 Seite 24 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio Wenn man tiefer in die Materie eingestiegen ist so ergeben diese Listen sehr aufschlussreiche Hin weise zum Kompilat und den benutzten Ressourcen Speicher Belegungen An dieser Stelle m gen die Hinweise No errors und Assembly complete 0 errors genugen Sie zeigen an dass das Projekt fehlerfrei kompiliert und assembliert wurde und ein ablauf fahiges Objekt Programm erzeugt wurde 6 3 Einbinden von AVR Studio in den CVAVR Der Compiler CVAVR ist daf r vorgesehen mit dem Debugger vom AVR Studio ab der Version 4 13 zu kommunizieren Dazu ist es notwendig die Lokalisation von AVR Studio d h den Ordner Pfad von AVR Studio auf der System Platte der Anwendung CVAVR bekannt zu machen Diese Lokalisation ist unter der Ann
4. gt ExtVideo LW 1000 i KINGSTON L E AVR_PB_LED hex FH ALEs ASM_Progs AVR_PB_LED h Exe d Linker d List Obj amp Netzwerk BJ Systemsteuerung Papierkorb a Nicht angegeben 1 Bild 6 5 04 Objektdatei ffnen AVRISP mkII in ISP mode with Almegass Main Program Fuses LockBits Advanced HW Settings HW Info Auto r Device Erase Device v Erase device before flash programming Verify device after programming C Use Curent simulator Emulator FLASH Menon Input HEX File L AVR_PB_LEDI Exe AVR_PB_LED hex ee Program Verify Read Use Current simulator emulator EEPROM Hemer Input HEX File Program Verify Read Input ELF File rc Save From FLASH V EEPROM FUSES LOCKBITS fuses andlockbits settings Program Save saving to ELF Bild 6 5 05 Programm flashen gt und das Programm testen gt alles O K Tools_206 06 02 2014 Seite 32 von 32
5. 600 C Projekte detailliert beschrieben Tools_206 06 02 2014 Seite 2 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio Vorbemerkung Nichts ist vollkommen und nichts ist endg ltig So auch nicht dieses Tutorial Deshalb bitte immer erst nach dem neuesten Datum schauen Vielleicht gibt es wieder etwas Neues oder eine Fehlerbe reinigung oder eine etwas bessere Erklarung Wer Fehler findet oder Verbesserungen vorzuschlagen hat bitte melden info alenck de Immer nach dem Motto Das Bessere ist Feind des Guten und nichts ist so gut dass es nicht noch verbessert werden k nnte Bild Beispiel Form und Tabellen Nummern sind nach folgendem Schema aufgebaut damit bei Einf gungen L schungen nicht alle Nummern wieder ge ndert werden m ssen hier bunt dargestellt Darstellungsart Abschnitt LfdNummer Beschreibung allgemeines Schema e Bild 5 1 4 02 Daten Adress Raum Benummerung eines Bildes e Beispiel 5 1 4 03 EEPROM Speicherung Benummerung eines Beispiels e Form 5 1 3 01 Die main Funktion Benummerung einer Formdarstellung e Tabelle 5 1 4 01 Schl sselw rter vom CVAVR Benummerung einer Tabelle Gravierende nderungen gegen ber der Vorversion 1 V llig neue Strukturierung in Gruppen und Teile um das Tutorial umfassend ordnen zu k nnen Die Abschnitte in den Teilen sind weitgehend erhalten geblieben Gruppenbezeichnung Kurzbezeichnung Gruppe 100 Technologi
6. Code Information v2UJ AVR PB LED main c 3 amp CodeVisionAVR B main c on 9 Project AVR_PB_LED Includes Notes i 2 application h B application c r Global Static Variables a Warnings X n gt R4 main c F Functions 2 Headers F mainfvoid application h B ctype h B delay h iomx8 h 9 Projekt 601 Demonstration der Taster und LEDs auf dem Testboard E B Warnings 10 Zusaetzliche Header keine B limits h 11 Module c und h application A macros h 12 Benoetigte Hardvare Testboard Taster S1 S2 S3 und LEDI LED2 LED3 A megal68_bits h 13 MNENE DETETA ETET ETETEA TEZIS 2 3 u A megad h 14 Compiler ccccceceees CodeVisionAVR A stdarg h 15 CRIP cccceccccceccccees ATmegass A stdio h 16 Debian CURE 2009 A stdlib h 17 Autor eeeeseenenn i Alwin Lenck ALE23 basierend auf dem Projekt PB_LED von Udo Juerss B string h Renmin ae tac AAAA Bi switches h 19 om A typedets h 20 Dieses Projekt stellt eine Applikation zur Demonstration der Taster Pushbottons und LEDs auf dem Testboard dar a A List Files 21 Die Taster sind nicht entprellt A AVR_PB_LED asm E f Eaa l B AVR_PB_LED lst 23 Die LEDI ist im Ruhezustand AUS und bei gedrueckter Taste Si EIN B AVR_PB_LED map 24 Die LED2 ist im Ruhezustand EIN und bei gedrueckter Taste S2 AUS Other Files 25 Die LED3 toggelt beim Betaetigen der Taste S3 von AUS nach EIN und umgekehrt 26 5 H Messages VR B Eror E Wamings Warning L AYR_PB_LED iomx8 h 4
7. LCDCHAR LM75 Thermometer in EXAMPLES THERM75 LCD Thermometer in EXAMPLES THERMLCD DS1820 DS18S20 Multipoint thermometer in EXAMPLES DS1820 DS1990 Serial Number iButton in EXAMPLES DS1990 AD7896 Digital voltmeter in EXAMPLES SPI MAX1241 Digital voltmeter in EXAMPLES MAX1241 4x4 Keypad in EXAMPLES KEYPAD Simple multifile project in EXAMPLES MULTFILE Redirecting the output of standard C I O functions to USARTO USART1 and LCD for an ATmega128 chip in EXAMPLES 2USART_LCD Tiny5 Level Meter ulP_Crumb644 Net_CVAVR web server TWI Master Slave After starting CodeVisionAVR execute the File Open menu command and load the Project prj file for the example you like Then execute the Project Build All menu command to compile and link the project Take some time and carefully read the Help Auch C Programme werden ausschlie lich in Form von Projekten bearbeitet so dass jetzt an die Bil dung eines C Projektes herangegangen werden soll 6 2 Erzeugen eines C Projektes lol x Gc Te a ror PB_LED durchsuchen Pal Se Organisieren Freigebenf r Brennen Neuer Ordner ee ej gt Sicherungs LW 1000 GB 1 A Name Gr e nderungsdatum Typ gt Wechsel LW2 160 GB J a Nicht ben 7 gt ExtVideo LW 1000 GB K icht angegeben 7 KINGSTON L appiication c 11 KB 15 08 2009 14 17 C compiler source file ALEs_ASM_Progs application h 36KB 15 08 200
8. Shift FS SV CodeVisionAVR LCD Vision Shift F6 a Project AVR_PB_LED 8 Notes Configure amp B application c i mB Warnings 42 ff 43 Header Dateien einfuegen Bild 6 4 01 Aufruf des Debuggers zum Projekt AVR_PB_LED Tools gt Debugger Shift F3 gt ffnet AVR Studio gt File gt Open File Strg O Es startet AVR Studio aus CVAVR heraus Dabei wird ggf das Startfenster mit einem Willkommensdialog ge ffnet wenn die Option Show this dialog on open aktiviert war Da nicht mit Assembler oder AVR GCC gearbeitet wird sondern ein AVR Projekt mit CVAVR erstellt werden soll wird das H kchen bei Show dialog at startup entfernt und das Fensterchen erscheint zuk nftig nicht mehr Es ist zu beachten dass bereits einige Optionen voreingestellt worden sein k nnen so dass das Ab bild von AVR Studio nach der urspr nglichen Installation anders ausgesehen haben k nnte Tools_206 06 02 2014 Seite 26 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio AVR Studio JIC Bh dh 6 ee Me FE Te thw Se Save S Save All Print Strg P Print Setup AVR Studio 4 CAP NL 4 eee Bild 6 4 02 Offnen des Datei Dialogs nen 4 Ei 4 lt AVR_PB_LED durchsu fe Name a Nicht angegeben 25 Exe 23 09 2012 19 39 Dateiordner J Linker 23 09 2012 19 39 Dateiordner a List 23 09 2012 19 39 Da
9. Toolbars von denen besonders her vorzuheben sind e Prozessor Daten Counter Pointer Register usw e Die aktuelle Quell Datei D AVR_PB_LED main c mit einem gelben Pfeil auf die erste aus f hrbare Anweisung e Ein Ausgabe Werte I O View Hardware Ressourcen e Nachrichten ber die laufenden Aktivit ten Message Output Tools_206 06 02 2014 Seite 28 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio Jetzt schiebt man sich die Seiten der Felder so hin dass eine vern nftige bersicht erscheint AVR Studio L AVR_PB_LED main c File Project Build Edit View Tools Debug Window Help IH LAY VA MALAKR EZ a S la xl Trace Disabled Ta Aaa 7 i k e Se VO View Yx Name Value Z fe ss ANALOG_COMPARAT E Program Cou 0x000076 Name i void main void Stack Toner Kii we 3 DAD_CONVERTER P f Setzen des System Taktes CPU Clock Ausschalten nicht bi ID ANALOG_COMPARATOR Y pointer 0x0200 o gt app_init Initialisi cpu Z pointer 0x0004 E EEPROM Cycle Counter 6287 Initialisieren der Tasten Pushbuttons a 1 INIT SEXTERNAL_INTERRUPT Frequency 4 0000 MHz Si ae S2_INIT EEREIT Ben a S3_INIT Port B Data Register 0x00 Registers 77 Initialisieren der LEDs FORD a Wo ROO 0x01 LED1_DDR LED1_BIT Setze LED1 Port B Input Pins 0x00 LED2_DDR LED2_BIT Setze LED2 E EEE
10. ir Ox00 LED3_DDR LED3_BIT Setze LED3 Port C Data Register 0x00 R03 0x00 Alle LEDs 3 mal aufleuchten lassen Lampen Test POH C Data DROE Bon Registei R04 for n 3 n n PortC Input Pins 0x00 PORTD R05 0x00 LED1_PRT LED1_BIT LEDI auf E 39 SPI RO6 0x00 LED2_PRT LED2_BIT LED2 auf E FIF RO7 0x00 LED3_PRT LED3 BIT LEDS auf E 1 TIMER_COUNTER_0 TIMER_COUNTER_1 ROS delay_ms 250 f 250 ms Ver TIMER_COUNTER_2 pae a 32 TWI Ri0 0x00 LED1_PRT amp LED1_BIT LED1 auf Al 5 USARTO R11 0x00 LED2_PRT amp LED2_BIT LED2 auf Al Na R12 0x00 LED3_PRT amp LED3_BIT LED3 auf Al 2 WATCHDOG R13 0x00 delay_ms 200 200 ms Ver R14 0x00 R15 0x00 R16 0x00 R17 0x00 R18 0x00 while true Endlosschl W T Sl ged k ifa id 1 h LED1 i t t z t z R20 0x00 i Si PRESSED ruec wir ann leuchtet Niwas EE Value Bits R21 0x00 DDRB 0x04 0x24 0x00 O0000000 R22 0x58 LEDI PRT LED1_BIT Hx LEBE suf E PINB 0x03 0x23 0x00 DOOOO000 R23 0x00 2PORTB 0x05 0x25 0x00 OO000000 R24 0x00 DDRC 0x07 0x27 0x00 SOODOOO000 R25 0x00 LED1_PRT amp LED1_BIT LED1 auf Al PINC 0x06 0x26 0x00 E OOO0000 R26 0x02 2PORTC 0x08 0x28 0x00 E 0000000 R27 0x02 R28 0x00 Wenn Taste 52 gedrueckt wird dann schaltet LED2 auf AU if S2_PRESSED R29 0x02 R30 0x04 LED2_PRT amp LED2_BIT LED2 auf Al R31 0x00 else LED2_PRT LED2_BIT Z LEBZ auf E Wenn Ta
11. maximiert oder gezogen wer den k nnen was hier geschehen ist Um Platz f r die Quelldateien zu schaffen werden jetzt die Spalten Function Call Tree Code Temp lates und Clipboard History zun chst entfernt und die File Pane verbreitert CodeVisionAVR L AVR_PB_LED AVR_PB_LED prj 4 Oo x e pa bad yee popa Le u ER De2 Bugue BES S 7 o 0 8 g BB Ble gA H h TIIE eee elm 2 as 420 a 8693 7 9 e Thl lee Seow lm ea f Code Navigator I El AVR_PB_LEDIAVR_PB_LED te E cv CodeVisionAVR s S D Project AVR_PB_LED es a D application c D main c A Headers 5 List Files fy N B AVR_PB_LED asm I A AVR_PB_LED Ist D AVR_PB_LED map B Other Files H Messages B Errors E wamings ee aa T Cwe O Bild 6 2 1 13 Verbreiterte File Pane Tools_206 06 02 2014 Seite 17 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio Mit ein wenig Jonglieren werden die Spalten gestaltet 1 Spalten nebeneinander 2 Offnen von main c im Code Navigator 3 Offnen von application c im Code Navigator Wie man sieht kann man im groBen Fenster noch eifrig alle Quell Dateien verandern editieren Die farbliche Kennzeichnung der Syntaxhervorhebung weicht auch hier vom Beispieltext etwas ab da der integrierte Editor vom CVAVR f r die Syntaxhervorhebung nicht so viele Einstellm glichkeiten bietet wie der UltraEdit siehe Te
12. 1 included from typedefs h macro UMSELOT was redefined Warning L AYR_PB_LED iomx8 h 42 included from typedefs h macro UMSELO0 was redefined Warning L AYP_PB_LED iomx8 h 43 included from typedefs h macro UPMO1 was redefined Warning L AYR_PB_LED iomxs h 44 included from typedefs h macro UPMO0 was redefined Warning LAAVR_PB_LED iomx8 h 45 included from typedefs h macro USBS0 was redefined Waring L AYPR_PB_LED iomxs h 46 included from typedefs h macro UCSZ01 was redefined i InformzSon i Information Aa Compiler ssembler Chip ATmegaog Clock frequency 16 000000 MHz Program type Application Memory model Small Optimize for size siprint features int width siscant features int width Fromote char to int Mo Char Is unsigned ves global const stored in FLASH Yes 6 bit enums Mo Enhanced function parameters passing No Automatic register allocation Yes omar register allocation ves 7 Compiler Assembler AYRASM AYR macro assembler 2 1 30 build 592 Now 7 2005 12 39 77 Copyright C 1995 2005 ATMEL Corporation LAW F_FB_LEDNList Av F_FE_LED asm 559 No EEPROM data delet ATmeqado memory use summary bytes segment Begin End Code Data Used Size lse cseg UxQ00000 0x00016c 326 36 364 0192 44 seq Ux0001000x000205 0 5 5 1024 0 5 Leseg UxQ000000x000000 0 0 0 512 0 0 Lime Bt mea Assembly complete 0 errors
13. 2 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio AVR seo S i File Project Su d View Tools Debug Help TP Project Wizard AgGgd YC Bi AAEE New Project li ok T it tits di er gT pura Open Project a Save Project Close Project 2 L ALEs_ASM_Progs ALE_0002 ALE_0002 aps 3 LAALEs_ASM_Progs ALE O001 ALE 0001 aps Bild 6 4 07 Fortsetzen des Debugging nach einem Neustart Wenn man in diesem Projekt beispielsweise auf PORTC klickt dann kann man w hrend der schrittwei sen Programmausf hrung mit F10 sehen wie sich PC2 PC3 PC4 entsprechend dem kurzen Auf leuchten der LED s nach dem Reset ver ndern 6 5 Flashen eines C Programms in ein Mikrocontroller ATmega88 Das Programm AVR_PB_LED ist jetzt kompiliert und simuliert worden Aber ein Test im Wirkbetrieb ist nat rlich noch wichtiger Dazu muss der Objektcode das kompilierte Programm in den Mikrocon troller hier in den Mikrocontroller auf dem AVR ALE Testboard geflasht werden und es m ssen die notwendigen Verbindungen zwischen den Pins hergestellt werden Die Beschaltung ist identisch mit dem Abschnitt 1 2 Beschaltung im Teil 601 AVR_PB_LED 4 4 5 g u zla g 2 A 4 JO 5 e 8 5V PBO ICP PD7 AIN1 PD6 AINO PD5 T1 PB7 TOSC2 aed Set PD4 XCK TO K6 Kee SS OOOO 0 telis ralra ialti to 9 ULN2003 JP2 kei nC K83 K84
14. 23 47 18 03 2012 23 47 Desktop Other Files E Messages B Eros B Wamings N Bild 6 2 1 10 C Dateien dem Projekt bekannt machen Alle C Dateien ausw hlen gt ffnen und OK im Configure Project Men Achtung Der Vorgang dauert eine Weile Bitte nicht die Geduld verlieren Noch mal der Reihe nach wegen der berschneidung der Men s Bild 6 2 1 06 Benennen der prj Datei AVR_PB_LED prj gt Speichern Bild 6 2 1 09 Hauptfenster von CVAVR zur Ubersicht Bild 6 2 1 07 Configure Project Part 1 das Menu bleibt zunachst noch sichtbar gt Add Bild 6 2 1 08 Neue Projekt Struktur Bild 6 2 1 10 C Dateien dem Projekt bekannt machen gt c Dateien markieren gt ffnen Bild 6 2 1 07 Configure Project gt OK Durch OK im Configure Project werden alle c Dateien in das Projekt bernommen CodeVisionAVR L AVR_PB_LED AVR_PB_LED prj Fle Edit Search View Project en Help De Hugo 3 2 o mrexB sr r 0 0 8 8 8 BaBa a8 8 ap MB D ee exes BS E S eh 4E SO RAKG SB 2 VIO SS TEVVsmoe lame f amp Code Navigator vg RE Codel Y 7 E Function Call 7 cd DNS NEE amp CodeVisionAVR a BD Project AVR_PB_LED application c R D main c o A Headers B List Files D AVR_PB_LED asm B AVR_PB_LED Ist A AVR_PB_LED map B Other Files H Messages B Erors E Wemings Bild 6 2 1 11 Hauptfenster von CVAVR Tools_206 06 02 2014 Seite 1
15. 6 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio CodeVisionAVR J AVR_PB_LED AVR_PB_LED prj l F olx File Edit Search View Project Tools Settings D eS amp k m eG oS Re Fes Ja EF ZN H a a Sy Fe 1 e St a Code Navigator COL f i ts Code Informa 4 E Function Call Tree J AVR_PB_LED AVR_PB_LED tet B Eu CodeVision amp R B D Project AVR_PB_LED LE T AEO ar E E D application c main c w Headers List Files a AVR_PB_LED asm D AVR_PB_LED Ist A AVR_PB_LED map B Other Files do while while switch case switch case void main void HJ Messages LU B Enos B Wamings ee aS Oe EEE Bild 6 2 1 12 Die Spalten Function Call Tree Code Templates und Clipboard History werden zun chst entfernt um Platz f r die c Dateien zu erhalten In der File Pane Editier Feld das ist die 4 Spalte von links wo bereits die leere txt Datei unter Notes vorgemerkt ist k nnen alle c Dateien auch nebeneinander oder untereinander angezeigt werden In der AVR_PB_LED txt Datei kann das Projekt unter Notes detailliert beschrieben werden das soll uns hier aber noch nicht interessieren Wenn die Felder nicht gleich so erscheinen wie sie im Bild 6 2 1 12 dargestellt sind so ist zu bemer ken dass die Felder wie in anderen Anwendungen auch minimiert
16. 9 21 34 C compiler header file AVR_PB_LED Cn iomx8 h 46 KB 15 08 2009 15 08 C compiler header file gt Wechseldatentrager M macros h N 4KB 15 08 2009 20 07 C compiler header fie amp Netzwerk main c 6KB 15 08 2009 21 18 C compiler source file B3 Systemsteuerung Papierkorb switches h 4KB 15 08 2009 20 09 C compiler header file i typedefs h 9 KB 15 08 2009 20 13 C compiler header file vid gt N 7 Elemente 7 Elemente Computer f Bild 6 2 01 Einen neuen Projekt Ordner mit vorhandenen Quell Dateien anlegen Tools _206 06 02 2014 Seite 12 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio Zur Demonstration einer Projekt Generierung wird ein neuer Projekt Ordner AVR_PB_LED angelegt in dem alle fertigen c und h Dateien des fertigen Projektes AVR_PB_LED bertragen werden Siehe Gruppe 600 AVR C Projekte Teil 601 AVR_PB_LED Einfache Beschaltung von LEDs und Tastern der Quell Code steht unter 601_Projekt_AVR_PB_LED Der Ordner Name wurde vom Namen des bestehenden Projektes entlehnt Dieser Ordner und die folgenden Schritte dienen gleicherma en zur Demonstration wie man als Neuling fertig erstellte Projekte zum Testen benutzen kann Wenn man ein neues Projekt beginnt f ngt man ja bei Adam und Eva an d h man legt einen neuen Projekt Ordner an bernimmt oder erstellt darin die Quell Dateien und marschiert dann durch die hier beschriebenen I
17. AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio Teil 201 Experimentierboards 1 Experimentierboards zum Testen und Programmieren von AVR Mikrocontroller 1 1 Mit welchen Mitteln AVR Mikrocontroller programmiert werden 1 2 Starterkit STK500 1 3 Entwicklungs Tool AVR Dragon 1 4 ATM18 Controllermodul und ATM18 Testboard 1 5 AVR ALE Testboard Teil 202 ISP Programmieradapter 2 ISP Programmieradapter 2 1 ISP Bezogen auf die verschiedenen Schnittstellen 2 1 1 Serielle Schnittstelle 2 1 2 Parallele Schnittstelle 2 1 3 USB Schnittstelle 2 2 CC2 AVR Programmer alias USBprog 2 2 1 Aufbau 2 2 2 Arbeitsweise 2 2 3 Firmware Anderung Teil 203 AVR ALE Testboard 3 Beschreibung des AVR ALE Testboard 3 1 Schaltungsaufbau 3 2 Stromversorgung 3 3 Einsatz verschiedener AVR Mikrocontroller 3 4 Anzahl LEDs und Tasten 3 5 LCD Interface und 20x4 LCD 3 5 1 Erzeugung des Enable Signals f r das LCD 3 5 2 LCD Backlight 3 6 Ansteuerung von Relais 3 7 RS 232 Schnittstelle 3 8 USART Testboard Schnittstelle Teil 204 AVR Studio 4 Einsatz des AVR Studio 4 1 AVR Studio installieren 4 2 Testboard und Programmer zusammenschalten 4 2 1 Treiber AVRISP mkllI neu installieren 4 3 Starten von AVR Studio 4 3 1 AVR Studio und CC2 AVR Programmer 4 3 2 Mikrocontroller Einstellungen im AVR Studio Teil 205 Assembler und AVR Studio 5 Assembler und AVR Studio 5 1 Der bersetzer Assembler
18. DRO SPSRO registers were changed to SPCR SPDR SPSR in the following header files mega164 h mega324 h mega644 h mega644p h in order to eliminate naming conflicts with I O registers bits definitions the names of the PCINTO PCINT1 PCINT2 PCINT3 interrupt vectors were changed to PC_INTO PC_INT1 PC_INT2 PC_INT3 in the following header files 90usb1286 h 90usb1287 h 9Ousb646 h 90usb647 h 90usb162 h 9Ousb162 h mega1280 h mega1281 h mega2560 h mega2561 h mega640 h mega1284p h mega162 h mega164 h mega165 h mega168 h mega168p h mega169 h mega324 h mega325 h mega325p h mega3250 h mega3250p h mega328p h mega329 h mega329p h mega3290 h mega3290p h mega406 h mega48 h mega48p h mega644 h mega644p h mega645 h mega6450 h mega649 h mega6490 h mega88 h mega33p h tiny10 h tiny13 h tiny24 h tiny25 h tiny44 h tiny45 h tiny48 h tiny84 h tiny 85 h tiny88 h tiny261 h tiny461 h tiny861 h tiny2313 h If these interrupt vectors are used in your programs their names must be updated in order to eliminate naming conflicts with I O registers bits definitions the names of the INTO INT7 interrupt vectors were changed to EXT_INTO EXT_INT7 in the following header files mega1280 h mega1281 h mega2560 h mega2561 h mega640 h mega1284p h mega164 h mega324 h mega644 h mega644p h If these interrupt vectors are used in your programs their names must be updated removed the limitation when a literal char str
19. LED AVR_PB_LED prj Speichem in u AVR_PB_LED 2 gt fi Speichem in wi AVR_PB_LED G 2 em Gr e Name Gr e nderungsdatum _ gt s Es wurden keine Suchergebnisse gefunden e Es wurden keine Suchergebnisse gefunden Zuletzt besucht Zuletzt besucht Desktop Desktop Bibliotheken Bibliotheken x x Computer Computer A A Netzwerk Netzwerk ge a N ooo a Dateiname AVR_PB_LED z piim D Project files prj v Dateityp Project fies pn 7 7 ppbrechen Bild 6 2 1 05 Es wird eine prj Datei angefordert Bild 6 2 1 06 Benennen der prj Datei Es ffnet sich zus tzlich das Fenster Configure Project AVR_PB_LED prj mit der Aufforderung dem Projekt nun die Quell Dateien hinzuzuf gen besser bekannt zu machen da sie sich ja bereits im Projekt Ordner befinden 8 Tools_206 06 02 2014 Seite 14 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio 4 Configure Project AVR_PB_LED prj i x Files E Compiler Before Build Alter Build Input Files Output Directories z JAVA _PB_LED AYVA_PB_LED pry Add File to Project Suchen in u AVR_PB_LED 2 GO iF ee Zuletzt besucht M Be 18 03 2012 23 47 4 Ji Linker 18 03 2012 23 47 FE J List 18 03 2012 23 47 Ji obj 18 03 2012 23 47 _Japplication c 11KB 15 08 2009 15 17 Pie main c 6KB 15 08 2009 22 18 A Computer A e Netzwerk Bild 6 2 1 07 Con
20. R or ADCSRB registers were not set correctly when using one of the ADC auto trigger modes Fixed the ADC auto trigger modes were missing for the ATmega32 chip Fixed USART code generated for the ATmega64 chip used UMSELO0 UMSEL11 bit names instead of UMSELO and UMSEL1 in the UCSROC and UCSRIC registers Fixed ADC code generated for the ATmega64 chip used the ADATE bit name which is not present in the ADCSRA register of this chip 2 3 Chip Programmer Added check for conflicts between the EEPROM Program and Preserve EEPROM options Fixed error for restoring EEPROM contents after chip erase when the Preserve EEPROM option was enabled and Tools_206 06 02 2014 Seite 10 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio Atmel Studio 6 was set as debugger 3 New features changes in CodeVisionAVR V2 60 not available in old V1 25 x compilers 3 1 Compiler ANSI C compatible C front end the bool data type was added stdbool h the operator can now be used with variables located in EEPROM too the amp unary operator can now be applied to I O registers declared using the sfrb and sfrw keywords It will return a pointer to the RAM address where these registers are mapped there is no need to specify the flash or eeprom memory attribute during structure or union type definition Therefore the same structure or union data type can be eas
21. VR_PB_LED des Projekt Ordners vom Beispiel Projekt AVR_PB_LED und hierher soll auch die Datei AVR_PB_LED cof aps abgespeichert werden Save AVR Studio Project File gon E AVR PB_LED durchsuchen E Organisieren Neuer Ordner Q w Name Gr e nderungsdatum Typ a Nicht angegeben 4 Exe 23 09 2012 19 39 Dateiordner J Linker 23 09 2012 19 39 Dateiordner bh List 23 09 2012 19 39 Dateiordner a Obj 23 09 2012 19 39 Dateiordner Dateiname AVR_PB_LED_cof aps ZU v Dateityp AVR Studio Project Files aps Speichen d 72 Ordner ausblenden Abbrechen 4 Bild 6 4 04 AvR_PB_LED cof aps speichern Es dauert einen Moment bis man die Debug Plattform AVR Simulator fur den Mikrocontroller ATmega88 einstellen kann Select device and debug platform Select debug platform and device Debug platform Device AVR Dragon ATmegab4Cl AVR ONE ATmegabdM1 AVR Simulator ATmegas AVR Simulator 2 ATmegas515 ICE200 ATmegas535 ICE40 ATmeqass ICE50 ATmegassA JTAG ICE ATmega88P JTAGICE mkll ATmegas3PA ATmegasA ATmegasHYyA ATmegasUe2 Open platform options next time debug mode is entered lt lt Back ext amp Finish Cancel Help Bild 6 4 05 Debug Plattform f r den ATmega88 einstellen Nach einer weiteren kurzen Verweildauer ffnet sich AVR Studio mit der f r das C Projekt AVR_PB_LED eingestellten Debug Plattform mit zahlreichen
22. ahme dass AVR Studio auf seinem angestammten Platz installiert wurde C Program Files x86 Atmel AVR Tools AvrStudio4 AVRStudio exe Der Eintrag in CVAVR wird im Ment Debugger Settings vorgenommen CodeVisionAVR L AVR_PB_LED AVR_PB Sas pry ee Settings Heb J IDE fh me OO Smu E Ta l T fe bb af Ge Pap SEE Be Danger wi 2 v Cod Programmer E Sr V Codevision vR eB i lt Terminal 5i D Project AVR_PB_LED E Includes Hares mainc I as A application h 1 E17 B application c AF Glohal Static Variables 2 E H Warnings aK on Rd E SRR p maln c ee at Functions 4 tebe ttt tt tee eee 6 Headers ri maintvoid St ee Ste RE application h 5 EE pe ee ee i a a a a a a a a i Sead AB chype h 7 a T e be B delayh 8 f iomxe h 3 Projekt 60i 4 Debugger Settings x Debugger AVR Studio 4 19 Directory and Filename i gt i gt Program Files tb atmelayvR Tools avrstucio4 AyRotudio fe Bild 6 3 02 Einstellen der Datei AVRStudio exe Settings gt Debugger gt Debugger Settings gt Directory and Filename C Program Files x86 Atmel AVR Tools AvrStudio4 AVRStudio exe gt OK Tools_206 06 02 2014 Seite 25 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio Sollte AVRStudio exe nicht an der vorgesehenen Lokalisation installiert worden sein so kann sie mit der F
23. e New Project Dieses verweist ggf zun chst auf den Pfad der CVAVR Installation C cvavr2 bin weil der Compiler Hersteller offenbar davon ausgeht dass alle Projekte hier konzentriert werden sol len Da aber das Projekt in einem eigens daf r vorgesehenen Ordner angelegt werden soll m ssen hier neue Einstellungen vorgenommen werden Im Feld Speichern in wird der neu eingerichtete Ordner gesucht Hier AVR_PB_LED gt Speichern Tl Create New Project al Speichemin bin Of gt Speicher in gt KINGSTON L GO gt ir Name v Gr e Nicht angegeben 2 nderungsdatun Es wurden keine Suchergebnisse gefunden Zuletzt besucht a Desktop Zuletzt besucht 4 Desktop ALEs_ASM_Progs amp s Bibliotheken Bibliotheken A A Computer x Netzwerk Computer a Netzwerk m u z p ojouUoryoa pp ena7 gt Bene FO Omen Dateityp Projectfiles prj CE Bild 6 2 1 03 Create New Project Bild 6 2 1 04 Ordner AVR_PB_LED suchen Klick auf und KINGSTON L w hlen AVR_PB_LED markieren gt ffnen Jetzt muss noch der Dateiname f r das Project file prj benannt werden Sinnvoll ist es den gleichen Namen wie f r den Projekt Ordner zu w hlen n mlich AVR_PB_LED Nur diese Datei braucht sp ter aufgerufen zu werden um nderungen im Projekt vorzunehmen Sie soll wie folgt ab gelegt werden hier beispielhaft auf dem USB Stick L L AVR_PB_
24. e bitte w hrend CodeVisionAVR C Compiler auf Ihrem Computer installiert wird Dateien werden entpackt c examples USB AVR2 0 USB Mouse senes6 hidmouse 2_0_6 doc doc html a00056 html Abbrechen Bild 6 1 07 Installation l uft Tools_206 06 02 2014 Seite 7 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio 5 Setup CodeVisionAVR Compiler Information Lesen Sie bitte folgende wichtige Informationen bevor Ste fortfahren Klicken Sie auf Weiter sobald Sie bereit sind mit dem Setup fortzufahr Welcome to the CodeVisionAVR C Compiler V2 and the Code WizardAVR Automatic ie Program Generator The compiler is designed to be used along with the AVR Studio V4 19 V5 1 or Atmel Studio 6 0 or later debuggers which can be downloaded from the ATMEL web site www atmel com For JTAGICE 3 programming support to be available AVR Studio 5 1 or Atmel Studio 6 or later must be installed Details about using CodeVisionAVR with these debuggers are available in the Help topics CadeVisionAVR IDE Tools The AVR Studio Debugger CodeVisionAVR C Compiler Reference Using the AVR Studio 4 19 Debugger CodeVisionAVR C Compiler Reference Using the AVR Studio 5 1 and Atmel Studio 6 ww Mb ee de ib ek ee ee A144 a fl An il AL LR BAe m Bild 6 1 08 Setup Wichtige Informationen Text siehe weiter unten fi Setup CodeVisionAVR C Com
25. e der AVR 8 Bit Mikrocontroller Technologie Gruppe 200 Einsetzen von AVR Tools Tools Gruppe 300 Arbeiten mit AVR Assembler ASM Programmierung 3xx_Programm_yyyyy ASM Programm Beispiel Gruppe 400 AVR ASM Projekte ASM Projekte Axx_Projekt_yyyyy ASM Projekt Bezeichnung Gruppe 500 CodeVisionAVR C Compiler C Programmierung 5xx_Programm_yyyyy C Programm Beispiel Gruppe 600 AVR C Projekte C Projekte 6xx_Projekt_yyyyy C Projekt Bezeichnung xx steht fur die laufende Nummer innerhalb des Teils in dem das Programm bzw das Projekt er scheint und yyyyy steht fur die Programm bzw Projekt Kurz Bezeichnung 2 Notwendige Anderungen auf Grund Neuinstallation von Windows 7 3 Windows 7 machte eine Installation von CodeVisionAVR V2 60 als Vollversion notwendig Daraus leiten sich auch viele Anderungen im Detail fur die C Programmierung Gruppe 500 ab 4 Neu Installation von AVR Studio Vers 4 19 unter Windows 7 5 Zur Demonstration des Tools AVR Studio ist in Gruppe 200 eine Trennung in Teil 205 Assembler und AVR Studio und Teil 206 C Compiler und AVR Studio vorgenommen worden 6 ASM und C Projekte werden jeweils in eigenen Gruppen gesammelt Gruppe 400 fur Assembler und Gruppe 600 fur C Projekte Tools_206 06 02 2014 Seite 3 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio 6 CodeVisionAVR C Compiler und AVR Studio Anmerkungen 1 Dieser Teil 206 setzt eige
26. er CodeVisionAVR 15 CHR eiserne ER 16 DEI CURT 2005 17 Autor 20 2 2 2 Alwin Lenck ALE23 basierend auf dem Projekt PB LED von Udo Juerss B8 RE a SS SS SS SS SS SS SS SS SS SS SS SS SS eS e e e e e a 19 20 Dieses Projekt stellt eine Applikation zur Demonstration der Taster Pushbottons und LEDs auf dem Testboard dar 21 Die Taster sind nicht entprellt 22 23 Die LEDI ist im Ruhezustand AUS und bei gedrueckter Taste S1 EIN 24 Die LED2 ist im Ruhezustand EIN und bei gedrueckter Taste S2 AUS 25 Die LED3 toggelt beim Betaetigen der Taste S3 von AUS nach EIN und umgekehrt 26 27 BB eee 28 In der Header Datei application h koennen die Definitionen fuer die Tasten und LEDs geaendert werden 29 Die Definitionen sind hier vie folgt festgelegt 30 31 Komponente ATmegai amp Pins 32 LEDS 33 LED1 PC2 kann in application h geaendert werden 34 LED2 PC3 kann in application h geaendert werden 35 LED PC4 kann in application h geaendert werden 36 37 Taste 38 Si PB3 kann in application h geaendert werden 39 52 PB4 kann in application h geaendert werden 40 53 PB5 kann in application h geaendert werden 41 a2 2 ae 43 Header Dateien einfuegen 44 e 45 include application h 46 47 Of man ene 48 Globale Variablen 49 ae 50 uoe n 51 52 ee 53 Hauptpro
27. ergegeben werden so dass das entsprechende Men ausge punktet dargestellt wird Nach dem Download steht die Datei setup exe zur Verf gung Bei der Installation wird man sogar gefragt ob man Deutsch als Sprache w nscht Allerdings wird der Wunsch sp ter nicht mehr erf llt is Setup CodeVisionAVR C Compiler En aloj x Willkommen zum CodeVisionAVR C Compiler Setup Assistenten Dieser Assistent wird jetzt CodeVisionAVR V2 60 auf Ihrem Computer installieren Sie sollten alle anderen Anwendungen beenden bevor Sie mit dem Setup fortfahren Weiter zum Fortfahren Abbrechen zum Verlassen Abbrechen Bild 6 1 01 Begr ungs Fenster vom CodeVisionAVR C Compiler Tools _206 06 02 2014 Seite 4 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio ie Setup CodeVisionAVR C Compiler Lizenzvereinbarung Lesen Sie bitte folgende wichtige Informationen bevor Sie fortfahren Lesen Sie bitte die folgenden Lizenzvereinbarungen Benutzen Sie bei Bedarf die Bildlaufleiste oder dr cken Sie die Bild Ab Taste SOFTWARE LICENCE The use of CodeVisionAVR indicates your understanding and acceptance of the following terms and conditions This license shall supersede any verbal or prior verbal or written statement or agreement to the contrary If you do not understand or accept these terms or your local regulations prohibit after sale license agreeme
28. figure Project Add gt Bild 6 2 1 08 Neue Projekt Struktur Part 1 Input Files Im Hauptfenster von CVAVR sieht man bereits dass auf der linken Seite im Code Navigator der Pro jekt Name AVR_PB_LED und in der Kopfzeile der Name der Projekt Datei AVR_PB_LED prj einge tragen sind Ele Edit Search View Project Tools Settings e ber Heagoeg m NRE a 0 n aap ra2o1o BEBE AAN I3 0 ER 6 S VIO EEE 1 ERKFERE BEE E Code Navigator amp CadeVisionAVR A Project AVR_PB_LED 9 Other Files amp Bild 6 2 1 09 Hauptfenster von CVAVR Jetzt m ssen alle C Dateien zum Kompilieren und Binden dem Projekt bekannt gemacht werden Das Menu lasst automatisch nur C Dateien zu und weist damit bereits darauf hin dass nur die C Dateien den anfanglichen Start bestimmen Die Header Dateien werden erst wahrend der Kompilierung ge nauer wahrend des Preprozessor Laufs aus den C Dateien heraus aufgerufen und in das Coding eingef gt Tools_206 06 02 2014 Seite 15 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio CodeVisionAVR J AVR_PB_LED AVR_PB_LED prj 1 aeae Mai Be BEE jann ewe ee le te 1 Vy se oe ino Code Navigator tee Code Informa CV Code ision VA R Project AVR_PB_LED Suchenin j AVRPBLED Adorem pa Nicht angegeben 6 aiik ji Exe 18 03 2012 23 47 Ji Linker 18 03 2012 23 47 J ust 18 03 2012
29. gramm main 5 5 5 5 5 5 54 Of ene 55 void main void 56 57 Setzen des System Taktes CPU Clock Ausschalten nicht benutzter Hardware Module 58 app _init Initialisierung der Anvendung 59 60 Initialisieren der Tasten Pushbuttons 61 1_INIT 62 2_INIT 63 53_INIT 64 65 Initialisieren der LEDs 66 LED1_DDR LED1_BIT Setze LED1 Pin auf Ausgabe 67 LED2_DDR LED2_BIT Setze LED2 Pin auf Ausgabe 68 LED3_DDR LED3_BIT Setze LED3 Pin auf Ausgabe 69 70 Alle LEDs 3 mal aufleuchten lassen Lampen Test 71 for n 3 n n 72 73 LED1_PRT LED1_BIT LED1 auf EIN 74 LED2_PRT LED2_BIT LED2 auf EIN 75 LED3_PRT LED3_BIT LED3 auf EIN 76 77 delay_ ms 250 250 ms Verzoegerung 1 4 Sekunde 78 79 LED1_PRT amp LED1_ BIT LED1 auf AUS 80 LED2_PRT amp LED2_BIT LED2 auf AUS 81 LED3_PRT amp LED3_BIT LED3 auf AUS 82 83 delay ms 200 200 ms Verzoegerung 1 5 Sekunde 84 65 86 ee 87 Hauptschleife 88 Y ene 89 while true Endlosschleife 90 91 Wenn Taste S1 gedrueckt wird dann leuchtet LED1 92 if S1_PRESSED 93 94 LED1_PRT LED1_ BIT LED1 auf EIN 95 96 else 97 98 LED1_PRT amp LED1_BIT LED1 auf AUS 99 100 1101 Wenn Taste S2 ged
30. igure Project AVR_PB_LED prj q x Files C Compiler Before Build After Build Input Files Output en Executable Files Exe fe Object Files oO List Files List El SER z Linker Files CodeVisionAVR L AVR_PB_LED AVR_PB_LED prj Linker E Be Edt Search View Project Toob Settings Help De Hg checayntax gh t ap M AB Compie 3 a 17 com aT EEE a Shift F9 E Code Navigator Sa Build All Cirle Fo E amp Y CodeVisionAvR Stop Campllation a f Project AVR_PB_ Clean Up i Notes be application c Information In main c EO Bl Headers amp Go to Next Error Fa MB List Files B Goto Previous Error CH F8 F ae BE Go to Next Warning F4 A wer RRI el Goto Previous Warning Ein F4 a mi Other Files A Configure FE X Conc 2 Help Bild 6 2 2 01 Aufruf des Konfigurations Menus Bild 6 2 2 02 Configure Project Part 2 Output Directories Project gt Configure gt i Configure Project AVR_PB_LED prj __ Output Directories In dieser Abbildung werden die Ausgabe Ordner angezeigt in denen bei der Kompilierung die Ergeb nis Dateien abgelegt werden Executable Files El a KINGSTON L hex Dateien vom Linker H ALEs_ASM_Progs Object Files A AVR_PB_LED obj Dateien nach dem Lauf des Assemblers Exe List Files Linker asm Dateien nach der Kompilierung I Lst Linker Files FE Obj a und o Dateien zum Linken Binden Tools _206 06 02 2014 Sei
31. il 207 Editor UltraEdit See oREICSO MARS nMan BSR Bw bs MEABAS B SROS O RARA HMR AESMA EA 7 HO BEE TE CY Boe MOB i Fd Coda tet D AVA_FE_LED sam AVR_PR_LED Ist D AVA_FR_LED map ar Fikes Bot C CodeVisionAVR S F Project AVR_PB_LED 8 Notes application c main c Headers A List Files D AVR_PB_LED asm B AVR_PB_LED Ist B AVR_PB_LED map 9 Other Files a D Staite ee Functions fO app_init void 0 app_set_watchdog_prescale Notes main c B Projekt 601 Demonstration der Taster und LEDs auf dem Testboa Zusaetzliche Header keine Module c und h application Benoetigte Hardware Testboard Taster Si S2 S3 und LEDI LED2 LED3 VersTlunsasssasseweuuue ei Compiler eeeeeeeees CodeVisionAVR CE na gt gt gt 0 gt gt gt DALI 2 0 0 0 0000 0000008 wn 2009 AULOY 2c eee ee eee eet Alwin Lenck ALE23 basierend auf dem Projekt PB n Bild 6 2 1 15 VergroBerung von Bild 6 2 1 14 Projekt Stand vor der Kompilierung Tools_206 06 02 2014 Seite 18 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio 6 2 2 Konfiguration des C Projektes Bevor das Programm kompiliert wird sollen vorher noch einige andere Listen zur Konfiguration des Projektes genauer betrachtet werden Dazu wird erst einmal das Konfigurations Men erneut aufgeru fen 4 Conf
32. ile Such Funktion gefunden werden Debugger Directory and FileName if x Suchen in J AvrStudio4 GO ctm Name v Gr e v nderungsdatum v Typ Nicht angegeben 8 ZURA or A bin 06 09 2012 21 49 Dateiordner bh dil 06 09 2012 21 50 Dateiordner edi 06 09 r j Desktop dh edit 6 09 2012 21 49 Diran J resources 06 09 2012 21 49 Dateiordner J skins og 06 09 2012 21 49 Dateiordner Bibliotheken AVRStudio exe 3 223 KB 25 08 2011 21 05 Anwendung JB PluginManager exe 55KB 25 08 2011 20 58 Anwendung E xmiconvert exe 284KB 25 08 2011 20 59 Anwendung Computer 4 gt Dateiname 2 ffnen n B Dateityp Executables exe v Abbrechen Bild 6 3 03 Suchen der Datei AVRStudio exe Hinweis Hier findet ein gleitender bergang zum n chsten Abschnitt statt Man befindet sich schein bar noch in der Anwendung CVAVR Denn aus dieser heraus wird der Debugger aufgerufen der aber schon Bestandteil des AVR Studio ist 6 4 AVR Studio Debugger Mit dem Debugger des AVR Studios kann man bevor man den Objekt Code des fertig kompilierten Projektes in den Flash Speicher des Mikrocontrollers bertr gt Schritt f r Schritt den Programmab lauf simulieren CodeVisionAVR L AVR_PB_LED AygPB_LED prj Fie Edit Search View Project Tools Settings Help De HEISE Shift F2 as BOF Debugger gt Shift F3 ET lite WB Sf BB Ry Chip Program Terminal E Code Navigator
33. ily located in any memory area during variable declaration the compiler now makes distinction between the const type qualifier and the flash memory attribute In order to maintain compatibility with V1 25 x projects the Project Configure C Compiler Code Generation Store Global Constants in FLASH Memory must be checked If this option is not checked identifiers declared with the const type qualifier will be placed in RAM the preprocessor does not use the old funcused directive when it is found it is always evaluated to 1 added the message preprocessor directive the abs cabs labs and fabs functions were moved from the math h header to the stdlib h header improved error and warning checking improved linker only the modified C source files are compiled when the Project Build command is executed improved COFF object file generator improved code optimizer enhanced libraries including MMC SD SD HC FLASH Memory Card and FAT support I O registers bits definitions were added to the device header files For projects created with prior versions these definitions are not enabled by default In order to enable them the Project Configure C Compiler Code Generation PreprocessorlInclude I O Registers Bits Definitions option must be activated For newly created projects this option is enabled by default in order to eliminate naming conflicts with I O registers bits definitions the names of the SPCRO SP
34. ing enclosed between quotes is passed as an argument to a function parameter of pointer to char the pointer now can point to any memory type RAM EEPROM or FLASH not only FLASH like in previous versions The CodeVisionAVR C Compiler Reference Constants Help topic and User Manual chapter were updated to reflect this change 3 2 IDE completely redesigned text Editor with improved syntax highlighting for both C and AVR assembly added function parameters and global structure union members auto complete improved code folding code folding state can be saved and restored bookmarks state can be saved and restored added automatic matching brace highlighting when the user places the cursor before the brace added automatic file saving at specified time interval the Code Navigator was redesigned and displays project information in a more logical way an additional Code Information tab is present after a project build It displays detailed information about the included header files preprocessor macro definitions type definitions global static variable declarations memory allocation and function definitions added the Functions Call Tree tab in the Navigator the new Project Configure Files Output Directories allows to specify in which directories the files generated by the compiler linker will be placed improved toolbar It is important to note that in CodeVisionAVR V2 the asm hex eep cof files created by the compi
35. ist erforderlich lt Zur ck Abbrechen Bild 6 1 04 Installations Ordner sollte nicht ver ndert werden Der Ordner c cvavr2 ist sehr wichtig und sollte nicht verschoben werden Denn an diesem Ort werden auch die Bibliotheken abgespeichert iy Setup CodeVisionAVR C Compiler Starimenu Ordner ausw hlen Wo soll das Setup die Programm Verknupfungen erstellen hb Das Setup wird die Programm Verknupfungen im folgenden Startmenu Ordner erstellen Klicken Sie auf Weilter um fortzufahren Klicken Sie auf Durchsuchen falls Sie einen anderen Ordner auswahlen mochten CodeVisionAVR Durchsuchen Bild 6 1 05 Startmen Ordner Auch der Ordner f r das Startmen CodeVisionAVR sollte auf seinem vorgesehenen Platz belassen werden Man findet die notwendigen Dateien schneller wieder zum Beispiel C ProgramData Microsoft Windows Start Menu Programs CodeVisionAVR Tools_206 06 02 2014 Seite 6 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio ioe Setup CodeVisionAVR C Compiler Installation durchfuhren Das Setup ist jetzt bereit CodeVisionAVR C Compiler auf Ihrem Computer zu installieren Klicken Sie auf Installieren um mit der Installation zu beginnen oder auf Zur ck um Ihre Einstellungen zu berpr fen oder zu andern Ziel rdner n c cvavre Starnmenu Ordner CodeVisionAVR d Installiere __ Warten Si
36. ler have the name of the project prj file 3 3 CodeWizardAVR Generates code using symbolic names for peripheral configuration registers bits Improved user interface Tools_206 06 02 2014 Seite 11 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio 4 New ATxmega chips support in CodeVisionAVR the Standard C I O Functions use by default the USARTCO This can be changed by defining the _ATXMEGA_USART_ macro as described in the corresponding Help topic the SPI functions use by default the SPIC controller on PORTC This can be changed by defining the ATXMEGA_SPI_ and _ATXMEGA_SPI_PORT_ preprocessor macros as described in the corresponding Help topic the RTC functions do not yet support the ATxmega chips 5 Example programs The Compiler is supplied with the following example programs ATxmega chips in EXAMPLES ATxmega Graphic LCDs in EXAMPLES Graphic LCD SD FLASH Memory Cards access in EXAMPLES SDCARD USB in EXAMPLES USB AVR 109 Bootloader AES Encryption Decryption ATmega8535 ADC on the STK500 in EXAMPLES ADC8535 Real Time Clock with ATmega103 Atmel Application Note AVR134 in EXAMPLES AVR134 Calling functions written in assembler from C in EXAMPLES C_ASM Moving LED in EXAMPLES LED Accessing the EEPROM in EXAMPLES EEPROM LCD Demo in EXAMPLES LCDDEMO Definition of user characters in LCDs in EXAMPLES
37. mmt sind u a Einf gen von Header Dateien die mit include file in den Quell Dateien aufgef hrt sind 2 Arbeitsschritt Lauf des C Compilers zur bersetzung der in der Programmiersprache C ge schriebenen Befehle in Assembler Anweisungen gt asm Dateien dieses sind ebenfalls editierbare Text Dateien 3 Arbeitsschritt Lauf des Assemblers zur bersetzung der Assembler Anweisungen in Maschi nen Befehle Module im Objekt Code gt a Dateien und o Dateien 4 Arbeitsschritt Lauf des Linkers Binders zur Verbindung aller Objekt Module zu einem lauff higen ausf hrbaren Computer Programm gt hex Datei In CVAVR kann das C Projekt sequentiell d h in Einzel bzw Stufenschritten generiert werden Project gt Compile F9 Dieser Schritt produziert die Objekt Dateien f r den Linker Die Kompilierung wird nur f r die nach dem letzten Durchlauf ver nderten Programm Module durchgef hrt Project gt Build Shift F9 Dieser Schritt produziert ein neues Assembler Quell Pro gramm mit der Erweiterung asm wobei nur die ver nderten Quell Dateien neu kompiliert werden Wenn keine Fehler er kannt wurden wird automatisch der Atmel AVR Assembler aufgerufen der die eben erzeugte asm Datei assembliert Das Ausgabe File ist eine ausf hrbare Programm Datei mit dem Format hex Project gt Build All Ctrl F9 Vollst ndige Kompilierung Assemblierung Verlinkung aller Quellen Zusammenfassung aller Arbeitssch
38. nclude VO Registers Bits Definitions Programm von Interesse d Configure project AVILES say xl Bild 6 2 2 04 Configure Project Files C Compiler Before Build After Build Part 4 Messages Code Generation Libraries Messages Globally define Paths V Enable Warnings amp Das ist die Liste Messages in der man an Warnings geben kann welche Hinweise und Warnun constant out of range gen man erhalten m chte I possible loss of precision array index is out of range Rest OCAT Rares IE OU Change Das Setzen bestimmter Warnungen kann interrupt vector exceeds the allowable range constant not initialized beim Testen sehr hilfreich sein um uner suspicious pointer conversion edesti Alsady allocated reichbaren Code anzuzeigen oder davor zu BO EEN warnen dass Variable deklariert sind die gar function must have a return value f unused function was removed by the linker nicht benutzt werden function parameter was not referenced function parameter name doesn t match its previous declaration local variable was declared but not referenced local variable set but not used local variable is used before its value is set global variable constant was declared but not referenced label declared but not referenced empty line expression with possibly no effect unknown escape sequence shift result will be 0 overflow is possible in 6 bit addition overflow is possible in 6 bit multiplication overflow is
39. nstanzen 6 2 1 Ein neues Projekt beginnen Oben wurde das Compiler Tool CodeVisionAVR installiert jetzt wird das erste Projekt wenn auch nur entlehnt durch Start dieses Tools erzeugt Eirl 0 E let Eirl 5 HES Ee i ave As 3 AE Code Informa Y 23 F Function Call Tree _ ER ay All ShitcHotits kr Create New File al xl E Cin ha fe Eiose Multple Tea Glose All Ei Gonvert to Liprery 7 x Cancel Pant Preview Print chap i Exit Alt F4 Messages s E iraran l g tia i i Bild 6 2 1 01 CVAVR f r ein neues Projekt starten File gt New gt Create New File gt Project gt OK code fol gt File Edit Search View Project Tools Settings Help Deo H AGCeS M RRS a ae s_e 0 9 S BBx Bl CIETIE EFO IE TEE co ae i EEE 1 lE e BAECJIGCEER x Ca Code Navigator Fo tes Code Informa 7 42 EJ Function Call Tree 3 Code Tem 7 x Gach 9 Fo EGY Codevision vR 9 No Project F 9 Other Files Tr h You are about to create a new project ur CP Do you want to use the CodeWizardAVR HJ Messages 263 B Errors B Wamings e Bild 6 2 1 02 Anfrage ob der CodeWizard AVR benutzt werden soll Tools _206 06 02 2014 Seite 13 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio Es soll der CodeWizardAVR nicht verwendet werden gt No es meldet sich das Fenster Creat
40. ntlich Programmierkenntnisse in der Programmiersprache C zur Erzeu gung lauffahiger Programme mit dem CodeVisionAVR C Compiler voraus Da hier allerdings nur die Handhabung von AVR Studio und das in der Gruppe 500 detailliert behandelten CodeVisionAVR C Compilers beschrieben werden soll werden die Schritte anhand eines fertigen kleinen Programms erlautert 2 Von der Seite http lehrer schule at Doblinger files AVR Studio 4 Tutorial pdf die leider nicht mehr auffindbar ist sind in diesem Abschnitt einige Anregungen entnommen worden 6 1 CodeVisionAVR C Compiler installieren Die Installation der Version aus dem Download Center vom www cczwei de des ATM18 Projektes ist nicht unter Windows 7 lauff hig Man beachte f r alle Versionen von CodeVisionAVR C Compiler hei en die Installationsprogramme setup exe Auch ein neuer Versuch mit CodeVisionAVR Evaluation V2 05 7a von der HP Info Tech Homepage http www hpinfotech ro html download htm f hrte leider nicht zum vollen Erfolg da die Beispielpro gramme unter den Einschr nkungen der Demoversion nicht lauff hig sind Ein Bettelbrief an den Hersteller HP Info Tech mit Hinweis auf das ATM18 Projekt http www cczwei forum de cc2 thread php threadid 1797 hat dem Verfasser dann eine verbilligte Vollversion eingebracht Inzwischen ist die Version V2 60 verf gbar die hier installiert wird Aus verst ndlichen Gr nden kann das Setup Passwort welches man beim Kauf erh lt hier nicht wied
41. nts or limited disclaimers you must cease and desist using this product immediately This product is C Copyright 1995 2012 Pavel Haiduc and HP InfoTech s r l all rights reserved je Ich akzeptiere die Vereinbarung Ichlehne die Vereinbarung ab lt Zur ck Bild 6 1 02 Lizenzvereinbarung akzeptieren Die positive Antwort auf die obligatorische Anfrage nach dem Akzeptieren der Lizenzbestimmungen wird dann die Installation eingeleitet iy Setup CodeVisionAVR C Compiler Passwort Diese Installation wird durch ein Passwort gesch tzt Bitte geben Sie das Passwort ein und klicken Sie danach auf Weiter Achten Sie auf korrekte Gro Kleinschreibung Passwort pwee _Anrecren_ Bild 6 1 03 Passwort eingeben Mit jeder neuen Programmversion ist ein neues Passwort beim Installieren einzugeben Das Passwort und die Download Adresse erh lt man per E Mail vom Hersteller HP Info Tech s r l 8 Tools_206 06 02 2014 Seite 5 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio ie Setup CodeVisionAVR C Compiler Ziel rdner w hlen Wohin soll CodeVisionAVR C Compiler installiert werden L Das Setup wird CodeVisionAVR C Compiler in den folgenden Ordner installieren Klicken Sie auf Weiter um fortzufahren Klicken Sie auf Durchsuchen falls Sie einen anderen Ordner auswahlen mochten Mindestens 76 5 MB freier Speicherplatz
42. on or off link located at the bottom of the window in the new window that will open uncheck the Use User Account Control UAC to help protect your computer check box and press the OK button to confirm the computer will have to be restarted for this setting to become effective run the CodeVisionAVR setup exe installer after the installation is complete right click on the CodeVisionAVR icon on the desktop select Properties in the popup menu that will open a new window called CodeVisionAVR Properties will open select the Compatibility tab check the Privilege Level Run this program as an administrator check box and press the OK button to confirm 2 New features bug fixes in CodeVisionAVR V2 60 2 1 Compiler Added support for the llitek ILI9325 graphic TFT LCD controller only for Advanced license Improved the library for the Solomon Systech SSD1289 graphic TFT LCD controller Modified the alphanumeric LCD library alcd h to be compatible with the Novatech NT3881 controller 2 2 CodeWizardAVR Added the possibility to automatically set all the timer configuration registers for user specified operating mode period and output duty cycle s Fixed the Timer5 OC5A OC5B OC5C outputs were assigned to non existent PORTM instead of PORTL for the ATmega640 1280 2560 chips Fixed the OC4A OC4B OC4C OC5A OC5B OC5C outputs are not present for the ATmega1281 2561 chips Fixed the ADTSO 3 bits in the SFIO
43. piler Beenden des CodeVisionAVR C Compiler Setup Assistenten Das Setup hat die Installation von CodeVisionAVR C Compiler auf Ihrem Computer abgeschlossen Die Anwendung kann uber die installierten Programm Verknupfungen gestartet werden Klicken Sie auf Fertigstellen um das Setup zu beenden y CodeVisionAVR C Compiler starten Bild 6 1 09 Installation ist abgeschlossen Die neue Version unter Windows 7 wird gleich gestartet Tools_206 06 02 2014 Seite 8 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio CodeVisionAVR Rapid Application Development for Atmel AVR Microcontrollers Version 2 60 Standard Copynght 1998 2012 HP Infolech s Bild 6 1 10 Man beachte dass die Version 2 60 Standard keine Evaluation Testversion ist CodeVisionAVR a ss o x Ele Edit Search View Project Tools Settings Help oes He ogo migks 3 db E gt Ba A eer ie Ke p m em alt s TANEET DOSC 50 masse XO etal Eevee owl mB E Code Navigator v 63 RB Code Information 9 1 ef Function Call Tree Gd SCodeTe Y eh Clip Y 7 E EEV CodeVisionAVR if E No Project be Other Files if O do while while ts for 77 ts switch case switch case void main void Messages Sau B Errors B Wamings Bild 6 1 11 Erstes Bild nach der In
44. possible in 6 bit shift left overflow is possible in 16 bit addition overflow is possible in 16 bit multiplication overflow is possible in 16 bit shift left possibly incorrect assignment pointless integer comparison controlling expression is constant ee ee ee ee m ee ee ee 4100900000000 0000000000000000009 Tools_206 06 02 2014 Seite 20 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio xj Bild 6 2 2 05 Configure Project Part 5 Paths 4 Configure Project AVR_PB_LED prj Files C Compiler Before Build After Build Code Generation Libraries Messages Globally define Paths Hi k Pfade fi stolich ler K nnen neue Pfade tur zus tzliche include und library Dateien angelegt werden include paths one per line include paths one per line fur globale Header Dateien Library paths one per line fur Bibliotheksdateien Fur die hier generierten AVR Projekte wird von dieser M glichkeit kein Gebrauch ge macht Library paths one per line CAcvavre lib X Cancel Help 6 2 3 Arbeitsschritte zur Generierung eines C Projektes M L AVR_PB LED x Favoriten Name Gr e nderungsdatum Typ Nicht angegeben 14 Beton J Exe 15 09 2012 21 13 Dateiordner a Be J Linker 15 09 2012 21 13 Dateiordner Ay Computer J List 15 09 2012 21 13 Dateiordner amp Netzwerk J Obj 15 09 2012 21 13 Dateiordner B Systemste
45. ritte zu einem Ar beitsgang Da das Projekt bereits an anderer Stelle getestet wurde sind keine Fehler mehr zu erwarten so dass sofort mit dem Schritt Build All Ctr F9 fortgesetzt wird CodeVisionAVR L AVR_PB_LED AVR_PB_LED prj File Edit Search View Project Tools Settings Help DSS H amp GHB check Syntax pee BS 7 4 o 8 8 BE Blt A i oP A OP comple Fo Apu 4k40 REES KO he a S See f Code Navigator 54 Build All S Ctri F9 EV CodeVisionAVR Stop Gompilats fl Project AVR_PB_ Clean Up ER Notes VAVR_PB_LED main c Notes main c EY 1 B1 Bild 6 2 3 03 Project gt Build All Ctrl F9 Tools _206 06 02 2014 Seite 23 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio Wenn die vollstandige Kompilierung fehlerfrei aber wahrscheinlicht nicht kommentarlos gelaufen ist werden Uber dem Haupt Fenster von CVAVR zwei Informations Listen am Ende der Projekt Generierung offeriert Sie zeigen die Ergebnisse f r die Kompilierung und die Assemblierung CodeVisionAVR L AVR_PB_LED AVR_PB_LED prj fra ef Fle Edit Search View Project Tools Settings Help lObeo H EOREC G TRS gt ck TeBe B a F 74 0 0 8 88 Alt PAM DPEBROL OA SESE AMA 44an Ta 63 79 FSS 1 ES YERAE BES E Code Navigator Ra
46. rueckt wird dann schaltet LED2 auf AUS 02 if S2_PRESSED 03 104 LED2_PRT amp LED2_ BIT LED2 auf AUS 1105 106 else 1107 108 LED2_PRT LED2_BIT LED2 auf EIN 09 10 11 Wenn Taste S3 gedrueckt wird dann toggle LED3 EIN AUS EIN AUS 12 if S3_PRESSED 1113 14 LED3_PRT LED3_BIT Toggle LED3 115 16 53_WAIT_NOT_PRESSED Warte bis Taste S3 losgelassen wird 1117 118 119 820 renee nana 121 tu 4 gt H Messages B Errors B Wamings 119 98 Insert Code Information may be incomplete as the fie was not Compiled yet Bild 6 2 3 02 Ausgangslage zur Kompilierung CVAVR Bildvergr erung Tools 206 06 02 2014 Seite 22 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio Die Ausgangslage fur die Kompilierung sind in einem C Projekt die sog Quell Dateien In diesem Projekt sind das e Das Hauptprogramm main c e Das Modul application c incl application h e Die Header Datei typedefs h e Die Header Datei iomx8 h e Die Header Datel macros h e Die Header Datei switches h Aus ihnen entsteht in grunds tzlich 4 Arbeitsschritten das fertige Kompilat das hei t die ausf hrbare hex Datei 1 Arbeitsschritt Lauf des Preprozessors Auswerten aller Anweisungen die mit beginnen Das sind Anweisungen die ausschlie lich f r den Preprozessor besti
47. stallation Bildvergr erung Damit ist CVAVR installiert und der erste Aufruf sollte ungef hr wie im Bild 6 1 11 aussehen Bei sp teren Aufrufen wenn schon mit dem CVAVR gespielt worden sein sollte erinnert sich das Tool an die letzte Einstellung und gibt diese wieder Wenn man nicht gerade an einem gr eren Projekt ber einen ausgedehnten Zeitraum arbeitet bei dem diese Verfahrensweise sehr vorteilhaft ist so wird man sicherlich bei einem neuen Projekt beginnen wollen Das Er ffnungsfenster erh lt man nach erstmaligem Aufruf oder alle mal nach File gt Close All es sind jedoch ggf einzelne Spalten ausgeblendet Zum CVAVR ist auch schon viel geschrieben worden so dass es fast m ig ist dem noch etwas hin zuf gen zu wollen Aber Bei der Installation gibt es noch allerlei Kleinigkeiten auf die es sich lohnt Tools_206 06 02 2014 Seite 9 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio hinzuweisen Der lange Hinweis bei der Installation Bild 6 1 08 Setup ist schnell weggeklickt Er ist aber in einigen Punkten sehr aufschlussreich und deshalb als Original Zitat hier zum Nachlesen wie derholt Welcome to the CodeVisionAVR C Compiler V2 and the CodeWizardAVR Automatic Program Generator The compiler is designed to be used along with the AVR Studio V4 19 V5 1 or Atmel Studio 6 0 or later debuggers which can be downloaded from the ATMEL web site
48. ste 53 gedrueckt wird dann toggle LED3 EIN AUS if S3_PRESSED LED3_PRT LED3_BIT Toggle LED H2 E LAAVR_PB_LED main c a Loaded plugin STK500 AVR Simulator Please wait while configuring simulator AVR Simulator ATmega88 Configured OK Loaded objectfile L AVR_PB_LED AVR_PB_LED cof E gt Build ih Message H Find in Files T Breakpoints and Tracepoints ATmega88 AVR Simulator Auto Stopped Ln 58 Col 1 CAP NUM OVR 4 Bild 6 4 06 Debug Plattform mit Quell Datei main c Bildvergr erung Mit der Funktionstaste F10 bzw F11 vom PC kann man nun Schritt f r Schritt den Programmablauf simulieren Wenn man dabei den Cursor auf eine Variable positioniert dann bekommt man den jewei ligen Wert angezeigt Im Men punkt Debug kann man sehen was sonst noch so alles m glich ist Hier nur ein paar Hinweise der zahlreichen M glichkeiten des Debuggers Wenn man in CVAVR eine nderung im Quell Programm vornimmt neu kompiliert und wieder nach AVR Studio wechselt dann merkt AVR Studio dass sich die cof Datei ge ndert hat und fragt nach ob diese Datei neu geladen werden soll Wenn diese Anfrage mit JA beantwortet wird dann startet der Debugger nach dem Neuladen wieder von vorne Wenn AVR Studio neu aus CVAVR heraus gestartet wird dann kann ein vorhandenes Projekt unter dem Men punkt Project gt Recent Project Projektname wieder unkompliziert geladen werden Tools _206 06 02 2014 Seite 29 von 3
49. te 19 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio RESTE gt Bild 6 2 2 03 Configure Project Files C Compiler Before Build After Build Part 3 Code Generation Code Generation Libraries Messages Globally define Paths Hier k nnen Einstellungen f r den Chip und me RAM Chip ATmegass E2 Gam Siekeeire ose ae den Compiler zur Generierung der Ausgabe z im u ce oe Die Einstel Memory Model Internal RAM Size hoa hes ungen weraen wie angegepen vorgenom Smal i men Besonders zu beachten sind Optimize for Size x Code Generation Chip ATMega88 Optimization Level Bit Variables Size 16 Use GPIOR gt 31 Clock 16 MHz Maximal v ate chartoint V charis unsigned Program Type Application Pragam Type 8bitenums Enhanced Par Passing Data Stack Size 256 bvtes Application 2 y 7 V Automatic Global Register Allocation Heap Size 0 Bytes s printf Features V Store Global Constants in FLASH Memory lint width 2 Use an External Startup Initialization File Internal RAM Size 1024 bytes s scant Features v Clear Global Variables at Program Startup Bit Variable Size 16 Stack End Mark int width Bun Use GPIOR gt 31 nicht gesetzt File Output Format s COF ROM HEXEEP w Sn File Output Format s a ee Formate der Ausgabe Dateien hier ist vor D rangig das Format HEX f r ein ausf hrbares Jv I
50. teiordner J Obj 23 09 2012 19 39 Dateiordner application c 11KB 15 08 2009 14 17 C compiler source file application cci 1KB 23 09 2012 19 49 CCI Datei application h 36 KB 15 08 2009 21 34 C compiler header file application hci 1KB 23 09 2012 19 49 HCI Datei application i 9KB 23 09 2012 19 49 C compiler library file AVR_PB_LED cbi 1KB 23 09 2012 19 49 CBI Datei AVR_PB_LED cof 23 09 2012 19 49 COFF symbolic debug file AVR_PB_LED fct 1KB 23 09 2012 19 49 FCT Datei AVR_PB_LED prj 6KB 23 09 2012 19 50 CodeVisionAVR Project File AVR_PB_LED prj 5KB 23 09 2012 19 40 PRJ Datei iomx8 h 46 KB 15 08 2009 15 08 C compiler header file iomx8 hci 11 KB 23 09 2012 19 49 HCI Datei macros h 4KB 15 08 2009 20 07 C compiler header file macros hci 1KB 23 09 2012 19 49 HCI Datei main c 6 KB 15 09 2012 21 58 C compiler source file main cci 1 KB 23 09 2012 19 49 CCI Datei main i 9KB 23 09 2012 19 49 C compiler library file switches h 4KB 15 08 2009 20 09 C compiler header file switches hci 1KB 23 09 2012 19 49 HCI Datei typedefs h 9 KB 15 08 2009 20 13 C compiler header file typedefs hci 4 KB 23 09 2012 19 49 HCI Datei 38 Tools_206 Dateiname AVR_PB_LED cof au Files ffnen Abbrechen j 2 Z Bild 6 4 03 Suchen der COFF Datei 06 02 2014 Seite 27 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio Die bendtigte COFF Datei befindet sich im Verzeichnis L A
51. uerung application c 11KB 15 08 2009 14 17 C compiler source file 3 Papierkorb appiication h 36KB 15 08 2009 21 34 C compiler header file AVR_PB_LED prj 6KB 16 09 2012 13 15 CodeVisionAVR Proj AVR_PB_LED prj 6KB 16 09 2012 11 32 PRIJ Datei Ed AVR_PB_LED txt OKB 16 09 2012 13 15 Text Document iomx8 h 46 KB 15 08 2009 15 08 C compiler header file macros h 4KB 15 08 2009 20 07 C compiler header file main c 6KB 15 09 2012 21 58 C compiler source file switches h 4KB 15 08 2009 20 09 C compiler header file typedefs h 9KB 15 08 2009 20 13 C compiler header file a 14 Elemente i4eemente ll A Bild 6 2 3 01 Ausgangslage zur Kompilierung Stand der Dateien Tools_206 06 02 2014 Seite 21 von 32 AVR 8 bit Mikrocontroller Gruppe 200 Einsetzen von AVR Tools Teil 206 C Compiler und AVR Studio 3 1 ESFTSRE BEB Code Navigator TEE RB Code Information 9 F LAAVR_PB_LED main c 2 4 CodeVisionAVR 2 D ee aa 5 8 Project AVR_PB_LED FO Functions tie nanc 2 i Notes fO main void 4 D application c 2 main c 3 fl Headers 4 List Files 5 A AVR_PB_LED asm 5 D AVR_PB_LED lst 7 B AVR_PB_LED map 3 i il Other Files 9 Projekt 601 Demonstration der Taster und LEDs auf dem Testboard 10 Zusaetzliche Header keine 11 Module c und h application 12 Benoetigte Hardware Testboard Taster Si S2 S3 und LEDI LED2 LED 13 VSrsBoncicisisisisicicisisisisisic s Bes 14 Compil
52. www atmel com For JTAGICE 3 programming support to be available AVR Studio 5 1 or Atmel Studio 6 or later must be installed Details about using CodeVisionAVR with these debuggers are available in the Help topics CodeVisionAVR IDE Tools The AVR Studio Debugger CodeVisionAVR C Compiler Reference Using the AVR Studio 4 19 Debugger CodeVisionAVR C Compiler Reference Using the AVR Studio 5 1 and Atmel Studio 6 Debuggers and in the chapters 2 4 1 3 21 and 3 22 of the CodeVisionAVR User Manual 1 Installing CodeVisionAVR If you will use the Compiler under Windows 2000 XP Vista or Windows 7 you must first install and run it with Administrator privileges On subsequent runs under Windows 2000 or XP you may also have Power User privileges After installing under Windows 7 right click on the CodeVisionAVR icon and select Properties Shortcut Advanced and check the Run as Administrator check box For installing under Windows Vista the following steps should be performed having an Administrator account the Windows Vista User Account Control must be disabled using the steps below press the Windows button and click on the Control Panel link in the Control Panel window under the User Accounts and Family Safety click on the Add or remove user accounts link anew window will open click on the Go to the main User Accounts page link located at the bottom of the window anew window will open click on the Turn User Account Control
Download Pdf Manuals
Related Search
Related Contents
PIZ3 œ PIZ6 - Doyon Baking Equipment Inc ZTE MF28G user manual - 4G - Exhibio 510- H120 cm Mise en page 1 ビオテスト ハイコン® アガーストリップ ERC - Productos-Bituminosos-S.A. Copyright © All rights reserved.
Failed to retrieve file