{"id":40,"date":"2010-02-15T12:57:06","date_gmt":"2010-02-15T12:57:06","guid":{"rendered":"http:\/\/www.uturtle.com\/blog\/archives\/40"},"modified":"2013-12-17T11:26:40","modified_gmt":"2013-12-17T02:26:40","slug":"atmega128-%ec%99%b8%eb%b6%80-%ec%9d%b8%ed%84%b0%eb%9f%bd%ed%8a%b8-%ec%8b%a4%ed%97%98","status":"publish","type":"post","link":"https:\/\/www.jinukbaek.com\/blog\/ko\/archives\/40","title":{"rendered":"ATmega128 \uc678\ubd80 \uc778\ud130\ub7fd\ud2b8 \uc2e4\ud5d8"},"content":{"rendered":"<p>ATmega128\ubcf4\ub4dc\uc5d0 \uac04\ub2e8\ud558\uac8c \uc678\ubd80 \uc778\ud130\ub7fd\ud2b8\uac00 \ubc1c\uc329\ud560 \ub54c\ub9c8\ub2e4\u00a0\ud604\uc7ac Count\ub97c \ub098\ud0c0\ub0b4\ub294 2\uc9c4\uc218\u00a0\uac12\uc744 LED\ub85c \ucd9c\ub825\ud558\ub294\u00a0\ucf54\ub4dc\ub97c \uc5f0\uc2b5\uc0bc\uc544 \ub9cc\ub4e4\uc5b4 \ubcf4\uc558\ub2e4.<\/p>\n<pre class=\"lang:c decode:true\"><code>#include &lt;avr\/io.h&gt;\r\n#include &lt;avr\/interrupt.h&gt;\r\n#include &lt;util\/delay.h&gt;\r\ntypedef unsigned char Byte;\r\nvolatile Byte count;\r\n\r\nISR(INT0_vect)\r\n{\r\n    count++;\r\n}\r\nvoid Interrupt_init(void)\r\n{\r\n    EICRA = 0x02; \/\/ \ud2b8\ub9ac\uac70 \ubc29\uc2dd\uc124\uc815\r\n    EIMSK = 0x01; \/\/ \uc778\ud130\ub7fd\ud2b8 Enable\r\n    DDRD = 0x00;\r\n    SREG |= 0x80;\r\n}\r\nint main(void)\r\n{\r\n    Interrupt_init();\r\n    DDRB = 0xff;\r\n    count = 0;\r\n    while(1)\r\n    {\r\n        PORTB = ~count;\r\n        if (count &gt;= 0xff) count = 0;\r\n    }\r\n\r\n    return 0;\r\n}\r\n<\/code><\/pre>\n<p>\uc5ec\uae30\uc11c \uc911\uc694\ud55c \uc810\uc740 \uc804\uc5ed\ubcc0\uc218\ub85c \uc120\uc5b8\ub418\uc5b4 \uc788\ub294 &#8216;count&#8217;\ubcc0\uc218\ub294 &#8216;volatile&#8217;\uc774\ub77c\ub294 \ud0a4\uc6cc\ub4dc\uac00 \uc124\uc815\ub418\uc5b4 \uc788\uc5b4\uc57c \ud55c\ub2e4\ub294 \uac83\uc774\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>volatile \ud0a4\uc6cc\ub4dc\ub294 \ub808\uc9c0\uc2a4\ud130 \ubcc0\uc218\ub85c \uc0ac\uc6a9\ub418\uc9c0 \uc54a\uc544\uc57c\ud55c\ub2e4\ub294 \uac83\uc744 \uc54c\ub9ac\ub294 \ud0a4\uc6cc\ub4dc\uc774\ub2e4. \ubcf4\ud1b5 \ud558\ub4dc\uc6e8\uc5b4 \uc8fc\uc18c \ub610\ub294 \ub2e4\ub978\ud504\ub85c\uadf8\ub7a8\uacfc \uacf5\uc720\ub418\ub294 \ub370\uc774\ud130\uc5d0 \uc9c0\uc815\ud55c\ub2e4\uace0 \ud55c\ub2e4.<\/p>\n<p>&nbsp;<\/p>\n<p>Reference<\/p>\n<p>[1]\uc774\uc751\ud601 \uc678 2\uba85, &#8220;AVR ATmega128 \ub9c8\uc774\ud06c\ub85c\ucee8\ud2b8\ub864\ub7ec&#8221;, ITC, 2009<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ATmega128\ubcf4\ub4dc\uc5d0 \uac04\ub2e8\ud558\uac8c \uc678\ubd80 \uc778\ud130\ub7fd\ud2b8\uac00 \ubc1c\uc329\ud560 \ub54c\ub9c8\ub2e4\u00a0\ud604\uc7ac Count\ub97c \ub098\ud0c0\ub0b4\ub294 2\uc9c4\uc218\u00a0\uac12\uc744 LED\ub85c \ucd9c\ub825\ud558\ub294\u00a0\ucf54\ub4dc\ub97c \uc5f0\uc2b5\uc0bc\uc544 \ub9cc\ub4e4\uc5b4 \ubcf4\uc558\ub2e4. #include &lt;avr\/io.h&gt; #include &lt;avr\/interrupt.h&gt;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[52],"tags":[126,127],"class_list":["post-40","post","type-post","status-publish","format-standard","hentry","category-electronics","tag-atmega128-ko","tag--ko"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8gT1J-E","_links":{"self":[{"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/posts\/40","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/comments?post=40"}],"version-history":[{"count":4,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/posts\/40\/revisions"}],"predecessor-version":[{"id":269,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/posts\/40\/revisions\/269"}],"wp:attachment":[{"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/media?parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/categories?post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/tags?post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}