{"id":270661,"date":"2015-12-18T15:06:02","date_gmt":"2015-12-18T12:06:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=270661"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=270661","title":{"rendered":"\u0422\u0435\u0442\u0440\u0438\u0441 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0432 Tera Term"},"content":{"rendered":"<p>       \u0412 \u044d\u0442\u043e\u043c \u0433\u043e\u0434\u0443 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Atmel \u0430\u043d\u043e\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u043b\u0438\u043d\u0435\u0439\u043a\u0443 \u00ab\u043c\u043b\u0430\u0434\u0448\u0438\u0445\u00bb \u043a\u043e\u0440\u0442\u0435\u043a\u0441\u043e\u0432 \u041c0+ \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 SAM D09, SAM D10, SAM D11. \u042d\u0442\u0438 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u00ab\u043d\u0430\u0432\u043e\u0440\u043e\u0447\u0435\u043d\u043d\u044b\u0435\u00bb \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0438\u043c\u0435\u044e\u0442 \u043d\u0438\u0437\u043a\u0443\u044e \u0446\u0435\u043d\u0443 \u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043a\u043e\u0440\u043f\u0443\u0441\u0430. \u041f\u0440\u0438\u0447\u0435\u043c \u0432 \u043b\u0438\u043d\u0435\u0439\u043a\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043a\u0430\u043c\u043d\u0438 \u0432 \u043b\u0435\u0433\u043a\u043e\u043f\u0430\u044f\u0435\u043c\u044b\u0445 \u043a\u043e\u0440\u043f\u0443\u0441\u0430\u0445 SOIC-14 \u0438 SOIC-20. \u0414\u043b\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043e\u0447\u0435\u043d\u044c \u0434\u0435\u0448\u0435\u0432\u044b\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438\u0437 \u0441\u0435\u0440\u0438\u0438 Xplained mini, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0441 \u0448\u0438\u043b\u0434\u0430\u043c\u0438 \u043e\u0442 Arduino. \u042d\u0442\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b\u0437\u043e\u0432\u0443\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0440\u0435\u0434\u0438 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043d\u043e \u0438 \u0443 \u0440\u0430\u0434\u0438\u043e\u043b\u044e\u0431\u0438\u0442\u0435\u043b\u0435\u0439.<br \/>  \u041a\u043e\u0433\u0434\u0430 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043f\u043e\u043f\u0430\u043b\u0438 \u043a \u043d\u0430\u043c \u0432 \u0440\u0443\u043a\u0438, \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u00ab\u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e\u0439\u00bb \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u0447\u0435\u0441\u0442\u044c \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u041d\u043e\u0432\u043e\u0433\u043e \u0433\u043e\u0434\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u0431\u0430\u0432\u043d\u043e\u0435 \u0438 \u043a\u0440\u0435\u0430\u0442\u0438\u0432\u043d\u043e\u0435. \u041c\u044b \u043f\u043e\u0441\u043a\u0440\u0435\u0431\u043b\u0438 \u043f\u043e \u0441\u0443\u0441\u0435\u043a\u0430\u043c \u0438 \u043d\u0430\u0448\u043b\u0438 \u0441\u0442\u0430\u0440\u0435\u043d\u044c\u043a\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u043a \u2014 \u0442\u0435\u0442\u0440\u0438\u0441 \u043d\u0430 MEGA168 \u0447\u0435\u0440\u0435\u0437 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u043a\u0443 \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u043a\u0430\u043c\u0435\u043d\u044c \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430 \u0432 \u044d\u0442\u043e\u043c \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Just for fun. \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d77\/b49\/09f\/d77b4909fe784ec79180f583c9bffeaa.png\"\/><br \/>  <a name=\"habracut\"><\/a><\/p>\n<h4>\u041a\u0440\u0430\u0442\u043a\u043e \u043e \u043d\u043e\u0432\u044b\u0445 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445<\/h4>\n<p>  <\/p>\n<ul>\n<li><a href=\"http:\/\/www.atmel.com\/products\/microcontrollers\/arm\/sam-d.aspx#samd09\">SAM D09<\/a> \u2014 \u043c\u043b\u0430\u0434\u0448\u0438\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043b\u044c \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 SAM D. \u0418\u043c\u0435\u0435\u0442 8\u041a \u0438\u043b\u0438 16\u041a \u0444\u043b\u0435\u0448\u0430 \u0438 4\u041a SRAM. \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043a\u043e\u0440\u043f\u0443\u0441\u043e\u0432 QFN-24 \u0438 SOIC-14. \u041d\u0430 \u0431\u043e\u0440\u0442\u0443 DMA \u0438 Event system. 2 SERCOM \u2014 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a USART, SPI \u0438\u043b\u0438 I2C. 5-\u0442\u0438 \u0438\u043b\u0438 10-\u0442\u0438 \u043a\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u0439 12-\u0442\u0438 \u0431\u0438\u0442\u043d\u044b\u0439 \u0410\u0426\u041f.<\/li>\n<li><a href=\"http:\/\/www.atmel.com\/products\/microcontrollers\/arm\/sam-d.aspx#samd10\">SAM D10<\/a> \u2014 \u0430\u043f\u0433\u0440\u0435\u0439\u0434 D09 \u0432 \u0447\u0430\u0441\u0442\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u0430\u0439\u043c\u0435\u0440\u043e\u0432, \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u0430, \u0426\u0410\u041f \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0441\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0445 \u043a\u043d\u043e\u043f\u043e\u043a, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e SERCOM \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439. \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043a\u043e\u0440\u043f\u0443\u0441\u043e\u0432 QFN-24, SOIC-14, SOIC-20.<\/li>\n<li><a href=\"http:\/\/www.atmel.com\/products\/microcontrollers\/arm\/sam-d.aspx#samd11\">SAM D11<\/a> \u2014 \u0442\u043e\u0442 \u0436\u0435 D10, \u043d\u043e \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Full-Speed USB Device.<\/li>\n<\/ul>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/b44\/c4e\/db1\/b44c4edb1221456e8541220cfe7adca0.jpg\"\/><br \/>  \u0412\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u044b. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0442\u043e\u0440 \u043d\u0430 \u0431\u043e\u0440\u0442\u0443, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u0440\u0430\u0437\u044a\u0435\u043c Micro USB.<\/p>\n<h4>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e \u0441\u0430\u043c \u0442\u0435\u0442\u0440\u0438\u0441<\/h4>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430 \u0442\u0435\u0442\u0440\u0438\u0441\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u0445:  <\/p>\n<ul>\n<li>\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u043a\u043e\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 VT100,<\/li>\n<li>\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0443,<\/li>\n<li>\u043b\u044e\u0431\u0430\u044f \u0444\u0438\u0433\u0443\u0440\u0430 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 (4 \u043d\u0430 4 \u0441\u0438\u043c\u0432\u043e\u043b\u0430).<\/li>\n<\/ul>\n<p>  \u0422\u0435\u0442\u0440\u0438\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u0440\u0438 <a href=\"https:\/\/ttssh2.osdn.jp\/manual\/en\/about\/ctrlseq.html#CSI\">\u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/a> \u0438\u0437 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/VT100\">VT100<\/a>: \u043e\u0447\u0438\u0441\u0442\u043a\u0430 \u044d\u043a\u0440\u0430\u043d\u0430, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0443\u0440\u0441\u043e\u0440 \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u044b\u043c. <br \/>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u043a\u0443 Tera term, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440.<br \/>  \u0414\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f 5 \u043a\u043b\u0430\u0432\u0438\u0448-\u0431\u0443\u043a\u0432 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b:  <\/p>\n<ul>\n<li><b>n<\/b> \u2013 \u043d\u0430\u0447\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0438\u0433\u0440\u0443,<\/li>\n<li><b>w<\/b> \u0438\u043b\u0438 <b>space<\/b> \u2013 \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0444\u0438\u0433\u0443\u0440\u0443,<\/li>\n<li><b>s<\/b> \u2013 \u0443\u0440\u043e\u043d\u0438\u0442\u044c \u0444\u0438\u0433\u0443\u0440\u0443,<\/li>\n<li><b>d<\/b> \u2013 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u043f\u0440\u0430\u0432\u043e,<\/li>\n<li><b>a<\/b> \u2013 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u043b\u0435\u0432\u043e.<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412 \u043a\u043e\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">switch (c)  { \tcase 'w': \tcase ' ': \t\/\/ROTATE \t tetris_rotate(); \tbreak; \tcase 's': \t\/\/DOWN \ttetris_gravity();\t \tbreak; \tcase 'd': \t \/\/RIGHT \t tetris_move_right(); \tbreak; \tcase 'a': \t \/\/LEFT \ttetris_move_left(); \tbreak; \tdefault: break; }  if (c == 'n')  { \tc=0; \t\/\/Seed random function so we do not get same start condition \t\/\/for each new game. In essence we will not start a new game \t\/\/exactly at the same time. \tsrand(tick); \t\t\t\t\t \t\/\/New Game \tis_running = true; \tterminal_cursor_off(); \tterminal_clear(); \ttetris_init(); \ttetris_new_block(); \tterminal_cursor_home(); \ttetris_print(); }\t <\/code><\/pre>\n<\/p><\/div>\n<\/div>\n<p>  \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438\u0433\u0440\u044b \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u0439\u043c\u0435\u0440\u043e\u043c. \u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u00ab\u0442\u0438\u043a\u0430\u043d\u044c\u0435\u00bb \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0442\u043e\u0433\u0434\u0430 \u0438 \u0444\u0438\u0433\u0443\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0430\u0434\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/p>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0447\u043a\u0438: \u0437\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0441\u0447\u0435\u0437\u043d\u0443\u0432\u0448\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f 100 \u043e\u0447\u043a\u043e\u0432. \u0417\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u00ab\u0438\u0441\u0447\u0435\u0437\u043d\u0443\u0432\u0448\u0443\u044e\u00bb \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441 \u043f\u0435\u0440\u0432\u043e\u0439, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0447\u043a\u043e\u0432, \u0447\u0435\u043c \u0437\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e.<\/p>\n<h4>\u041f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0441 mega \u043d\u0430 samd10<\/h4>\n<p>  \u0418\u0437 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u0440\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d SERCOM \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 UART \u0434\u043b\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0444\u0438\u0433\u0443\u0440\u043e\u043a \u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0438 \u0442\u0430\u0439\u043c\u0435\u0440 \u0434\u043b\u044f \u043e\u0442\u0441\u0447\u0435\u0442\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438.<\/p>\n<p>  \u0412\u043c\u0435\u0441\u0442\u043e \u043c\u0438\u043b\u043e\u0439 \u0441\u0435\u0440\u0434\u0446\u0443 \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 8-\u0431\u0438\u0442\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 UART \u0431\u0438\u0442\u0430\u043c\u0438 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0445:  <\/p>\n<pre><code class=\"cpp\">static void board_init(void) {\t \t\/*Configure IO pins: \t * - UART pins \t * - SW pin \t * - LED pin \t *\/ \tDDRD &= ~USART_RX_PIN_bm; \tDDRD |= USART_TX_PIN_bm; \tPORTD |= USART_TX_PIN_bm;\t \tPORTB |= SW_PIN_bm; \tDDRB &= ~SW_PIN_bm; \t\/*Disable all modules we will not use*\/ \tPRR = (1 &lt;&lt; PRTWI) | (1 &lt;&lt; PRTIM2) | (1 &lt;&lt; PRTIM0) | (1 &lt;&lt; PRSPI) | (1 &lt;&lt; PRADC); } <\/code><\/pre>\n<p>  \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c sercom \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 uart, \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0438 callback \u043f\u043e \u043f\u0440\u0438\u0435\u043c\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u0430.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f Sercom \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 uart<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">static void configure_console(void) { \tstruct usart_config usart_conf;  \tusart_get_config_defaults(&usart_conf); \tusart_conf.mux_setting = CONF_STDIO_MUX_SETTING; \tusart_conf.pinmux_pad0 = CONF_STDIO_PINMUX_PAD0; \tusart_conf.pinmux_pad1 = CONF_STDIO_PINMUX_PAD1; \tusart_conf.pinmux_pad2 = CONF_STDIO_PINMUX_PAD2; \tusart_conf.pinmux_pad3 = CONF_STDIO_PINMUX_PAD3; \tusart_conf.baudrate    = CONF_STDIO_BAUDRATE;  \tstdio_serial_init(&cdc_uart_module, CONF_STDIO_USART_MODULE, &usart_conf); }  enum status_code usart_enable_rx_interrupt(\tstruct usart_module *const module,\tuint8_t *rx_data) { \t\/\/ Sanity check arguments \tAssert(module); \tAssert(rx_data);  \t\/\/ Issue internal asynchronous read \t\/\/ Get a pointer to the hardware module instance \tSercomUsart *const usart_hw = &(module-&gt;hw-&gt;USART); \tmodule-&gt;rx_buffer_ptr = rx_data; \t\/\/ Enable the RX Complete Interrupt \tusart_hw-&gt;INTENSET.reg = SERCOM_USART_INTFLAG_RXC; \treturn STATUS_OK; } void configure_usart_callbacks(void) { \tusart_register_callback(&cdc_uart_module, USART_RX_callback, USART_CALLBACK_BUFFER_RECEIVED); \tusart_enable_callback(&cdc_uart_module, USART_CALLBACK_BUFFER_RECEIVED); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0434\u043b\u044f \u043c\u0435\u0433\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e uart \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e putc, \u0434\u043b\u044f samd10 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0449\u0435: \u043f\u0443\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044e \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0431\u0430\u0439\u0442 \u0441\u0432\u0430\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e. \u042d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c, \u043e\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0438 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u0435\u0433\u043e. <br \/>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e \u0442\u043e, \u043a\u0430\u043a \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u044c \u043f\u043e\u0440\u043e\u0439 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u00ab\u0443\u043c\u043d\u0443\u044e\u00bb ASF \u0434\u043b\u044f \u043f\u0440\u0438\u0435\u043c\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0431\u0430\u0439\u0442\u0430 \u043f\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f\u043c, \u043c\u044b \u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u043d\u0430\u0448\u0435\u0439 <a href=\"http:\/\/we.easyelectronics.ru\/cortex\/nastroyka-uart-po-preryvaniyam-dlya-atmel-sam-d20-d21.html\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 we.easyelectronics.ru.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0442\u0430\u0439\u043c\u0435\u0440\u0430\u043c.<br \/>  \u041a\u043e\u0434 \u0434\u043b\u044f \u043c\u0435\u0433\u0438:  <\/p>\n<pre><code class=\"cpp\">void init_timer(void) { \t\/*Start timer used to iterate game and seed random function*\/ \tTIFR1 = 1 &lt;&lt; OCF1A; \tTIMSK1 = 1 &lt;&lt; OCIE1A; \tOCR1A = TIMER_TOP_VALUE; \tTCCR1B = (1 &lt;&lt; WGM12) | (1 &lt;&lt; CS12) | (1 &lt;&lt; CS10); } ISR(TIMER1_COMPA_vect, ISR_BLOCK) { \t++tick; \titerate_game = true; } <\/code><\/pre>\n<p>  \u0418 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f samd10  <\/p>\n<pre><code class=\"cpp\">\/** Configures  TC function with the  driver.  *\/ static void configure_tc(void) { \tstruct tc_config config_tc;  \ttc_get_config_defaults(&config_tc); \tconfig_tc.counter_size    = TC_COUNTER_SIZE_16BIT; \tconfig_tc.wave_generation = TC_WAVE_GENERATION_MATCH_FREQ; \tconfig_tc.counter_16_bit.compare_capture_channel[0] = 2000;  \tconfig_tc.clock_prescaler=TC_CLOCK_PRESCALER_DIV1024;  \ttc_init(&tc_instance, CONF_TC_INSTANCE, &config_tc); \ttc_enable(&tc_instance); }  \/** Registers TC callback function with the  driver.  *\/ static void configure_tc_callbacks(void) { \ttc_register_callback(&tc_instance,\ttc_callback_to_counter,\tTC_CALLBACK_CC_CHANNEL0); \ttc_enable_callback(&tc_instance, TC_CALLBACK_CC_CHANNEL0); }  static void tc_callback_to_counter(\tstruct tc_module *const module_inst) { \t++tick; \titerate_game = true; \t } <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435. \u0412\u0435\u0441\u044c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0444\u0438\u0433\u0443\u0440 \u0438 \u0432\u0441\u0435\u0439 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u0436\u0435.<br \/>  \u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f samd 10 \u043b\u0435\u0436\u0438\u0442 \u043d\u0430 <a href=\"https:\/\/github.com\/marus-ka\/tetris_samd10\">github<\/a>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f Tera Term:<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/efe\/4c3\/c77\/efe4c3c778dd4df08b67cfaed0e3322b.png\"\/><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/04e\/bc3\/5f3\/04ebc35f37524d50b37870c8dbfe4de8.png\"\/><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/efe\/4c3\/c77\/efe4c3c778dd4df08b67cfaed0e3322b.png\"\/>  <\/div>\n<\/div>\n<p>  <iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/gMQO_-XNozY?feature=oembed\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>  \u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u044b <a href=\"http:\/\/r-ng.ru\/node\/67\">ATSAMD10-XMINI<\/a> \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 450 \u0440\u0443\u0431\u043b\u0435\u0439.               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/geektimes.ru\/post\/267840\/\"> http:\/\/geektimes.ru\/post\/267840\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0412 \u044d\u0442\u043e\u043c \u0433\u043e\u0434\u0443 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Atmel \u0430\u043d\u043e\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u043b\u0438\u043d\u0435\u0439\u043a\u0443 \u00ab\u043c\u043b\u0430\u0434\u0448\u0438\u0445\u00bb \u043a\u043e\u0440\u0442\u0435\u043a\u0441\u043e\u0432 \u041c0+ \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 SAM D09, SAM D10, SAM D11. \u042d\u0442\u0438 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u00ab\u043d\u0430\u0432\u043e\u0440\u043e\u0447\u0435\u043d\u043d\u044b\u0435\u00bb \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0438\u043c\u0435\u044e\u0442 \u043d\u0438\u0437\u043a\u0443\u044e \u0446\u0435\u043d\u0443 \u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043a\u043e\u0440\u043f\u0443\u0441\u0430. \u041f\u0440\u0438\u0447\u0435\u043c \u0432 \u043b\u0438\u043d\u0435\u0439\u043a\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043a\u0430\u043c\u043d\u0438 \u0432 \u043b\u0435\u0433\u043a\u043e\u043f\u0430\u044f\u0435\u043c\u044b\u0445 \u043a\u043e\u0440\u043f\u0443\u0441\u0430\u0445 SOIC-14 \u0438 SOIC-20. \u0414\u043b\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043e\u0447\u0435\u043d\u044c \u0434\u0435\u0448\u0435\u0432\u044b\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438\u0437 \u0441\u0435\u0440\u0438\u0438 Xplained mini, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0441 \u0448\u0438\u043b\u0434\u0430\u043c\u0438 \u043e\u0442 Arduino. \u042d\u0442\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b\u0437\u043e\u0432\u0443\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0440\u0435\u0434\u0438 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043d\u043e \u0438 \u0443 \u0440\u0430\u0434\u0438\u043e\u043b\u044e\u0431\u0438\u0442\u0435\u043b\u0435\u0439.<br \/>  \u041a\u043e\u0433\u0434\u0430 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043f\u043e\u043f\u0430\u043b\u0438 \u043a \u043d\u0430\u043c \u0432 \u0440\u0443\u043a\u0438, \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u00ab\u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e\u0439\u00bb \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u0447\u0435\u0441\u0442\u044c \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u041d\u043e\u0432\u043e\u0433\u043e \u0433\u043e\u0434\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u0431\u0430\u0432\u043d\u043e\u0435 \u0438 \u043a\u0440\u0435\u0430\u0442\u0438\u0432\u043d\u043e\u0435. \u041c\u044b \u043f\u043e\u0441\u043a\u0440\u0435\u0431\u043b\u0438 \u043f\u043e \u0441\u0443\u0441\u0435\u043a\u0430\u043c \u0438 \u043d\u0430\u0448\u043b\u0438 \u0441\u0442\u0430\u0440\u0435\u043d\u044c\u043a\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u043a \u2014 \u0442\u0435\u0442\u0440\u0438\u0441 \u043d\u0430 MEGA168 \u0447\u0435\u0440\u0435\u0437 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u043a\u0443 \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u043a\u0430\u043c\u0435\u043d\u044c \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430 \u0432 \u044d\u0442\u043e\u043c \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Just for fun. \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d77\/b49\/09f\/d77b4909fe784ec79180f583c9bffeaa.png\"\/>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-270661","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/270661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=270661"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/270661\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=270661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=270661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=270661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}