{"id":16950,"date":"2017-02-07T19:15:02","date_gmt":"2017-02-07T16:15:02","guid":{"rendered":"https:\/\/icelord.net\/wordpress\/archives\/16950"},"modified":"2017-02-07T19:15:02","modified_gmt":"2017-02-07T16:15:02","slug":"%d0%b1%d0%b5%d0%b7%d1%82%d1%80%d0%b0%d0%bc%d0%b1%d0%bb%d0%b5%d1%80%d0%bd%d0%be%d0%b5-%d0%b7%d0%b0%d0%b6%d0%b8%d0%b3%d0%b0%d0%bd%d0%b8%d0%b5-coilonplug-4-%d0%bd%d0%b0-%d0%bf%d0%be-%d0%be%d0%b1","status":"publish","type":"post","link":"https:\/\/icelord.net\/wordpress\/?p=16950","title":{"rendered":"\u0411\u0435\u0437\u0442\u0440\u0430\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u0435 \u0437\u0430\u0436\u0438\u0433\u0430\u043d\u0438\u0435 (CoilOnPlug) #4 (\u043d\u0430 \u043f\u043e \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0442\u044c)"},"content":{"rendered":"\n<p>\u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u043a\u0430 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0435 \u0432\u044b\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f (\u044d\u0442\u043e \u0432\u0441\u0435 \u0434\u0438\u0447\u0430\u0439\u0448\u0430\u044f alfa \u0432\u0435\u0440\u0441\u0438\u044f, \u0434\u043b\u044f \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f!)<\/p>\n<p>\u0421\u0445\u0435\u043c\u0430:<\/p>\n<\/p>\n<div class=\"c-post__pic\" itemscope=\"itemscope\" itemtype=\"http:\/\/schema.org\/ImageObject\"><a class=\"c-lightbox-anchor js-lightbox c-pic-zoom\" data-size=\"1920,1255\" href=\"https:\/\/icelord.net\/honda\/image\/wp\/9df2c81s-1920.jpg\" rel=\"noopener\" target=\"_blank\"><\/a> <\/p>\n<div class=\"o-img\" data-size=\"960,627\" style=\"background-color: #FBFBFB;\"><span style=\"display: blo-ck; padding-to-p: 65.3125%\"><\/span><img decoding=\"async\" h_eight=\"627\" src=\"https:\/\/icelord.net\/honda\/image\/wp\/9df2c81s-960.jpg\" width=\"960\"\/><\/div>\n<\/p><\/div>\n<p>\u04211 \u0438 PG \u2014 \u0441\u0435\u043d\u0441\u043e\u0440 CYP1 \u0432 \u0442\u0440\u0430\u043c\u0431\u043b\u0435\u0440\u0435<br \/> +12 \u0438 G \u2014 \u043f\u0438\u0442\u0430\u043d\u0438\u0435<br \/> 1,2,3,4 \u2014 \u0432\u044b\u0445\u043e\u0434-\u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u043d\u0430 \u043a\u0430\u0442\u0443\u0448\u043a\u0438<br \/> IGN \u2014 \u0441\u0438\u0433\u043d\u0430\u043b \u0437\u0430\u0436\u0438\u0433\u0430\u043d\u0438\u044f \u043e\u0442 ECU<br \/> TACH \u2014 \u0432\u044b\u0445\u043e\u0434 \u0442\u0430\u0445\u043e\u043c\u0435\u0442\u0440\u0430<br \/> VCC, GND, SCK, MSIO, MOSI, RST \u2014 \u0432\u044b\u0445\u043e\u0434\u044b \u043d\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0442\u043e\u0440<\/p>\n<p>\u041f\u043b\u0430\u0442\u0430:<\/p>\n<\/p>\n<div class=\"c-post__pic\" itemscope=\"itemscope\" itemtype=\"http:\/\/schema.org\/ImageObject\"><a class=\"c-lightbox-anchor js-lightbox c-pic-zoom\" data-size=\"1129,837\" href=\"https:\/\/icelord.net\/honda\/image\/wp\/a3f2c81s-1920.jpg\" rel=\"noopener\" target=\"_blank\"><\/a> <\/p>\n<div class=\"o-img\" data-size=\"960,712\" style=\"background-color: #623E36;\"><span style=\"display: blo-ck; padding-to-p: 74.16666%\"><\/span><img decoding=\"async\" h_eight=\"712\" src=\"https:\/\/icelord.net\/honda\/image\/wp\/a3f2c81s-960.jpg\" width=\"960\"\/><\/div>\n<\/p><\/div>\n<p>\u0438\u0437 \u0442\u0440\u0430\u043c\u0431\u043b\u0435\u0440\u0430 \u0432\u044b\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f: \u0431\u0435\u0433\u0443\u043d\u043e\u043a, \u043a\u0430\u0442\u0443\u0448\u043a\u0430, \u043a\u043e\u043c\u043c\u0443\u0442\u0430\u0442\u043e\u0440, \u043f\u043b\u0430\u0442\u0430 \u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u043e \u043a\u0430\u0442\u0443\u0448\u043a\u0438 (\u0442\u0430\u043c \u0441 \u0437\u0430\u043f\u0430\u0441\u043e\u043c \u043c\u0435\u0441\u0442\u0430, \u0432 \u0442\u0435\u043e\u0440\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u043c\u0435\u0441\u0442\u043e \u043a\u043e\u043c\u043c\u0443\u0442\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u0438\u0441\u0442\u0440\u043e\u0438\u0442\u044c, \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e \u043c\u043e\u0437\u0433\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u041a\u043e\u0434 (\u043d\u0430 drive \u043d\u0435\u043b\u044c\u0437\u044f &lt;pre&gt; \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0442\u0430\u043a \u0447\u0442\u043e \u043a\u043e\u0434 \u2014 \u0431\u043e\u043b\u044c, \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c: <a class=\"c-link\" href=\"https:\/\/icelord.net\/wordpress\/archives\/16569\" rel=\"nofollow noopener\" target=\"_blank\">icelord.net\/wordpress\/archives\/16569<\/a>):<\/p>\n<p>\/*****************************************************<br \/> Project : Ab0VE Tech Coil on Plug I4 Controller<br \/> Version : 0.1<br \/> Author : icelord<br \/> MCU : ATTiny26<br \/> *****************************************************\/<\/p>\n<p>#include &lt;avr \/io.h&gt;<br \/> #include &lt;\/avr&gt;&lt;avr \/interrupt.h&gt;<\/p>\n<p>\/\/ OUTPUT<br \/> #define IGNITION1 PA0<br \/> #define IGNITION2 PA1<br \/> #define IGNITION3 PA2<br \/> #define IGNITION4 PA3<br \/> #define LED PB6<br \/> #define TACHO PA5<\/p>\n<p>\/\/ INPUT<br \/> #define CYP1 PA4<br \/> #define IGN PB5<\/p>\n<p>uint8_t CYLINDER=0;<br \/> uint8_t WASFIRE=0;<br \/> uint8_t INFIRE=0;<br \/> uint8_t WASCYP=0;<\/p>\n<p>ISR( __vectorPCINT4, ISR_NOBLOCK) \/\/ PCINT4 \u2014 CYP PA4<br \/> {<br \/> \/\/ Check CYP<br \/> if ( ((PINA &amp; (1 &lt; &lt; 4))==1 ) &amp;&amp; (!WASCYP)) { \/\/ CYP<br \/> CYLINDER=1;WASCYP=1;<br \/> }<br \/> if ( ((PINA &amp; (1 &lt;&lt; 4))==0) &amp;&amp; (WASCYP)) { \/\/ GONE CYP<br \/> WASCYP=0;<br \/> }<br \/> }<\/p>\n<p>ISR( __vectorPCINT13, ISR_NOBLOCK) \/\/ PCINT13 \u2014 IGN PB5<br \/> {<br \/> \/\/ Check FIRE<br \/> if ( ((PINB &amp; (1 &lt;&lt; 5))==1) &amp;&amp; (!INFIRE)) { \/\/ Start FIRE<br \/> INFIRE=1;<br \/> }<br \/> if ( ((PINB &amp; (1 &lt;&lt; 5))==0) &amp;&amp; (INFIRE)) { \/\/ GONE FIRE<br \/> INFIRE=0;<br \/> }<br \/> }<\/p>\n<p>int main(void)<br \/> {<br \/> uint8_t LEDSTATUS=0;<\/p>\n<p>DDRB = 0b01000000;<br \/> DDRA = 0b00101111;<\/p>\n<p>PORTB |= _BV(LED); \/\/ LED ON on start<\/p>\n<p>while (1)<br \/> {<br \/> if (INFIRE==1)\/\/ Fire coil?<br \/> { WASFIRE=1;<br \/> PORTA |= _BV(TACHO);<br \/> switch (CYLINDER){ \/\/ Set fire for required coil 1-3-4-2<br \/> case 1: PORTA |= _BV(IGNITION1);<br \/> case 2: PORTA |= _BV(IGNITION3);<br \/> case 3: PORTA |= _BV(IGNITION4);<br \/> case 4: PORTA |= _BV(IGNITION2);<br \/> }<br \/> } else<br \/> {<br \/> if (WASFIRE==1){ \/\/ ready for next cylinder?<br \/> PORTA=0; \/\/ disable all coils and TACHO for some reasons<br \/> WASFIRE=0;<br \/> CYLINDER++;<br \/> if (CYLINDER&gt;4) { \/\/ only 4 cylinder model \ud83d\ude42<br \/> CYLINDER=1;<br \/> if (LEDSTATUS==0) {\/\/ Change LED on each _FULL_ cycle<br \/> PORTB &amp;= ~_BV(LED); \/\/ LED ON<br \/> LEDSTATUS=1;<br \/> } else {<br \/> PORTB |= _BV(LED); \/\/ LED ON<br \/> LEDSTATUS=0;<br \/> }<br \/> }<br \/> } \/\/ was fire<br \/> }<\/p>\n<p>} \/\/ main loop<\/p>\n<p>}<\/p>\n<p>\u041f\u0440\u0430\u0432\u043a\u0438-\u0438\u0434\u0435\u044f-\u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 welcome! )<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u043a\u0430 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0435 \u0432\u044b\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f (\u044d\u0442\u043e \u0432\u0441\u0435 \u0434\u0438\u0447\u0430\u0439\u0448\u0430\u044f alfa \u0432\u0435\u0440\u0441\u0438\u044f, \u0434\u043b\u044f \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f!) \u0421\u0445\u0435\u043c\u0430: \u04211 \u0438 PG \u2014 \u0441\u0435\u043d\u0441\u043e\u0440 CYP1 \u0432 \u0442\u0440\u0430\u043c\u0431\u043b\u0435\u0440\u0435 +12 \u0438 G \u2014 \u043f\u0438\u0442\u0430\u043d\u0438\u0435 1,2,3,4 \u2014 \u0432\u044b\u0445\u043e\u0434-\u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u043d\u0430 \u043a\u0430\u0442\u0443\u0448\u043a\u0438 IGN \u2014 \u0441\u0438\u0433\u043d\u0430\u043b \u0437\u0430\u0436\u0438\u0433\u0430\u043d\u0438\u044f \u043e\u0442 ECU TACH \u2014 \u0432\u044b\u0445\u043e\u0434 \u0442\u0430\u0445\u043e\u043c\u0435\u0442\u0440\u0430 VCC, GND, SCK, MSIO, MOSI, RST \u2014 \u0432\u044b\u0445\u043e\u0434\u044b \u043d\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0442\u043e\u0440 \u041f\u043b\u0430\u0442\u0430: \u0438\u0437 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-16950","post","type-post","status-publish","format-standard","hentry","category-blog"],"views":955,"_links":{"self":[{"href":"https:\/\/icelord.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/16950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icelord.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icelord.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icelord.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/icelord.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16950"}],"version-history":[{"count":0,"href":"https:\/\/icelord.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/16950\/revisions"}],"wp:attachment":[{"href":"https:\/\/icelord.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icelord.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16950"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icelord.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}