{"id":552,"date":"2017-11-25T16:09:42","date_gmt":"2017-11-25T15:09:42","guid":{"rendered":"http:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=552"},"modified":"2017-12-30T19:43:47","modified_gmt":"2017-12-30T18:43:47","slug":"hinweise-myavr-workpad-und-avr-studio","status":"publish","type":"page","link":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/atmega2560\/hinweise-myavr-workpad-und-avr-studio\/","title":{"rendered":"Hinweise myAVR-Workpad und AVR-Studio"},"content":{"rendered":"<p><div id=\"nav-below\" class=\"navigation\"><div class=\"nav-previous\"><a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/atmega2560\/myavr-mk3-board\/\" title=\"myAVR-MK3-Board\"><span class=\"meta-nav\">\u2190<\/span> myAVR-MK3-Board<\/a><\/div><\/div><!-- #nav-below --><div id=\"nav-below\" class=\"navigation\"><div class=\"nav-next\"><a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/atmega2560\/komplette-library-liste-atmega\/\" title=\"Komplette-Library-Liste (ATMega)\">Komplette-Library-Liste (ATMega) <span class=\"meta-nav\">&rarr;<\/span><\/a><\/div><\/div><!-- #nav-below --><\/p>\n<p>Ich habe zu Anfang alle Librarys f\u00fcr das <strong>myAVR-Wordpad<\/strong> ausgelegt. Weil bei diesem keine C-Files eingebunden werden k\u00f6nnen, habe ich alle Files als H-Files erstellt. Das ist zwar nicht sehr elegant aber es ging halt nicht anders.<\/p>\n<p>Nach einiger Zeit bin ich dann auf das kostenlose AVR-Studio-4 gewechselt (was einen sehr viel besseren Editor besitzt) habe aber wegen der Kompatibilit\u00e4t weiterhin alle Librarys als H-Files erstellt.<\/p>\n<p><strong>AVR-Studio :<\/strong><\/p>\n<p>Bei der Benutzung der Librarys mit dem AVR-Studio muss folgendes beachtet werden :<\/p>\n<p>1. der Variablen-Typ \u201cbool\u201d der in einigen Librarys benutzt wird ist beim AVR-Studio nicht definiert. Um diesen Fehler zu beseitigen einfach diese Enumeration ganz zu Anfang im Programm (noch vor allen Includes) einf\u00fcgen<\/p>\n<pre lang=\"c\" line=\"1\">typedef enum {\r\n  false = 0,\r\n  true\r\n}bool;<\/pre>\n<p>oder alternativ diese Include Zeile einf\u00fcgen :<\/p>\n<pre lang=\"c\" line=\"1\">#include \r\n<\/pre>\n<p>2. in den Compiler-Options muss die Optimierung abgeschaltet werden. Sonst werden leere Warteschleifen wegoptimiert und einige Librarys funktionieren dann nicht mehr. Dazu unter \u201cProject\/Options\/General\u201d die \u201cOptimization\u201d auf \u201c-O0\u2033 einstellen.<\/p>\n<p><strong>Float-Ausgabe :<\/strong><\/p>\n<p>Falls in einem Programm eine Float Variable in einen String gewandelt werden soll, um diesen z.B. auf dem Display anzuzeigen oder per RS232 zu senden, dann muss folgendes beachtet werden :<\/p>\n<p>Im <strong>myAVR-Wordpad<\/strong> muss diese Zeile in den Header vom Hauptprogramm eingetragen werden.<\/p>\n<pre lang=\"c\" line=\"1\">\/\/ LinkerOption:    -Wl,-u,vfprintf -lprintf_flt -lm<\/pre>\n<p>Im <strong>AVR-Studio<\/strong> m\u00fcssen diese zwei Librarys hinzugef\u00fcgt werden :<\/p>\n<pre lang=\"c\" line=\"1\">\"libprintf_flt.a\"\r\n\"libm.a\"<\/pre>\n<p>Und zus\u00e4tzlich muss unter \u201cCustom Options\u201d diese Zeile bei den Linker-Options hinzugef\u00fcgt werden :<\/p>\n<pre lang=\"c\" line=\"1\">-Wl,-u,vfprintf<\/pre>\n<hr \/>\n<h3 id=\"comments-title\">3 Antworten auf <em>Hinweise myAVR-Workpad und AVR-Studio<\/em><\/h3>\n<ol class=\"commentlist\">\n<li id=\"li-comment-195\" class=\"comment even thread-even depth-1\">\n<div id=\"comment-195\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/687255699d801f1c9f1e3044cc8e42ef?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">Holger<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">16. Mai 2013 um 08:43<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>\u201c1. der Variablen-Typ \u201cbool\u201d der in einigen Librarys benutzt wird ist beim AVR-Studio nicht definiert.\u201d<\/p>\n<p>Doch!<br \/>\nAVR-Studio (4.18) mit WINAVR-Toolchain:<\/p>\n<p>#include<br \/>\nund schon gibt\u2019s true und false.<\/p>\n<p>Gru\u00df Holger\u2026<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/p>\n<ul class=\"children\">\n<li id=\"li-comment-196\" class=\"comment odd alt depth-2\">\n<div id=\"comment-196\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/687255699d801f1c9f1e3044cc8e42ef?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">Holger<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">16. Mai 2013 um 08:45<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>ups,\u2026<br \/>\n#include \u201cPfeillinks\u201dstdbool.h\u201dPfeilrechts<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/li>\n<li id=\"li-comment-202\" class=\"comment byuser comment-author-admin_ub bypostauthor even depth-2\">\n<div id=\"comment-202\">\n<div class=\"comment-author vcard\"><img loading=\"lazy\" decoding=\"async\" class=\"avatar avatar-40 photo\" src=\"http:\/\/0.gravatar.com\/avatar\/67426419ead44d5afa132e92685bb460?s=40&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D40&amp;r=G\" alt=\"\" width=\"40\" height=\"40\" \/><cite class=\"fn\">admin_ub<\/cite> <span class=\"says\">sagt:<\/span><\/div>\n<p><!-- .comment-author .vcard --><\/p>\n<div class=\"comment-meta commentmetadata\">16. Mai 2013 um 17:40<\/div>\n<p><!-- .comment-meta .commentmetadata --><\/p>\n<div class=\"comment-body\">\n<p>stimmt wahrscheinlich\u2026hab ich noch gar nicht ausprobiert <img decoding=\"async\" class=\"wp-smiley\" src=\"wp-includes\/images\/smilies\/icon_smile.gif\" alt=\":-)\" \/><br \/>\nwerde es als Hinweis auflisten, Danke<\/p>\n<\/div>\n<\/div>\n<p><!-- #comment-## --><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Ich habe zu Anfang alle Librarys f\u00fcr das myAVR-Wordpad ausgelegt. Weil bei diesem keine C-Files eingebunden werden k\u00f6nnen, habe ich alle Files als H-Files erstellt. Das ist zwar nicht sehr elegant aber es ging halt nicht anders. Nach einiger Zeit &hellip; <a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/atmega2560\/hinweise-myavr-workpad-und-avr-studio\/\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":548,"menu_order":2,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[127],"tags":[11,14,13],"class_list":["post-552","page","type-page","status-publish","hentry","category-atmega","tag-atmega2650","tag-avr-studio","tag-myavr-workpad"],"_links":{"self":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/pages\/552","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/comments?post=552"}],"version-history":[{"count":5,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/pages\/552\/revisions"}],"predecessor-version":[{"id":1218,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/pages\/552\/revisions\/1218"}],"up":[{"embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/pages\/548"}],"wp:attachment":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/media?parent=552"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/categories?post=552"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-json\/wp\/v2\/tags?post=552"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}