{"id":111487,"date":"2022-01-11T21:27:59","date_gmt":"2022-01-11T15:27:59","guid":{"rendered":"http:\/\/rcl-radio.ru\/?p=111487"},"modified":"2022-01-14T12:20:59","modified_gmt":"2022-01-14T06:20:59","slug":"%d0%ba%d0%b0%d0%bb%d1%8c%d0%ba%d1%83%d0%bb%d1%8f%d1%82%d0%be%d1%80-avr-%d1%80%d0%b5%d0%b6%d0%b8%d0%bc-ctc-%d1%81%d0%b1%d1%80%d0%be%d1%81-%d0%bf%d1%80%d0%b8-%d1%81%d0%be%d0%b2%d0%bf%d0%b0%d0%b4","status":"publish","type":"post","link":"http:\/\/rcl-radio.ru\/?p=111487","title":{"rendered":"\u041a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440 AVR &#8212; \u0440\u0435\u0436\u0438\u043c CTC (\u0441\u0431\u0440\u043e\u0441 \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438)(Arduino)"},"content":{"rendered":"<p>\u0420\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0430\u0439\u043c\u0435\u0440\u0430 CTC (\u0441\u0431\u0440\u043e\u0441 \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438) \u044d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 OCR \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0447\u0438\u0441\u043b\u043e, \u0430 \u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 TCNT \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0441\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u0447\u0438\u0441\u043b\u043e\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 OCR \u0438 \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0439 \u0432 \u043d\u0435\u0433\u043e \u043a\u043e\u0434.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b CTC \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 ATmega328.<\/p>\n<pre><span style=\"color: #00979c;\">bool<\/span> <span style=\"color: #000000;\">led_stat<\/span> \u00a0\u00a0\u00a0<span style=\"color: #434f54;\">=<\/span> <span style=\"color: #00979c;\">true<\/span><span style=\"color: #000000;\">;<\/span>\r\n\r\n<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: #d35400;\">pinMode<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">13<\/span><span style=\"color: #434f54;\">,<\/span> <span style=\"color: #00979c;\">OUTPUT<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #d35400;\">digitalWrite<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">13<\/span><span style=\"color: #434f54;\">,<\/span> <span style=\"color: #00979c;\">LOW<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span> \r\n \u00a0<span style=\"color: #000000;\">cli<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #000000;\">TCCR1A<\/span> <span style=\"color: #434f54;\">=<\/span> <span style=\"color: #000000;\">0<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #000000;\">TCCR1B<\/span> <span style=\"color: #434f54;\">=<\/span> <span style=\"color: #000000;\">0<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #000000;\">TCNT1<\/span> <span style=\"color: #434f54;\">=<\/span> <span style=\"color: #000000;\">0<\/span><span style=\"color: #000000;\">;<\/span>\r\n<span style=\"color: #434f54;\">\/\/ (16000000\/((31249+1)x256))=2 Hz<\/span>\r\n \u00a0<span style=\"color: #000000;\">OCR1A<\/span> <span style=\"color: #434f54;\">=<\/span> <span style=\"color: #000000;\">31249<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #000000;\">TCCR1B<\/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;\">WGM12<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n<span style=\"color: #434f54;\">\/\/ Prescaler 256<\/span>\r\n \u00a0<span style=\"color: #000000;\">TCCR1B<\/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;\">CS12<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #000000;\">TIMSK1<\/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;\">OCIE1A<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #000000;\">sei<\/span><span style=\"color: #000000;\">(<\/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;\">void<\/span> <span style=\"color: #5e6d03;\">loop<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">{<\/span><span style=\"color: #000000;\">}<\/span>\r\n\r\n<span style=\"color: #000000;\">ISR<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">TIMER1_COMPA_vect<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">{<\/span> \r\n \u00a0<span style=\"color: #d35400;\">digitalWrite<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">13<\/span><span style=\"color: #434f54;\">,<\/span> <span style=\"color: #000000;\">led_stat<\/span><span style=\"color: #000000;\">)<\/span><span style=\"color: #000000;\">;<\/span> \r\n \u00a0<span style=\"color: #000000;\">led_stat<\/span> <span style=\"color: #434f54;\">=<\/span> <span style=\"color: #434f54;\">!<\/span><span style=\"color: #000000;\">led_stat<\/span><span style=\"color: #000000;\">;<\/span>\r\n \u00a0<span style=\"color: #000000;\">}<\/span>\r\n\r\n<\/pre>\n<p>\u0412\u044b\u0448\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043a\u0435\u0442\u0447\u0430 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0431\u043e\u0442\u0443 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 1, \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u0439\u043c\u0435\u0440\u0430 2 \u0413\u0446, \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d \u043a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0438\u0433\u0430\u0442\u044c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 \u0432 \u0442\u0430\u043a\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0430\u0439\u043c\u0435\u0440\u0430 (\u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u0430\u043a\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 \u0437\u0430\u0433\u043e\u0440\u0430\u0435\u0442\u0441\u044f, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0442\u0430\u043a\u0442 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434 \u0433\u0430\u0441\u043d\u0435\u0442).<\/p>\n<div id=\"marketWidget\"><\/div>\n<p><span style=\"color: #000000;\">OCR1A &#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0430\u0439\u043c\u0435\u0440 1 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 Atmega328 16 \u0431\u0438\u0442, \u0442\u043e \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u043e\u0442 0 \u0434\u043e 65535.<\/span><\/p>\n<p><span style=\"color: #000000;\">TCCR1B &#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0436\u0438\u043c CTC \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c.<\/span><\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-210700-1.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111490\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-210700-1.png\" alt=\"\" width=\"682\" height=\"94\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-210700-1.png 682w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-210700-1-200x28.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-210700-1-500x69.png 500w\" sizes=\"auto, (max-width: 682px) 100vw, 682px\" \/><\/a><\/p>\n<p>\u041f\u0440\u0435\u0434\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0434\u0435\u043b\u0438\u0442 \u0442\u0430\u043a\u0442\u043e\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0431\u0438\u0442\u044b CS10 CS11 CS12 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 <span style=\"color: #000000;\">TCCR1B.<\/span><\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-210800.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111489\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-210800.png\" alt=\"\" width=\"643\" height=\"198\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-210800.png 643w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-210800-200x62.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-210800-500x154.png 500w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/a><\/p>\n<p>\u0411\u0438\u0442 WGM12 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u0436\u0438\u043c CTC<\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-210909-1.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111493\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-210909-1.png\" alt=\"\" width=\"701\" height=\"127\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-210909-1.png 701w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-210909-1-200x36.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-210909-1-500x91.png 500w\" sizes=\"auto, (max-width: 701px) 100vw, 701px\" \/><\/a><\/p>\n<p>TIMSK1 &#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f\u043c\u0438<\/p>\n<p><a href=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-211301.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-111492\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-211301.png\" alt=\"\" width=\"688\" height=\"105\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-211301.png 688w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-211301-200x31.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2022\/01\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-\u043e\u0442-2022-01-11-211301-500x76.png 500w\" sizes=\"auto, (max-width: 688px) 100vw, 688px\" \/><\/a><\/p>\n<p>\u0411\u0438\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 TIMSK1 OCIE1A\u00a0 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0442 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0441 A (<span style=\"color: #000000;\">OCR1A<\/span>)<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f <span style=\"color: #000000;\">ISR<\/span><span style=\"color: #000000;\">(<\/span><span style=\"color: #000000;\">TIMER1_COMPA_vect<\/span><span style=\"color: #000000;\">) \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043d\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d.<\/span><\/p>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043a\u0435\u0442\u0447\u0430 \u0442\u0430\u0439\u043c\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u0439 2 \u0413\u0446, \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043f\u0440\u0435\u0434\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f \u0438 \u0441\u0447\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430:<\/p>\n<blockquote>\n<h3 style=\"text-align: center;\"><span style=\"color: #333399;\"><strong>(16000000\/((31249+1)x256))=2 Hz<\/strong><\/span><\/h3>\n<p><strong><span style=\"color: #434f54;\">16000000 &#8212; \u0442\u0430\u043a\u0442\u043e\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430<\/span><\/strong><\/p>\n<p><strong><span style=\"color: #434f54;\">31249 &#8212; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0447\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430<\/span><\/strong><\/p>\n<p><strong><span style=\"color: #434f54;\">256 &#8212; \u043f\u0440\u0435\u0434\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c<\/span><\/strong><\/p><\/blockquote>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0442\u0430\u0439\u043c\u0435\u0440\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 Atmega328 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u0439\u043c\u0435\u0440 0 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 delay()\u00a0\u0438\u00a0millis(), \u0430 \u0442\u0430\u0439\u043c\u0435\u0440 2 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u00a0tone().<\/p>\n<p>\u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0442\u0430\u0439\u043c\u0435\u0440\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043d\u043b\u0430\u0439\u043d \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u043c.<\/p>\n<p><iframe loading=\"lazy\" src=\"http:\/\/rcl-radio.ru\/php\/avr_timer.php\" width=\"100%\" height=\"660\" frameborder=\"0\"><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><\/iframe><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0420\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0430\u0439\u043c\u0435\u0440\u0430 CTC (\u0441\u0431\u0440\u043e\u0441 \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438) \u044d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 OCR \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0447\u0438\u0441\u043b\u043e, \u0430 \u0441\u0447\u0435\u0442\u043d\u044b\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 TCNT \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0441\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u0447\u0438\u0441\u043b\u043e\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 OCR \u0438 \u043f\u0440\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0439 \u0432 \u043d\u0435\u0433\u043e \u043a\u043e\u0434. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b CTC \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 ATmega328. bool led_stat \u00a0\u00a0\u00a0= true; void [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":111496,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[239,17,21],"tags":[],"class_list":["post-111487","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-17","category-21"],"views":7090,"_links":{"self":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/111487","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=111487"}],"version-history":[{"count":4,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/111487\/revisions"}],"predecessor-version":[{"id":111556,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/111487\/revisions\/111556"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/media\/111496"}],"wp:attachment":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=111487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=111487"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=111487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}