{"id":80820,"date":"2020-07-18T20:41:56","date_gmt":"2020-07-18T14:41:56","guid":{"rendered":"http:\/\/rcl-radio.ru\/?p=80820"},"modified":"2022-01-08T18:03:28","modified_gmt":"2022-01-08T12:03:28","slug":"%d1%82%d0%b0%d0%b9%d0%bc%d0%b5%d1%80-t1-arduino","status":"publish","type":"post","link":"http:\/\/rcl-radio.ru\/?p=80820","title":{"rendered":"\u0422\u0430\u0439\u043c\u0435\u0440 T1 (Arduino)"},"content":{"rendered":"<p>\u0412 \u043f\u043b\u0430\u0442\u0430\u0445 Arduino UNO Arduino NANO \u0432 8 \u0431\u0438\u0442\u043d\u043e\u043c AVR Atmega168 \u0438 Atmega328 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 Timer0, Timer1 \u0438 Timer2.<\/p>\n<p><strong>Timer0<\/strong> 8 \u0431\u0438\u0442\u043d\u044b\u0439 \u0442\u0430\u0439\u043c\u0435\u0440, \u0435\u0433\u043e \u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u043c\u043e\u0436\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u0430 \u043e\u0442 0 \u0434\u043e 255. <strong>Timer0<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 Arduino \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a <strong><em>delay()<\/em><\/strong>\u00a0\u0438\u00a0<strong><em>millis()<\/em><\/strong>.<\/p>\n<p><strong>Timer1<\/strong> 16 \u0431\u0438\u0442\u043d\u044b\u0439 \u0442\u0430\u0439\u043c\u0435\u0440, \u0435\u0433\u043e \u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u043c\u043e\u0436\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u0430 \u043e\u0442 0 \u0434\u043e 65535.<\/p>\n<p><strong>Timer2<\/strong> 8 \u0431\u0438\u0442\u043d\u044b\u0439 \u0442\u0430\u0439\u043c\u0435\u0440,\u00a0 \u0435\u0433\u043e \u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u043c\u043e\u0436\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u0430 \u043e\u0442 0 \u0434\u043e 255. <strong>Timer2<\/strong>\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 Arduino \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong><em>tone()<\/em><\/strong>.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0439\u043c\u0435\u0440\u043e\u0432 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u0434\u0430 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043c\u0438\u0433\u0430\u0442\u044c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0435\u043a\u0443\u043d\u0434\u0443, \u0442\u0430\u0439\u043c\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u0437\u0430 \u043c\u0438\u0433\u0430\u043d\u0438\u0435 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430, \u0432 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p>\u0412\u0441\u0435 \u0442\u0430\u0439\u043c\u0435\u0440\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 <b>TCNT <\/b>\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0442\u0430\u043a\u0442\u043e\u0432\u044b\u0435 \u0438\u043c\u043f\u0443\u043b\u044c\u0441\u044b \u0434\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b (\u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430), \u043f\u0440\u0438 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0438 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u043d\u043e\u043b\u044c. \u0422\u0430\u0439\u043c\u0435\u0440 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0431\u0438\u0442 \u0444\u043b\u0430\u0433\u0430, \u0434\u0430\u0432\u0430\u044f \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0442\u0430\u043a\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u0434\u043b\u044f \u0442\u0430\u0439\u043c\u0435\u0440\u0430\/\u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u0442\u0430\u043a\u0442\u043e\u0432\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u0434\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f, \u0442\u0430\u043a \u0438 \u0441\u0438\u0433\u043d\u0430\u043b, \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0439 \u0441 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0432\u0445\u043e\u0434\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0442\u0430\u0439\u043c\u0435\u0440\u044b \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a. \u0422\u0430\u0439\u043c\u0435\u0440\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0442\u0430\u043a\u0438\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432, \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e <strong>Timer1<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b:<\/p>\n<ul>\n<li><b>TCNT1<\/b>\u00a0&#8212; \u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0442\u0430\u0439\u043c\u0435\u0440\u0430\/\u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 T1 (16 \u0431\u0438\u0442)<\/li>\n<li><b>OCR1A<\/b>\u00a0&#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f A (16 \u0431\u0438\u0442)<\/li>\n<li><b>OCR1B<\/b>\u00a0&#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f B\u00a0(16 \u0431\u0438\u0442)<\/li>\n<li><b>TIMSK1<\/b>\u00a0&#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u043c\u0430\u0441\u043a\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0434\u043b\u044f \u0442\u0430\u0439\u043c\u0435\u0440\u0430\/\u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 T1<\/li>\n<li><b>TIFR1<\/b>\u00a0&#8212;\u00a0\u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0444\u043b\u0430\u0433\u043e\u0432 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u0434\u043b\u044f \u0442\u0430\u0439\u043c\u0435\u0440\u0430\/\u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 T1<\/li>\n<li><b>TCCR1A<\/b>\u00a0&#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f A<\/li>\n<li><b>TCCR1B<\/b>\u00a0&#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f B<\/li>\n<li><b>TCCR1C<\/b>\u00a0&#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f C<\/li>\n<li><b>ICR1<\/b>\u00a0&#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0437\u0430\u0445\u0432\u0430\u0442\u0430\u00a0(16 \u0431\u0438\u0442)<\/li>\n<\/ul>\n<p>\u0412 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043d\u0430\u043c \u0432\u0430\u0436\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b: <b>OCR1A, <\/b><strong>TCCR1A<\/strong>, <strong>TCCR1B <\/strong>\u0438 <strong>TIMSK1.\u00a0<\/strong><\/p>\n<p style=\"font-weight: 400;\">\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u00a0<strong>TCCR1A<\/strong>:<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 12.5%; text-align: center;\">7<\/td>\n<td style=\"width: 12.5%; text-align: center;\">6<\/td>\n<td style=\"width: 12.5%; text-align: center;\">5<\/td>\n<td style=\"width: 12.5%; text-align: center;\">4<\/td>\n<td style=\"width: 12.5%; text-align: center;\">3<\/td>\n<td style=\"width: 12.5%; text-align: center;\">2<\/td>\n<td style=\"width: 12.5%; text-align: center;\">1<\/td>\n<td style=\"width: 12.5%; text-align: center;\">0<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">COM1A1<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">COM1A0<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">COM1B1<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">COM1B0<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\">&#8212;<\/td>\n<td style=\"width: 12.5%; text-align: center;\">&#8212;<\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">WGM11<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">WGM10<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"font-weight: 400;\">\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u00a0<strong>TCCR1B<\/strong>:<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 12.5%; text-align: center;\">7<\/td>\n<td style=\"width: 12.5%; text-align: center;\">6<\/td>\n<td style=\"width: 12.5%; text-align: center;\">5<\/td>\n<td style=\"width: 12.5%; text-align: center;\">4<\/td>\n<td style=\"width: 12.5%; text-align: center;\">3<\/td>\n<td style=\"width: 12.5%; text-align: center;\">2<\/td>\n<td style=\"width: 12.5%; text-align: center;\">1<\/td>\n<td style=\"width: 12.5%; text-align: center;\">0<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">ICNC1<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">ICES1<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\">&#8212;<\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">WGM13<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">WGM12<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">CS12<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">CS11<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">CS10<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"font-weight: 400;\">\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u00a0<strong>TIMSK1<\/strong>:<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 12.5%; text-align: center;\">7<\/td>\n<td style=\"width: 12.5%; text-align: center;\">6<\/td>\n<td style=\"width: 12.5%; text-align: center;\">5<\/td>\n<td style=\"width: 12.5%; text-align: center;\">4<\/td>\n<td style=\"width: 12.5%; text-align: center;\">3<\/td>\n<td style=\"width: 12.5%; text-align: center;\">2<\/td>\n<td style=\"width: 12.5%; text-align: center;\">1<\/td>\n<td style=\"width: 12.5%; text-align: center;\">0<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 12.5%; text-align: center;\">&#8212;<\/td>\n<td style=\"width: 12.5%; text-align: center;\">&#8212;<\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">ICIE1<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\">&#8212;<\/td>\n<td style=\"width: 12.5%; text-align: center;\">&#8212;<\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">OCIE1B<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">OCIE1A<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">TOIE1<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440 <b>OCR1A (\u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f 16 \u0431\u0438\u0442): <\/b>\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0441\u0447\u0451\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 <strong>TCNT1<\/strong>. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u043c <strong>TCCR1A.<\/strong><\/p>\n<p>\u0411\u0438\u0442\u044b <strong>CS12<\/strong>, <strong>CS11<\/strong> \u0438 <strong>CS10<\/strong> \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 <strong>TCCR1B <\/strong>\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0442\u0430\u043a\u0442\u043e\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0442\u0430\u0439\u043c\u0435\u0440\u0430, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u044d\u0442\u0438\u0445 \u0431\u0438\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f.<\/p>\n<table style=\"height: 248px;\" width=\"701\">\n<thead>\n<tr>\n<th style=\"width: 46px;\">CS12<\/th>\n<th style=\"width: 45px;\">CS11<\/th>\n<th style=\"width: 47px;\">CS10<\/th>\n<th style=\"width: 535px;\">\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"width: 46px;\">0<\/td>\n<td style=\"width: 45px;\">0<\/td>\n<td style=\"width: 47px;\">0<\/td>\n<td style=\"width: 535px;\">\u041d\u0435\u0442 \u0442\u0430\u043a\u0442\u043e\u0432\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 (Timer\/Counter \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d)<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 46px;\">0<\/td>\n<td style=\"width: 45px;\">0<\/td>\n<td style=\"width: 47px;\">1<\/td>\n<td style=\"width: 535px;\">clk_io\/1 (\u043d\u0435\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f)<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 46px;\">0<\/td>\n<td style=\"width: 45px;\">1<\/td>\n<td style=\"width: 47px;\">0<\/td>\n<td style=\"width: 535px;\">clk_io\/8 (\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0447\u0430\u0441\u0442\u043e\u0442\u044b)<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 46px;\">0<\/td>\n<td style=\"width: 45px;\">1<\/td>\n<td style=\"width: 47px;\">1<\/td>\n<td style=\"width: 535px;\">clk_io\/64 (\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0447\u0430\u0441\u0442\u043e\u0442\u044b)<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 46px;\">1<\/td>\n<td style=\"width: 45px;\">0<\/td>\n<td style=\"width: 47px;\">0<\/td>\n<td style=\"width: 535px;\">clk_io\/256 (\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0447\u0430\u0441\u0442\u043e\u0442\u044b)<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 46px;\">1<\/td>\n<td style=\"width: 45px;\">0<\/td>\n<td style=\"width: 47px;\">1<\/td>\n<td style=\"width: 535px;\">clk_io\/1024 (\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0447\u0430\u0441\u0442\u043e\u0442\u044b)<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 46px;\">1<\/td>\n<td style=\"width: 45px;\">1<\/td>\n<td style=\"width: 47px;\">0<\/td>\n<td style=\"width: 535px;\">\u0412\u043d\u0435\u0448\u043d\u0438\u0439 \u0442\u0430\u043a\u0442\u043e\u0432\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043d\u0430 \u0432\u044b\u0432\u043e\u0434\u0435 T1. \u0422\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0441\u043f\u0430\u0434\u0443<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 46px;\">1<\/td>\n<td style=\"width: 45px;\">1<\/td>\n<td style=\"width: 47px;\">1<\/td>\n<td style=\"width: 535px;\">\u0412\u043d\u0435\u0448\u043d\u0438\u0439 \u0442\u0430\u043a\u0442\u043e\u0432\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043d\u0430 \u0432\u044b\u0432\u043e\u0434\u0435 T1. \u0422\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0444\u0440\u043e\u043d\u0442\u0443<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div id=\"marketWidget\"><\/div>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043a\u0435\u0442\u0447\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u0438\u0433\u0430\u0442\u044c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u043c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 Arduino (D13) \u0441 \u043f\u0435\u0440\u0438\u043e\u0434\u043e\u043c 2 \u0441\u0435\u043a\u0443\u043d\u0434\u044b:<\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\"><span style=\"color: #0066cc;\">void<\/span> setup<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n    pinMode<span style=\"color: #66cc66;\">(<\/span>13, OUTPUT<span style=\"color: #66cc66;\">)<\/span>;\r\n\u00a0\r\n    <span style=\"color: #808080; font-style: italic;\">\/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Timer1<\/span>\r\n    cli<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;  <span style=\"color: #808080; font-style: italic;\">\/\/ \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f<\/span>\r\n    TCCR1A = <span style=\"color: #cc66cc;\">0<\/span>;   <span style=\"color: #808080; font-style: italic;\">\/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0432 0<\/span>\r\n    TCCR1B = <span style=\"color: #cc66cc;\">0<\/span>;   <span style=\"color: #808080; font-style: italic;\">\/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0432 0<\/span>\r\n    <span style=\"color: #808080; font-style: italic;\">\/\/ \u0422\u0430\u0439\u043c\u0435\u0440 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0435 65535 \u043e\u0442\u0441\u0447\u0435\u0442\u043e\u0432 \u043f\u0440\u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0435 \u0434\u0435\u043b\u0435\u043d\u0438\u044f 1024 \u0438\u043b\u0438 \u0437\u0430 4,194\u0441<\/span>\r\n\u00a0\r\n    OCR1A = <span style=\"color: #cc66cc;\">15624<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f (1 \u0441\u0435\u043a\u0443\u043d\u0434\u0430)<\/span>\r\n\u00a0\r\n    TCCR1B <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> WGM12<span style=\"color: #66cc66;\">)<\/span>;  <span style=\"color: #808080; font-style: italic;\">\/\/ \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c CTC \u0440\u0435\u0436\u0438\u043c &gt; \u0441\u0431\u0440\u043e\u0441 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u043f\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044e<\/span>\r\n\u00a0\r\n    TCCR1B <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> CS10<span style=\"color: #66cc66;\">)<\/span>;   <span style=\"color: #808080; font-style: italic;\">\/\/ \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0442\u044b CS10 CS12 \u043d\u0430 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f 1024<\/span>\r\n    TCCR1B <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> CS12<span style=\"color: #66cc66;\">)<\/span>;\r\n\u00a0\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/ F (\u041f\u0420\u0415\u0420\u042b\u0412\u0410\u041d\u0418\u0419) = 16000000 \/ (1024 *(1 + 15624) = 1 s<\/span>\r\n\u00a0\r\n    TIMSK1 <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> OCIE1A<span style=\"color: #66cc66;\">)<\/span>;  <span style=\"color: #808080; font-style: italic;\">\/\/ \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044e \u0442\u0430\u0439\u043c\u0435\u0440\u0430 <\/span>\r\n    sei<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f<\/span>\r\n<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> loop<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span><span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\nISR<span style=\"color: #66cc66;\">(<\/span>TIMER1_COMPA_vect<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #808080; font-style: italic;\">\/\/ \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f ISR(TIMER1_OVF_vect), \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u043a\u043e\u0433\u0434\u0430 \u0442\u0430\u0439\u043c\u0435\u0440 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f<\/span>\r\n<span style=\"color: #66cc66;\">{<\/span>\r\n    digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">13<\/span>, <span style=\"color: #66cc66;\">!<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">13<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n<span style=\"color: #66cc66;\">}<\/span><\/pre>\n<p>\u0422\u0430\u0439\u043c\u0435\u0440 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0435 65535 \u043e\u0442\u0441\u0447\u0435\u0442\u043e\u0432, \u043f\u0440\u0438 \u0447\u0430\u0441\u0442\u043e\u0442\u0435 16 \u041c\u0413\u0446 \u044d\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0435 0,0041 \u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u043d\u043e \u0443 \u043d\u0430\u0441 \u0431\u0438\u0442\u044b <strong>CS10 CS11 CS12<\/strong> \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 <strong>TCCR1B<\/strong> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0442\u043e\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0432 1024 \u0440\u0430\u0437\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0432 1024 \u0440\u0430\u0437\u0430 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0439 \u0437\u0430 4,194 \u0441\u0435\u043a\u0443\u043d\u0434\u044b. \u041d\u043e \u0442\u0430\u043a \u0436\u0435 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f <b>OCR1A<\/b> \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0447\u0438\u0441\u043b\u043e 15624, \u0430 \u0431\u0438\u0442 <strong>OCIE1A<\/strong> \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 <strong>TIMSK1<\/strong> \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0441\u0447\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 <b>TCNT1<\/b> \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f <b>OCR1A<\/b>, \u0447\u0442\u043e \u0434\u0430\u0435\u0442 \u043d\u0430\u043c \u043f\u0435\u0440\u0438\u043e\u0434 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0432 1 \u0441\u0435\u043a\u0443\u043d\u0434\u0443. \u0411\u0438\u0442 <strong>WGM12<\/strong> \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 <strong>TCCR1B<\/strong> \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u0436\u0438\u043c \u0421\u0422\u0421 (\u0441\u0431\u0440\u043e\u0441 \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438).<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u00a0\u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f ISR \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0432\u044b\u0445\u043e\u0434\u0443 D13.<\/p>\n<blockquote>\n<p style=\"text-align: center;\"><span style=\"color: #000000;\"><strong><span style=\"color: #000000;\">ISR(TIMER1_COMPA_vect)<\/span><\/strong><\/span><\/p>\n<p style=\"text-align: center;\"><strong>TIMER1_COMPA_vect\u00a0 &#8212; \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e, \u043a\u0430\u043d\u0430\u043b A \u0442\u0430\u0439\u043c\u0435\u0440\u0430\/\u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 1<\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>T(\u041f\u0420\u0415\u0420\u042b\u0412\u0410\u041d\u0418\u0419) = 1\/(16000000 \/ (1024 * (1 + 15624))) = 1 s<\/strong><\/p>\n<p style=\"text-align: center;\"><strong>F (\u041f\u0420\u0415\u0420\u042b\u0412\u0410\u041d\u0418\u0419)= 16000000 \/ (1024 * (1 + 15624)) = 1 Hz<\/strong><\/p>\n<\/blockquote>\n<p>\u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u043b\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f <strong>OCR1A <\/strong>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0443:<\/p>\n<blockquote>\n<p style=\"text-align: center;\"><strong>OCR1A = 16000000 \/\u00a0 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c * \u043f\u0435\u0440\u0438\u043e\u0434 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f &#8212; 1<\/strong><\/p>\n<\/blockquote>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0432 0.2 \u0441 \u0440\u0430\u0441\u0447\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0438\u043c:<\/p>\n<blockquote>\n<p style=\"text-align: center;\"><strong>OCR1A = 16000000 \/ 1024 * 0.2 &#8212; 1 = 3124<\/strong><\/p>\n<\/blockquote>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0432\u043c\u0435\u0441\u0442\u043e \u043c\u0430\u0441\u043a\u0438 \u0431\u0438\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430:<\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\"><span style=\"color: #0066cc;\">void<\/span> setup<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n    pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">13<\/span>, OUTPUT<span style=\"color: #66cc66;\">)<\/span>;\r\n    cli<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;  \r\n    TCCR1A = 0b00000000;  \/\/ 0x00\r\n    TCCR1B = 0b00001100;  \/\/ 0x0C \r\n    OCR1A = <span style=\"color: #cc66cc;\">3124<\/span>; \r\n    TIMSK1 = 0b00000010;  \/\/ 0x02\r\n    sei<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>; \r\n<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> loop<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span><span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\nISR<span style=\"color: #66cc66;\">(<\/span>TIMER1_COMPA_vect<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">13<\/span>, <span style=\"color: #66cc66;\">!<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">13<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span><\/pre>\n<p>\u041f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0441\u0447\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 <b>TCNT1\u00a0<\/b><\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\"><span style=\"color: #0066cc;\">void<\/span> setup<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n    pinMode<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">13<\/span>, OUTPUT<span style=\"color: #66cc66;\">)<\/span>;\r\n    cli<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;  \r\n    TCCR1A = <span style=\"color: #cc66cc;\">0<\/span>;\r\n    TCCR1B = <span style=\"color: #cc66cc;\">0<\/span>;\r\n    TCCR1B <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> CS11<span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">|<\/span> <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> CS10<span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c 64<\/span>\r\n    <span style=\"color: #808080; font-style: italic;\">\/\/ F = 16000000 \/ 64 \/ 65535 = 3.81 Hz<\/span>\r\n    TIMSK1 <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> TOIE1<span style=\"color: #66cc66;\">)<\/span>;\r\n    sei<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>; \r\n<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> loop<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span><span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\nISR <span style=\"color: #66cc66;\">(<\/span>TIMER1_OVF_vect<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>digitalWrite<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">13<\/span>, <span style=\"color: #66cc66;\">!<\/span>digitalRead<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">13<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">)<\/span>;<span style=\"color: #66cc66;\">}<\/span>\r\n<\/pre>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 <strong>TCCR1B<\/strong> \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c, \u0430 \u0431\u0438\u0442 <strong>TOIE1<\/strong> \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 <b>TIMSK1<\/b> \u0432\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0433\u0434\u0430 \u0442\u0430\u0439\u043c\u0435\u0440 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0420\u0430\u0441\u0447\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043f\u0440\u0438 \u0442\u0430\u043a\u0442\u043e\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u0435 16 \u041c\u0413\u0446 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0443:<\/p>\n<blockquote>\n<p style=\"text-align: center;\"><strong>F = 16000000 \/ \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \/\u00a0 65535<\/strong><\/p>\n<\/blockquote>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0441\u0447\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>ISR (TIMER1_OVF_vect)<\/strong> , \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0439 \u0432 \u043d\u0435\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/ardduino_nano.jpg\" \/><\/p>\n<p>\u0423 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0432\u044b\u0445\u043e\u0434\u0430 <strong>OC1A<\/strong> <strong>OC1B<\/strong>, \u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 <strong>PB1<\/strong> <strong>PB2<\/strong> (D9 D10), \u044d\u0442\u0438 \u0432\u044b\u0445\u043e\u0434\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0428\u0418\u041c \u0441\u0438\u0433\u043d\u0430\u043b\u0430. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0445\u043e\u0434 OC1A \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f, \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430 \u043a \u0432\u044b\u0445\u043e\u0434\u0443 D9 (\u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 220 \u041e\u043c), \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 1 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0437\u0430\u0433\u043e\u0440\u0430\u0442\u044c\u0441\u044f, \u0430 \u043f\u043e\u0442\u043e\u043c \u043d\u0430 1 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0433\u0430\u0441\u043d\u0443\u0442\u044c (\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043c\u0435\u0430\u043d\u0434\u0440\u0430).<\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\"><span style=\"color: #0066cc;\">void<\/span> setup<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{\r\n<\/span>   \/\/ \u0441\u043c. \u043f\u0440\u0438\u043c\u0435\u0440 - <strong><a href=\"http:\/\/rcl-radio.ru\/?p=80812\">http:\/\/rcl-radio.ru\/?p=80812<\/a><\/strong>\r\n    DDRB = 0b00000010;       <span style=\"color: #808080; font-style: italic;\">\/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0438\u043d PB1 (D9) \u043a\u0430\u043a \u0432\u044b\u0445\u043e\u0434 | \u0432\u044b\u0445\u043e\u0434 OC1A<\/span>\r\n\u00a0\r\n    cli<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;                   <span style=\"color: #808080; font-style: italic;\">\/\/ \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f<\/span>\r\n    TCCR1A = <span style=\"color: #cc66cc;\">0<\/span>;              <span style=\"color: #808080; font-style: italic;\">\/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440 TCCR1A \u0432 0<\/span>\r\n    TCCR1B = <span style=\"color: #cc66cc;\">0<\/span>;              <span style=\"color: #808080; font-style: italic;\">\/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440 TCCR1B \u0432 0<\/span>\r\n\u00a0\r\n    TCCR1A <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> COM1A0<span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ COM1A1 COM1A0  = bit:01 - \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0430 OC1A \u043d\u0430 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0435 \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0441 A<\/span>\r\n\u00a0\r\n    TCCR1B <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> WGM12<span style=\"color: #66cc66;\">)<\/span>;  <span style=\"color: #808080; font-style: italic;\">\/\/ \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c CTC \u0440\u0435\u0436\u0438\u043c &gt; \u0441\u0431\u0440\u043e\u0441 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u043f\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044e<\/span>\r\n    TCCR1B <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> CS10<span style=\"color: #66cc66;\">)<\/span>;   <span style=\"color: #808080; font-style: italic;\">\/\/ \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0442\u044b CS10 CS12 \u043d\u0430 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f 1024  <\/span>\r\n    TCCR1B <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> CS12<span style=\"color: #66cc66;\">)<\/span>;   \r\n\u00a0\r\n    OCR1A = <span style=\"color: #cc66cc;\">15624<\/span>;           <span style=\"color: #808080; font-style: italic;\">\/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f (1 \u0441\u0435\u043a\u0443\u043d\u0434\u0430)<\/span>\r\n\u00a0\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/ F(\u0427\u0410\u0421\u0422\u041e\u0422\u0410 \u041c\u0415\u0410\u041d\u0414\u0420\u0410) = 8000000 \/ (1024 *(1 + 15624) = 1 s<\/span>\r\n\u00a0\r\n    sei<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;                   <span style=\"color: #808080; font-style: italic;\">\/\/ \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f<\/span>\r\n<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> loop<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span> <span style=\"color: #66cc66;\">}<\/span><\/pre>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u00a0<strong>TCCR1A<\/strong>:<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 12.5%; text-align: center;\">7<\/td>\n<td style=\"width: 12.5%; text-align: center;\">6<\/td>\n<td style=\"width: 12.5%; text-align: center;\">5<\/td>\n<td style=\"width: 12.5%; text-align: center;\">4<\/td>\n<td style=\"width: 12.5%; text-align: center;\">3<\/td>\n<td style=\"width: 12.5%; text-align: center;\">2<\/td>\n<td style=\"width: 12.5%; text-align: center;\">1<\/td>\n<td style=\"width: 12.5%; text-align: center;\">0<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">COM1A1<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">COM1A0<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">COM1B1<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">COM1B0<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\">&#8212;<\/td>\n<td style=\"width: 12.5%; text-align: center;\">&#8212;<\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">WGM11<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">WGM10<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043a\u043e\u0434\u0430 \u0431\u044b\u043b \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u00a0<strong>TCCR1A, <\/strong>\u0438\u0437\u043c\u0435\u043d\u0435\u043d \u0431\u0438\u0442 <span style=\"text-align: start;\">COM1A0. <\/span><\/p>\n<p><span style=\"text-align: start;\">\u0411\u0438\u0442\u044b <strong>COM1A1<\/strong> (7) \u0438 <strong>COM1A0<\/strong> (6) \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0442\u043e, \u043a\u0430\u043a\u043e\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043d\u0430 \u0432\u044b\u0432\u043e\u0434\u0435 <strong>OC1A<\/strong>\u00a0 \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0441 A (\u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0447\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 <b>TCNT1\u00a0<\/b>\u0441\u043e\u00a0\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f\u00a0<b>OCR1A<\/b>). <\/span><\/p>\n<p><span style=\"text-align: start;\">\u0411\u0438\u0442\u044b <strong>COM1B1<\/strong> (5) \u0438 <strong>COM1B0<\/strong> (4) \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0442\u043e, \u043a\u0430\u043a\u043e\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043d\u0430 \u0432\u044b\u0432\u043e\u0434\u0435 <strong>OC1B<\/strong>\u00a0 \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0441 B (\u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0447\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 <strong>TCNT1<\/strong>\u00a0\u0441\u043e\u00a0\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f\u00a0<strong>OCR1B<\/strong>).<\/span><\/p>\n<p>\u0411\u0438\u0442\u044b <span style=\"text-align: start;\"><strong>COM1A1<\/strong><\/span> (7)\u00a0<span style=\"text-align: start;\"><strong>COM1A0<\/strong><\/span> (6) \u0438 <span style=\"text-align: start;\"><strong>COM1B1<\/strong> (5) <strong>COM1B0<\/strong> (4) \u0438\u043c\u0435\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435:<\/span><\/p>\n<ul>\n<li>00 &#8212; \u0432\u044b\u0432\u043e\u0434 OC1A \u0438\u043b\u0438 OC1B \u043d\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442<\/li>\n<li>01 &#8212; \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0430 OC1A \u0438\u043b\u0438 OC1B \u043d\u0430 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0435 \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0441 A \u0438\u043b\u0438 B<\/li>\n<li>10 &#8212; \u0441\u0431\u0440\u043e\u0441 \u0432\u044b\u0432\u043e\u0434\u0430 OC1A \u0438\u043b\u0438 OC1B \u0432 0 \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438\u00a0\u0441 A \u0438\u043b\u0438 B<\/li>\n<li>11 &#8212; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u044b\u0432\u043e\u0434\u0430 OC1A \u0438\u043b\u0438 OC1B \u0432 1 \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0441 A \u0438\u043b\u0438 B<\/li>\n<\/ul>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0445\u043e\u0434 <span style=\"text-align: start;\"><strong>OC1A<\/strong><\/span>, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c.<\/p>\n<p>\u041a\u0430\u043a \u0440\u0430\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043e \u0443\u00a0\u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0432\u044b\u0445\u043e\u0434\u0430 <strong>OC1A<\/strong> <strong>OC1B<\/strong>, \u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 <strong>PB1<\/strong> <strong>PB2<\/strong> (D9 D10), \u044d\u0442\u0438 \u0432\u044b\u0445\u043e\u0434\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0428\u0418\u041c \u0441\u0438\u0433\u043d\u0430\u043b\u0430. \u0412 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>analogWrite()<\/strong> \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430 488,28 \u0413\u0446 \u043f\u0440\u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0442 0 \u0434\u043e 255. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0434\u043e 62,500 \u043a\u0413\u0446 \u043f\u0440\u0438 \u0428\u0418\u041c 8 \u0431\u0438\u0442, 31,250 \u043a\u0413\u0446 \u043f\u0440\u0438 \u0428\u0418\u041c 9 \u0431\u0438\u0442 \u0438 15,625 \u043a\u0413\u0446 \u043f\u0440\u0438 \u0428\u0418\u041c 10 \u0431\u0438\u0442.<\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-123643.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-80836\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-123643.png\" alt=\"\" width=\"481\" height=\"462\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-123643.png 481w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-123643-200x192.png 200w\" sizes=\"auto, (max-width: 481px) 100vw, 481px\" \/><\/a><\/p>\n<p>\u0411\u0438\u0442\u043d\u043e\u0441\u0442\u044c \u0428\u0418\u041c \u044d\u0442\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0443\u043f\u0435\u043d\u0435\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438 \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0435 \u0428\u0418\u041c \u043e\u0442 0 \u0434\u043e 100%, \u0434\u043b\u044f 8 \u0431\u0438\u0442 \u044d\u0442\u043e \u043e\u0442 0 \u0434\u043e 255, 9 \u0431\u0438\u0442 \u044d\u0442\u043e \u043e\u0442 0 \u0434\u043e 511 \u0438 10 \u0431\u0438\u0442 \u043e\u0442 0 \u0434\u043e 1023. \u0427\u0435\u043c \u0432\u044b\u0448\u0435 \u0431\u0438\u0442\u043d\u043e\u0441\u0442\u044c \u0428\u0418\u041c, \u0442\u0435\u043c \u043f\u043b\u0430\u0432\u043d\u0435\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0435\u0433\u043e \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0430 (\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438).<\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\"><span style=\"color: #0066cc;\">void<\/span> setup<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n    DDRB = 0b00000010;       <span style=\"color: #808080; font-style: italic;\">\/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0438\u043d PB1 (D9) \u043a\u0430\u043a \u0432\u044b\u0445\u043e\u0434 | \u0432\u044b\u0445\u043e\u0434 OC1A<\/span>\r\n\u00a0\r\n    cli<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;                   <span style=\"color: #808080; font-style: italic;\">\/\/ \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f<\/span>\r\n    TCCR1A = <span style=\"color: #cc66cc;\">0<\/span>;              <span style=\"color: #808080; font-style: italic;\">\/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440 TCCR1A \u0432 0<\/span>\r\n    TCCR1B = <span style=\"color: #cc66cc;\">0<\/span>;              <span style=\"color: #808080; font-style: italic;\">\/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440 TCCR1B \u0432 0<\/span>\r\n\u00a0\r\n   <span style=\"color: #808080; font-style: italic;\">\/* COM1A1 COM1A0 = bit:11 - \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u044b\u0432\u043e\u0434\u0430 OC1A \u0432 1 \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0441 A, \r\n      \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430  \u0432\u044b\u0432\u043e\u0434\u0430 OC1A \u0432 0 \u0435\u0441\u043b\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 TCNT1 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 0x00  (\u0438\u043d\u0432\u0435\u0440\u0441\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c) *\/<\/span>\r\n   TCCR1A <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">&lt;&lt;<\/span>COM1A1<span style=\"color: #66cc66;\">)<\/span>;\r\n   TCCR1A <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">&lt;&lt;<\/span>COM1A0<span style=\"color: #66cc66;\">)<\/span>;\r\n\u00a0\r\n<span style=\"color: #808080; font-style: italic;\">\/* PWM11  PWM10 \r\n    0      1    8 bit 255\r\n    1      0    9 bit 511    \r\n    1      1   10 bit 1023 \r\n   PWM13  PWM12\r\n    0      1    PWM    \r\n*\/<\/span>\r\n   TCCR1B <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">&lt;&lt;<\/span>WGM12<span style=\"color: #66cc66;\">)<\/span>;\r\n   TCCR1A <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">&lt;&lt;<\/span>WGM11<span style=\"color: #66cc66;\">)<\/span>;\r\n   TCCR1A <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">&lt;&lt;<\/span>WGM10<span style=\"color: #66cc66;\">)<\/span>;\r\n\u00a0\r\n   TCCR1B <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">&lt;&lt;<\/span>CS12<span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0442\u044b CS10 CS12 \u043d\u0430 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f 1024 \r\n\/\/ <span style=\"color: #999999;\">TCCR1B |= (1&lt;&lt;CS10);  <\/span> <\/span>\r\n   TCCR1B <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">&lt;&lt;<\/span>CS10<span style=\"color: #66cc66;\">)<\/span>; \r\n\u00a0\r\n   ICR1=<span style=\"color: #cc66cc;\">1023<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0437\u0430\u0445\u0432\u0430\u0442\u0430 (16 \u0431\u0438\u0442) \r\n<\/span>  <span style=\"color: #999999;\"> \/\/ \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 ICR1 1023-10bit, 511-9bit,255-8bit<\/span>\r\n   OCR1A=<span style=\"color: #cc66cc;\">511<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ 0 = 100% | 511 = 50%| 1023 = 0%<\/span>\r\n\u00a0\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/ F = 16000000 \/ 1024 (10 bit) \/ 1024 (\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c) = 15,26 \u0413\u0446<\/span>\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/ F = 16000000 \/ 512 (9 bit) \/ 1024 (\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c) = 30,52 \u0413\u0446\r\n  \/\/ F = 16000000 \/ 256 (8 bit) \/ 1024 (\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c) = 61,04 \u0413\u0446<\/span>\r\n\u00a0\r\n    sei<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;                   <span style=\"color: #808080; font-style: italic;\">\/\/ \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f<\/span>\r\n<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> loop<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span> <span style=\"color: #66cc66;\">}<\/span><\/pre>\n<p>\u0414\u043b\u044f \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0435\u0442\u0447\u0430 \u0441\u043d\u043e\u0432\u0430 \u043e\u0431\u0440\u0430\u0442\u0438\u043c\u0441\u044f \u043a \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u043c <strong>TCCR1A<\/strong> \u0438 <strong>TCCR1B<\/strong><\/p>\n<p style=\"font-weight: 400;\">\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u00a0<strong>TCCR1A<\/strong>:<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 12.5%; text-align: center;\">7<\/td>\n<td style=\"width: 12.5%; text-align: center;\">6<\/td>\n<td style=\"width: 12.5%; text-align: center;\">5<\/td>\n<td style=\"width: 12.5%; text-align: center;\">4<\/td>\n<td style=\"width: 12.5%; text-align: center;\">3<\/td>\n<td style=\"width: 12.5%; text-align: center;\">2<\/td>\n<td style=\"width: 12.5%; text-align: center;\">1<\/td>\n<td style=\"width: 12.5%; text-align: center;\">0<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">COM1A1<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">COM1A0<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">COM1B1<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">COM1B0<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\">&#8212;<\/td>\n<td style=\"width: 12.5%; text-align: center;\">&#8212;<\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">WGM11<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">WGM10<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"font-weight: 400;\">\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u00a0<strong>TCCR1B<\/strong>:<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 12.5%; text-align: center;\">7<\/td>\n<td style=\"width: 12.5%; text-align: center;\">6<\/td>\n<td style=\"width: 12.5%; text-align: center;\">5<\/td>\n<td style=\"width: 12.5%; text-align: center;\">4<\/td>\n<td style=\"width: 12.5%; text-align: center;\">3<\/td>\n<td style=\"width: 12.5%; text-align: center;\">2<\/td>\n<td style=\"width: 12.5%; text-align: center;\">1<\/td>\n<td style=\"width: 12.5%; text-align: center;\">0<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">ICNC1<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">ICES1<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\">&#8212;<\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">WGM13<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">WGM12<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">CS12<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">CS11<\/span><\/td>\n<td style=\"width: 12.5%; text-align: center;\"><span style=\"text-align: start;\">CS10<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0411\u0438\u0442\u044b <span style=\"text-align: start;\"><strong>WGM12<\/strong> <strong>WGM11<\/strong> <strong>WGM10<\/strong> \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u044e\u0442 <strong>PWM<\/strong>, \u043e\u0442 \u0431\u0438\u0442\u043e\u0432 <strong>WGM11<\/strong> <strong>WGM10<\/strong> \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c <strong>PWM(\u0428\u0418\u041c)<\/strong>:<\/span><\/p>\n<table style=\"border-collapse: collapse; width: 99.654%; height: 95px;\" border=\"1\">\n<tbody>\n<tr style=\"height: 21px;\">\n<td style=\"width: 25%; text-align: center; height: 21px;\"><strong>PWM11<\/strong><\/td>\n<td style=\"width: 25%; text-align: center; height: 21px;\"><strong>PWM10<\/strong><\/td>\n<td style=\"width: 25%; text-align: center; height: 21px;\"><strong>\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c<\/strong><\/td>\n<\/tr>\n<tr style=\"height: 21px;\">\n<td style=\"width: 25%; text-align: center; height: 21px;\">0<\/td>\n<td style=\"width: 25%; text-align: center; height: 21px;\">1<\/td>\n<td style=\"width: 25%; text-align: center; height: 21px;\">8 bit<\/td>\n<\/tr>\n<tr style=\"height: 21px;\">\n<td style=\"width: 25%; text-align: center; height: 21px;\">1<\/td>\n<td style=\"width: 25%; text-align: center; height: 21px;\">0<\/td>\n<td style=\"width: 25%; text-align: center; height: 21px;\">9 bit<\/td>\n<\/tr>\n<tr style=\"height: 21px;\">\n<td style=\"width: 25%; text-align: center; height: 21px;\">1<\/td>\n<td style=\"width: 25%; text-align: center; height: 21px;\">1<\/td>\n<td style=\"width: 25%; text-align: center; height: 21px;\">10 bit<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0411\u0438\u0442\u044b <span style=\"text-align: start;\"><strong>CS12 CS11 CS10<\/strong> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0442\u043e\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b.<\/span><\/p>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u044b <strong>COM1A1<\/strong> <strong>COM1A0<\/strong> \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0432\u044b\u0432\u043e\u0434 <strong>OC1A<\/strong> \u0432 1 \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0441 A,\u00a0 \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0432\u044b\u0432\u043e\u0434 <strong>OC1A<\/strong> \u0432 0 \u0435\u0441\u043b\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 <strong>TCNT1<\/strong> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 0x00 (\u0438\u043d\u0432\u0435\u0440\u0441\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c).<\/p>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0432\u0430 16-\u0438 \u0431\u0438\u0442\u043d\u044b\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 <strong>ICR1<\/strong> &#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0437\u0430\u0445\u0432\u0430\u0442\u0430 \u0438 <strong>OCR1A<\/strong> &#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440 \u0437\u0430\u0445\u0432\u0430\u0442\u0430 <strong>ICR1<\/strong> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0428\u0418\u041c, \u0434\u043b\u044f 10 \u0431\u0438\u0442 \u044d\u0442\u043e 1023, 9 \u0431\u0438\u0442 \u044d\u0442\u043e 511 \u0438 \u0434\u043b\u044f\u00a0 8 \u0431\u0438\u0442 \u044d\u0442\u043e 255. \u0420\u0435\u0433\u0438\u0441\u0442\u0440 <strong>OCR1A<\/strong> \u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u043a\u0432\u0430\u0436\u043d\u043e\u0441\u0442\u044c, \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 <strong>ICR1<\/strong>.<\/p>\n<p>\u0420\u0430\u0441\u0447\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0428\u0418\u041c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442:<\/p>\n<blockquote>\n<p style=\"text-align: center;\"><strong><span style=\"font-style: italic;\">F = 16000000 \/ \u0431\u0438\u0442\u043d\u043e\u0441\u0442\u044c \/ \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c<\/span><\/strong><\/p>\n<\/blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<blockquote>\n<p style=\"text-align: center;\"><strong><span style=\"font-style: italic;\">F = 16000000 \/ 1024 (10 bit) \/ 1024 (\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c) = 15,26 \u0413\u0446<\/span><\/strong><\/p>\n<p style=\"text-align: center;\"><span style=\"text-align: start;\"><strong>CS12 CS11 CS10 = bit:101<\/strong><\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"text-align: start;\"><strong>WGM12 <\/strong><strong>WGM11 <\/strong><strong>WGM10 = bit:111<\/strong><\/span><\/p>\n<p style=\"text-align: center;\"><strong>ICR1 = 1023<\/strong><\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-132214.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-80838 size-medium\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-132214-500x157.png\" alt=\"\" width=\"500\" height=\"157\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-132214-500x157.png 500w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-132214-200x63.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-132214-768x241.png 768w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-132214.png 785w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<hr \/>\n<p style=\"text-align: center;\"><strong><span style=\"font-style: italic;\">F = 16000000 \/ 1024 (10 bit) \/ 1 (\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c) = 15625 \u0413\u0446<\/span><\/strong><\/p>\n<p style=\"text-align: center;\"><span style=\"text-align: start;\"><strong>CS12 CS11 CS10 = bit:001<\/strong><\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"text-align: start;\"><strong>WGM12 <\/strong><strong>WGM11 <\/strong><strong>WGM10 = bit:111<\/strong><\/span><\/p>\n<p style=\"text-align: center;\"><strong>ICR1 = 1023<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-80839 size-medium\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-132720-500x184.png\" alt=\"\" width=\"500\" height=\"184\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-132720-500x184.png 500w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-132720-200x74.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-132720.png 693w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p>\n<hr \/>\n<p style=\"text-align: center;\"><strong><span style=\"font-style: italic;\">F = 16000000 \/ 512 (9 bit) \/ 1024 (\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c) = 30,52 \u0413\u0446<\/span><\/strong><\/p>\n<p style=\"text-align: center;\"><span style=\"text-align: start;\"><strong>CS12 CS11 CS10 = bit:101<\/strong><\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"text-align: start;\"><strong>WGM12 <\/strong><strong>WGM11 <\/strong><strong>WGM10 = bit:110<\/strong><\/span><\/p>\n<p style=\"text-align: center;\"><strong>ICR1 = 511<\/strong><\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-133009.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-80840 size-medium\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-133009-500x140.png\" alt=\"\" width=\"500\" height=\"140\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-133009-500x140.png 500w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-133009-200x56.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-133009.png 605w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<hr \/>\n<p style=\"text-align: center;\"><strong><span style=\"font-style: italic;\">F = 16000000 \/ 512 (9 bit) \/ 1 (\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c) = 31250 \u0413\u0446<\/span><\/strong><\/p>\n<p style=\"text-align: center;\"><span style=\"text-align: start;\"><strong>CS12 CS11 CS10 = bit:001<\/strong><\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"text-align: start;\"><strong>WGM12 <\/strong><strong>WGM11 <\/strong><strong>WGM10 = bit:110<\/strong><\/span><\/p>\n<p style=\"text-align: center;\"><strong>ICR1 = 511<\/strong><\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-134331.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-80841 size-medium\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-134331-500x155.png\" alt=\"\" width=\"500\" height=\"155\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-134331-500x155.png 500w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-134331-200x62.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-134331.png 699w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<hr \/>\n<p style=\"text-align: center;\"><strong><span style=\"font-style: italic;\">F = 16000000 \/ 256 (8 bit) \/ 1 (\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c) = 62500 \u0413\u0446<\/span><\/strong><\/p>\n<p style=\"text-align: center;\"><span style=\"text-align: start;\"><strong>CS12 CS11 CS10 = bit:001<\/strong><\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"text-align: start;\"><strong>WGM12 <\/strong><strong>WGM11 <\/strong><strong>WGM10 = bit:101<\/strong><\/span><\/p>\n<p style=\"text-align: center;\"><strong>ICR1 = 255<\/strong><\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-134913.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-80842 size-medium\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-134913-500x173.png\" alt=\"\" width=\"500\" height=\"173\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-134913-500x173.png 500w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-134913-200x69.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-134913-768x266.png 768w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-134913.png 772w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p><\/blockquote>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u043c\u0435\u0440\u0430, \u0442\u0430\u0439\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0441\u0447\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 <b>TCNT1.<\/b> \u0422\u0430\u043a\u0442\u043e\u0432\u044b\u0435 \u0438\u043c\u043f\u0443\u043b\u044c\u0441\u044b \u043f\u043e\u0434\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0432\u0445\u043e\u0434 \u04221 (PD5 \u0438\u043b\u0438 D5), \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0441\u0447\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 <b>TCNT1,<\/b> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <strong>byte \u0445<\/strong> \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443. \u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>delay()<\/strong> \u0437\u0430\u0434\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0430\u0439\u043c\u0435\u0440\u0430 (1000 \u043c\u0441).<\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace; font-size: 10px;\">volatile byte x;\r\nunsigned long f;\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> setup<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n    DDRD  = 0b00000000; <span style=\"color: #808080; font-style: italic;\">\/\/ \u0432\u0435\u0441\u044c \u043f\u043e\u0440\u0442 D \u043a\u0430\u043a \u0432\u0445\u043e\u0434<\/span>\r\n    PORTD = 0b00100000; <span style=\"color: #808080; font-style: italic;\">\/\/ \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 \u043d\u0430 PD5 (\u0432\u0445\u043e\u0434 T0)<\/span>\r\n    Serial.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9600<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n\u00a0\r\n    cli<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;  \r\n    TCCR1A = <span style=\"color: #cc66cc;\">0<\/span>;\r\n    TCCR1B = <span style=\"color: #cc66cc;\">0<\/span>;\r\n    TCCR1B = <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> CS12<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">|<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> CS11<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">|<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> CS10<span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/\u0412\u043d\u0435\u0448\u043d\u0438\u0439 \u0442\u0430\u043a\u0442\u043e\u0432\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043d\u0430 \u0432\u044b\u0432\u043e\u0434\u0435 T1. \u0422\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0444\u0440\u043e\u043d\u0442\u0443<\/span>\r\n    TIMSK1 <span style=\"color: #66cc66;\">|<\/span>= <span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span> <span style=\"color: #66cc66;\">&lt;&lt;<\/span> TOIE1<span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ \u0431\u0438\u0442 TOIE1 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 TIMSK1 \u0432\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0433\u0434\u0430 \u0442\u0430\u0439\u043c\u0435\u0440 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f<\/span>\r\n    sei<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>; \r\n<span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\n<span style=\"color: #0066cc;\">void<\/span> loop<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n  x=<span style=\"color: #cc66cc;\">0<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ \u043e\u0431\u043d\u0443\u043b\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0445<\/span>\r\n  TCNT1 = <span style=\"color: #cc66cc;\">0<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ \u043e\u0431\u043d\u0443\u043b\u0438\u0442\u044c \u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440<\/span>\r\n  sei<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f<\/span>\r\n  delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1000<\/span><span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ \u0436\u0434\u0435\u043c 1 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u043f\u043e\u043a\u0430 \u0442\u0430\u0439\u043c\u0435\u0440 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0438\u043c\u043f\u0443\u043b\u044c\u0441\u044b<\/span>\r\n  cli<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>; <span style=\"color: #808080; font-style: italic;\">\/\/ \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f<\/span>\r\n  f = x <span style=\"color: #66cc66;\">*<\/span> <span style=\"color: #cc66cc;\">65535<\/span> + TCNT1; <span style=\"color: #808080; font-style: italic;\">\/\/ \u043f\u043e\u0434\u0441\u0447\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u044b<\/span>\r\n  Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span>f<span style=\"color: #66cc66;\">)<\/span>;\r\n  <span style=\"color: #66cc66;\">}<\/span>\r\n\u00a0\r\nISR <span style=\"color: #66cc66;\">(<\/span>TIMER1_OVF_vect<span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>x++;<span style=\"color: #66cc66;\">}<\/span><span style=\"color: #808080; font-style: italic;\">\/\/ \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0445 \u043d\u0430 1<\/span><\/pre>\n<p>\u041d\u0430 \u0432\u0445\u043e\u0434 \u04221 \u043f\u043e\u0434\u0430\u043d\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 1 \u041c\u0413\u0446<\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-214818.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-80845\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-214818.png\" alt=\"\" width=\"272\" height=\"242\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-214818.png 272w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2020\/07\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2020-07-19-214818-200x178.png 200w\" sizes=\"auto, (max-width: 272px) 100vw, 272px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u043f\u043b\u0430\u0442\u0430\u0445 Arduino UNO Arduino NANO \u0432 8 \u0431\u0438\u0442\u043d\u043e\u043c AVR Atmega168 \u0438 Atmega328 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 Timer0, Timer1 \u0438 Timer2. Timer0 8 \u0431\u0438\u0442\u043d\u044b\u0439 \u0442\u0430\u0439\u043c\u0435\u0440, \u0435\u0433\u043e \u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u043c\u043e\u0436\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u0430 \u043e\u0442 0 \u0434\u043e 255. Timer0 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 Arduino \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a delay()\u00a0\u0438\u00a0millis(). Timer1 16 \u0431\u0438\u0442\u043d\u044b\u0439 \u0442\u0430\u0439\u043c\u0435\u0440, \u0435\u0433\u043e \u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u043c\u043e\u0436\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u0430 \u043e\u0442 0 \u0434\u043e 65535. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":80828,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[239,21],"tags":[],"class_list":["post-80820","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-21"],"views":15229,"_links":{"self":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/80820","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=80820"}],"version-history":[{"count":19,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/80820\/revisions"}],"predecessor-version":[{"id":111230,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/80820\/revisions\/111230"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/media\/80828"}],"wp:attachment":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=80820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=80820"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=80820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}