{"id":94302,"date":"2021-03-14T22:24:52","date_gmt":"2021-03-14T16:24:52","guid":{"rendered":"http:\/\/rcl-radio.ru\/?p=94302"},"modified":"2022-01-08T11:47:39","modified_gmt":"2022-01-08T05:47:39","slug":"attiny2313-eeprom","status":"publish","type":"post","link":"http:\/\/rcl-radio.ru\/?p=94302","title":{"rendered":"ATtiny2313 EEPROM"},"content":{"rendered":"<p>ATtiny2313 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 128 \u0411\u0430\u0439\u0442 EEPROM (\u041f\u041f\u0417\u0423)-\u043f\u0430\u043c\u044f\u0442\u0438. \u042d\u0442\u0430 \u043f\u0430\u043c\u044f\u0442\u044c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0434\u0438\u043d \u0431\u0430\u0439\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u043d. EEPROM (\u041f\u041f\u0417\u0423) \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0438 \u0441\u0442\u0435\u0440\u0442\u0430 \u0432 \u0441\u0443\u043c\u043c\u0435 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c 100 000 \u0440\u0430\u0437.<\/p>\n<p style=\"text-align: center;\"><strong><img decoding=\"async\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2021\/03\/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA-%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0-%D0%BE%D1%82-2021-03-01-235639.png\" \/><\/strong><\/p>\n<p>\u0417\u0430\u043f\u0438\u0441\u044c \u0438 \u0447\u0442\u0435\u043d\u0438\u0435 EEPROM \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432:<\/p>\n<p>&nbsp;<\/p>\n<p><strong>EEAR <\/strong>&#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0430\u0434\u0440\u0435\u0441\u0430 EEPROM<\/p>\n<p>EEPROM ATtiny2313 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 128 \u0431\u0430\u0439\u0442.<\/p>\n<table style=\"width: 700px;\" border=\"1\" width=\"700\">\n<tbody>\n<tr>\n<td style=\"width: 70px; text-align: center;\"><strong>7<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>6<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>5<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>4<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>3<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>2<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>1<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>0<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 70px; text-align: center;\">&#8212;<\/td>\n<td style=\"width: 70px; text-align: center;\">EEAR6<\/td>\n<td style=\"width: 70px; text-align: center;\">EEAR5<\/td>\n<td style=\"width: 70px; text-align: center;\">EEAR4<\/td>\n<td style=\"width: 70px; text-align: center;\">EEAR3<\/td>\n<td style=\"width: 70px; text-align: center;\">EEAR2<\/td>\n<td style=\"width: 70px; text-align: center;\">EEAR1<\/td>\n<td style=\"width: 70px; text-align: center;\">EEAR0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>EEAR0&#8230;6 &#8212;\u00a0 \u0430\u0434\u0440\u0435\u0441\u0430 EEPROM (0&#8230;127)<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<p><strong>EEAR = 0;<\/strong> \/\/ \u0430\u0434\u0440\u0435\u0441 \u044f\u0447\u0435\u0439\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 EEPROM = 0<\/p>\n<p>&nbsp;<\/p>\n<p><strong>EEDR<\/strong> &#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 EEPROM<\/p>\n<table style=\"width: 700px;\" border=\"1\">\n<tbody>\n<tr style=\"height: 21px;\">\n<td style=\"width: 70px; text-align: center; height: 21px;\"><strong>7<\/strong><\/td>\n<td style=\"width: 70px; text-align: center; height: 21px;\"><strong>6<\/strong><\/td>\n<td style=\"width: 70px; text-align: center; height: 21px;\"><strong>5<\/strong><\/td>\n<td style=\"width: 70px; text-align: center; height: 21px;\"><strong>4<\/strong><\/td>\n<td style=\"width: 70px; text-align: center; height: 21px;\"><strong>3<\/strong><\/td>\n<td style=\"width: 70px; text-align: center; height: 21px;\"><strong>2<\/strong><\/td>\n<td style=\"width: 70px; text-align: center; height: 21px;\"><strong>1<\/strong><\/td>\n<td style=\"width: 70px; text-align: center; height: 21px;\"><strong>0<\/strong><\/td>\n<\/tr>\n<tr style=\"height: 21px;\">\n<td style=\"width: 70px; text-align: center; height: 21px;\" colspan=\"8\"><strong>EEDR[7:0]<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 EEDR \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 EEPROM, \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 EEAR.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<p>EEDR = 123;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>EE\u0421R<\/strong> &#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f EEPROM<\/p>\n<table style=\"width: 700px;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 70px; text-align: center;\"><strong>7<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>6<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>5<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>4<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>3<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>2<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>1<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>0<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 70px; text-align: center;\">&#8212;<\/td>\n<td style=\"width: 70px; text-align: center;\">&#8212;<\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>EEPM1<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>EEPM0<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>EERIE<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>EEMPE<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>EEPE<\/strong><\/td>\n<td style=\"width: 70px; text-align: center;\"><strong>EERE<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0411\u0438\u0442\u044b \u00a0EEPM1 \u0438 EEPM0 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u043a\u0430\u043a\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0431\u0438\u0442 EEPE \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 1. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 (\u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0440\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445) \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438.<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 25%; text-align: center;\"><strong>EEPM[1:0]<\/strong><\/td>\n<td style=\"width: 25%; text-align: center;\"><strong>\u0412\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/strong><\/td>\n<td style=\"width: 25%; text-align: center;\"><strong>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 25%; text-align: center;\"><strong>00<\/strong><\/td>\n<td style=\"width: 25%; text-align: center;\"><strong>3,4 \u043c\u0441<\/strong><\/td>\n<td style=\"width: 25%; text-align: center;\"><strong>\u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0437\u0430 \u043e\u0434\u043d\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f (\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u044b\u0431\u043e\u0440)<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 25%; text-align: center;\"><strong>01<\/strong><\/td>\n<td style=\"width: 25%; text-align: center;\"><strong>1,8 \u043c\u0441<\/strong><\/td>\n<td style=\"width: 25%; text-align: center;\"><strong>\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0438\u0440\u0430\u043d\u0438\u0435<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 25%; text-align: center;\"><strong>10<\/strong><\/td>\n<td style=\"width: 25%; text-align: center;\"><strong>1,8 \u043c\u0441<\/strong><\/td>\n<td style=\"width: 25%; text-align: center;\"><strong>\u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0438\u0441\u044c<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 25%; text-align: center;\"><strong>11<\/strong><\/td>\n<td style=\"width: 25%; text-align: center;\"><strong>&#8212;<\/strong><\/td>\n<td style=\"width: 25%; text-align: center;\"><strong>&#8212;<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0411\u0438\u0442 EERIE &#8212; \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 EEPROM \u043f\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e &#171;\u0433\u043e\u0442\u043e\u0432\u043e \u043a \u0437\u0430\u043f\u0438\u0441\u0438&#187; .\u00a0 \u0412 \u0431\u0438\u0442 EERIE \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c 1, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u00a0 \u043a \u0432\u0435\u043a\u0442\u043e\u0440\u0443 EE READY (EE_READY_vect &#8212; \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0433\u043e\u0442\u043e\u0432\u043d\u043e\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 EEPROM).<\/p>\n<p>\u0411\u0438\u0442\u00a0 EEMPE &#8212; \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 EEPROM \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443.<\/p>\n<p>\u0411\u0438\u0442 EEPE\u00a0 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 EEPROM. \u0411\u0438\u0442 EEMPE\u00a0 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0435\u0449\u0435 \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0432 \u0431\u0438\u0442 EEPE, \u0438\u043d\u0430\u0447\u0435 \u0437\u0430\u043f\u0438\u0441\u044c EEPROM \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0430.<\/p>\n<p>\u0411\u0438\u0442 EERE \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0447\u0442\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 EEPROM \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443.<\/p>\n<div id=\"marketWidget\"><\/div>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u0447\u0442\u0435\u043d\u0438\u044f EEPROM<\/p>\n<pre><span style=\"color: #00979c;\">unsigned<\/span> <span style=\"color: #00979c;\">char<\/span> <span style=\"color: #000000;\">EEPROM_read<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #00979c;\">unsigned<\/span> <span style=\"color: #00979c;\">int<\/span> <span style=\"color: #000000;\">uiAddress<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">{<\/span>\r\n \u00a0<span style=\"color: #5e6d03;\">while<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">EECR<\/span> <span style=\"color: #434f54;\">&amp;<\/span> <span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">1<\/span><span style=\"color: #434f54;\">&lt;&lt;<\/span><span style=\"color: #000000;\">EEPE<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span> \u00a0<span style=\"color: #434f54;\">\/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0433\u043e\u0442\u043e\u0432\u043d\u043e\u0441\u0442\u0438 EEPROM <\/span>\r\n \u00a0\u00a0\u00a0<span style=\"color: #000000;\">EEAR<\/span> <span style=\"color: #434f54;\">=<\/span> <span style=\"color: #000000;\">uiAddress<\/span><span style=\"color: #000000;\">;<\/span> <span style=\"color: #434f54;\">\/\/ \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0430\u0434\u0440\u0435\u0441\u0430<\/span>\r\n \u00a0\u00a0 <span style=\"color: #000000;\">EECR<\/span> <span style=\"color: #434f54;\">|=<\/span> <span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">1<\/span><span style=\"color: #434f54;\">&lt;&lt;<\/span><span style=\"color: #000000;\">EERE<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span><span style=\"color: #434f54;\">\/\/ \u0447\u0442\u0435\u043d\u0438\u0435 EEPROM<\/span>\r\n \u00a0\u00a0\u00a0<span style=\"color: #5e6d03;\">return<\/span> <span style=\"color: #000000;\">EEDR<\/span><span style=\"color: #000000;\">;<\/span> <span style=\"color: #434f54;\">\/\/ \u0432\u044b\u0432\u043e\u0434 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/span>\r\n<span style=\"color: #000000;\">}<\/span>\r\n \r\n<span style=\"color: #00979c;\">void<\/span> <span style=\"color: #000000;\">EEPROM_write<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #00979c;\">unsigned<\/span> <span style=\"color: #00979c;\">int<\/span> <span style=\"color: #000000;\">uiAddress<\/span><span style=\"color: #434f54;\">,<\/span> <span style=\"color: #00979c;\">unsigned<\/span> <span style=\"color: #00979c;\">char<\/span> <span style=\"color: #000000;\">ucData<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">{<\/span>\r\n \u00a0<span style=\"color: #5e6d03;\">while<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">EECR<\/span> <span style=\"color: #434f54;\">&amp;<\/span> <span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">1<\/span><span style=\"color: #434f54;\">&lt;&lt;<\/span><span style=\"color: #000000;\">EEPE<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span> <span style=\"color: #434f54;\">\/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0433\u043e\u0442\u043e\u0432\u043d\u043e\u0441\u0442\u0438 EEPROM <\/span>\r\n \u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #000000;\">EEAR<\/span> <span style=\"color: #434f54;\">=<\/span> <span style=\"color: #000000;\">uiAddress<\/span><span style=\"color: #000000;\">;<\/span> <span style=\"color: #434f54;\">\/\/ \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0430\u0434\u0440\u0435\u0441\u0430<\/span>\r\n \u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #000000;\">EEDR<\/span> <span style=\"color: #434f54;\">=<\/span> <span style=\"color: #000000;\">ucData<\/span><span style=\"color: #000000;\">;<\/span> <span style=\"color: #434f54;\">\/\/ \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 <\/span>\r\n \u00a0\u00a0\u00a0\u00a0 <span style=\"color: #000000;\">EECR<\/span> <span style=\"color: #434f54;\">|=<\/span> <span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">1<\/span><span style=\"color: #434f54;\">&lt;&lt;<\/span><span style=\"color: #000000;\">EEMPE<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span><span style=\"color: #434f54;\">\/\/ \u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 EEPROM<\/span>\r\n \u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #000000;\">EECR<\/span> <span style=\"color: #434f54;\">|=<\/span> <span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">1<\/span><span style=\"color: #434f54;\">&lt;&lt;<\/span><span style=\"color: #000000;\">EEPE<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span> <span style=\"color: #434f54;\">\/\/ \u0417\u0430\u043f\u0438\u0441\u044c \u0432 EEPROM<\/span>\r\n<span style=\"color: #000000;\">}<\/span> \r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><span style=\"color: #00979c;\">void<\/span> <span style=\"color: #5e6d03;\">setup<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">)<\/span> <span style=\"color: #000000;\">{<\/span>\r\n \u00a0<span style=\"color: #000000;\">DDRB<\/span> <span style=\"color: #434f54;\">|=<\/span> <span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">1<\/span> <span style=\"color: #434f54;\">&lt;&lt;<\/span> <span style=\"color: #000000;\">0<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span> <span style=\"color: #434f54;\">\/\/ PB0 \u0432\u044b\u0445\u043e\u0434<\/span>\r\n \u00a0<span style=\"color: #000000;\">EEPROM_write<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">0<\/span><span style=\"color: #434f54;\">,<\/span><span style=\"color: #000000;\">14<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span><span style=\"color: #434f54;\">\/\/ \u0437\u0430\u043f\u0438\u0441\u044c \u0447\u0438\u0441\u043b\u043e 123 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 0 \u0432 EEPROM<\/span>\r\n<span style=\"color: #000000;\">}<\/span>\r\n\r\n<span style=\"color: #00979c;\">void<\/span> <span style=\"color: #5e6d03;\">loop<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">)<\/span> <span style=\"color: #000000;\">{<\/span>\r\n <span style=\"color: #5e6d03;\">if<\/span><span style=\"color: #000000;\">(<\/span> <span style=\"color: #000000;\">EEPROM_read<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">0<\/span><span style=\"color: #000000;\">)<\/span> <span style=\"color: #434f54;\">==<\/span> <span style=\"color: #000000;\">14<\/span> <span style=\"color: #000000;\">)<\/span> <span style=\"color: #000000;\">{<\/span><span style=\"color: #000000;\">PORTB<\/span> <span style=\"color: #434f54;\">|=<\/span> <span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">1<\/span> <span style=\"color: #434f54;\">&lt;&lt;<\/span> <span style=\"color: #000000;\">0<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span><span style=\"color: #000000;\">}<\/span> <span style=\"color: #434f54;\">\/\/ \u0435\u0441\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0447\u0442\u0435\u043d\u0438\u044f \u0430\u0434\u0440\u0435\u0441\u0430 EEPROM \u0440\u0430\u0432\u0435\u043d 123, \u0437\u0430\u0436\u0435\u0447\u044c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434, <\/span>\r\n \u00a0<span style=\"color: #d35400;\">delay<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">1000<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #000000;\">PORTB<\/span> <span style=\"color: #434f54;\">&amp;=<\/span> <span style=\"color: #434f54;\">~<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">1<\/span> <span style=\"color: #434f54;\">&lt;&lt;<\/span> <span style=\"color: #000000;\">0<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span><span style=\"color: #434f54;\">\/\/ \u043f\u043e\u0433\u0430\u0441\u0438\u0442\u044c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434<\/span>\r\n \u00a0<span style=\"color: #d35400;\">delay<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">1000<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n<span style=\"color: #000000;\">}<\/span>\r\n\r\n<span style=\"color: #00979c;\">unsigned<\/span> <span style=\"color: #00979c;\">char<\/span> <span style=\"color: #000000;\">EEPROM_read<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #00979c;\">unsigned<\/span> <span style=\"color: #00979c;\">int<\/span> <span style=\"color: #000000;\">uiAddress<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">{<\/span>\r\n \u00a0<span style=\"color: #5e6d03;\">while<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">EECR<\/span> <span style=\"color: #434f54;\">&amp;<\/span> <span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">1<\/span><span style=\"color: #434f54;\">&lt;&lt;<\/span><span style=\"color: #000000;\">EEPE<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span> \u00a0<span style=\"color: #434f54;\">\/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0433\u043e\u0442\u043e\u0432\u043d\u043e\u0441\u0442\u0438 EEPROM <\/span>\r\n \u00a0\u00a0\u00a0<span style=\"color: #000000;\">EEAR<\/span> <span style=\"color: #434f54;\">=<\/span> <span style=\"color: #000000;\">uiAddress<\/span><span style=\"color: #000000;\">;<\/span> <span style=\"color: #434f54;\">\/\/ \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0430\u0434\u0440\u0435\u0441\u0430<\/span>\r\n \u00a0\u00a0 <span style=\"color: #000000;\">EECR<\/span> <span style=\"color: #434f54;\">|=<\/span> <span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">1<\/span><span style=\"color: #434f54;\">&lt;&lt;<\/span><span style=\"color: #000000;\">EERE<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span><span style=\"color: #434f54;\">\/\/ \u0447\u0442\u0435\u043d\u0438\u0435 EEPROM<\/span>\r\n \u00a0\u00a0\u00a0<span style=\"color: #5e6d03;\">return<\/span> <span style=\"color: #000000;\">EEDR<\/span><span style=\"color: #000000;\">;<\/span> <span style=\"color: #434f54;\">\/\/ \u0432\u044b\u0432\u043e\u0434 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/span>\r\n<span style=\"color: #000000;\">}<\/span>\r\n \r\n<span style=\"color: #00979c;\">void<\/span> <span style=\"color: #000000;\">EEPROM_write<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #00979c;\">unsigned<\/span> <span style=\"color: #00979c;\">int<\/span> <span style=\"color: #000000;\">uiAddress<\/span><span style=\"color: #434f54;\">,<\/span> <span style=\"color: #00979c;\">unsigned<\/span> <span style=\"color: #00979c;\">char<\/span> <span style=\"color: #000000;\">ucData<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">{<\/span>\r\n \u00a0<span style=\"color: #5e6d03;\">while<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">EECR<\/span> <span style=\"color: #434f54;\">&amp;<\/span> <span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">1<\/span><span style=\"color: #434f54;\">&lt;&lt;<\/span><span style=\"color: #000000;\">EEPE<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span> <span style=\"color: #434f54;\">\/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0433\u043e\u0442\u043e\u0432\u043d\u043e\u0441\u0442\u0438 EEPROM <\/span>\r\n \u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #000000;\">EEAR<\/span> <span style=\"color: #434f54;\">=<\/span> <span style=\"color: #000000;\">uiAddress<\/span><span style=\"color: #000000;\">;<\/span> <span style=\"color: #434f54;\">\/\/ \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0430\u0434\u0440\u0435\u0441\u0430<\/span>\r\n \u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #000000;\">EEDR<\/span> <span style=\"color: #434f54;\">=<\/span> <span style=\"color: #000000;\">ucData<\/span><span style=\"color: #000000;\">;<\/span> <span style=\"color: #434f54;\">\/\/ \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 <\/span>\r\n \u00a0\u00a0\u00a0\u00a0 <span style=\"color: #000000;\">EECR<\/span> <span style=\"color: #434f54;\">|=<\/span> <span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">1<\/span><span style=\"color: #434f54;\">&lt;&lt;<\/span><span style=\"color: #000000;\">EEMPE<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span><span style=\"color: #434f54;\">\/\/ \u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 EEPROM<\/span>\r\n \u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #000000;\">EECR<\/span> <span style=\"color: #434f54;\">|=<\/span> <span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">1<\/span><span style=\"color: #434f54;\">&lt;&lt;<\/span><span style=\"color: #000000;\">EEPE<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span> <span style=\"color: #434f54;\">\/\/ \u0417\u0430\u043f\u0438\u0441\u044c \u0432 EEPROM<\/span>\r\n<span style=\"color: #000000;\">}<\/span> \r\n<\/pre>\n<p>\u0421\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a \u0432\u044b\u0445\u043e\u0434\u0443 <span style=\"color: #434f54;\">PB0, \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 setup() \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0447\u0438\u0441\u043b\u0430 14 \u0432 0 \u044f\u0447\u0435\u0439\u043a\u0443 \u043f\u0430\u043c\u044f\u0442\u0438 EEPROM, \u0432 \u0446\u0438\u043a\u043b\u0435 loop() \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0442\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 0 EEPROM, \u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u0435, \u0442\u043e \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043c\u0438\u0433\u0430\u0442\u044c \u0441 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u043c 1 \u0441\u0435\u043a\u0443\u043d\u0434\u0430.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ATtiny2313 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 128 \u0411\u0430\u0439\u0442 EEPROM (\u041f\u041f\u0417\u0423)-\u043f\u0430\u043c\u044f\u0442\u0438. \u042d\u0442\u0430 \u043f\u0430\u043c\u044f\u0442\u044c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0434\u0438\u043d \u0431\u0430\u0439\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u043d. EEPROM (\u041f\u041f\u0417\u0423) \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0438 \u0441\u0442\u0435\u0440\u0442\u0430 \u0432 \u0441\u0443\u043c\u043c\u0435 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c 100 000 \u0440\u0430\u0437. \u0417\u0430\u043f\u0438\u0441\u044c \u0438 \u0447\u0442\u0435\u043d\u0438\u0435 EEPROM \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432: &nbsp; EEAR &#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0430\u0434\u0440\u0435\u0441\u0430 EEPROM EEPROM ATtiny2313 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 128 \u0431\u0430\u0439\u0442. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":94303,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[286,147],"tags":[],"class_list":["post-94302","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-attiny2313-arduino-ide","category-147"],"views":3530,"_links":{"self":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/94302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=94302"}],"version-history":[{"count":5,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/94302\/revisions"}],"predecessor-version":[{"id":111147,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/94302\/revisions\/111147"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/media\/94303"}],"wp:attachment":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=94302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=94302"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=94302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}