<?xml version="1.0" encoding="UTF-8" ?><!-- generator=Zoho Sites --><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><atom:link href="https://www.technobotix.in/blogs/tag/am32/feed" rel="self" type="application/rss+xml"/><title>TECHNOBOTIX - Blog #AM32</title><description>TECHNOBOTIX - Blog #AM32</description><link>https://www.technobotix.in/blogs/tag/am32</link><lastBuildDate>Sat, 04 Jul 2026 05:01:57 +0530</lastBuildDate><generator>http://zoho.com/sites/</generator><item><title><![CDATA[AM32/BLHeli ESC 1-Wire Linker for Arduino Uno & Nano]]></title><link>https://www.technobotix.in/blogs/post/am32-blheli-esc-1-wire-linker-for-arduino-uno-nano</link><description><![CDATA[If you want to flash or configure your AM32/BLHeli ESC using just an Arduino, here's a quick sketch that turns your Uno or Nano into a 1-Wire passthrough interface.]]></description><content:encoded><![CDATA[
<div class="zpcontent-container blogpost-container "><div data-element-id="elm_4NVImBHLS1-vgY1dlohvDA" data-element-type="section" class="zpsection "><style type="text/css"></style><div class="zpcontainer"><div data-element-id="elm_QUxbsxjhQdyJIE8P48mcvw" data-element-type="row" class="zprow zpalign-items- zpjustify-content- "><style type="text/css"></style><div data-element-id="elm_7ktZWWNSQ9aVTWXRqErkOA" data-element-type="column" class="zpelem-col zpcol-12 zpcol-md-12 zpcol-sm-12 zpalign-self- "><style type="text/css"></style><div data-element-id="elm_Crk3RREYQbi7IvCF4cCTyA" data-element-type="heading" class="zpelement zpelem-heading "><style> [data-element-id="elm_Crk3RREYQbi7IvCF4cCTyA"].zpelem-heading { margin-block-start:8px; } </style><h2
 class="zpheading zpheading-align-center " data-editor="true"><div style="color:inherit;"><div>If you want to flash or configure your AM32/BLHeli ESC using just an Arduino, here's a quick sketch that turns your Uno or Nano into a 1-Wire passthrough interface.</div><br><div><br></div></div></h2></div>
<div data-element-id="elm_bwnHLYa0S067eGXgkaNimg" data-element-type="text" class="zpelement zpelem-text "><style></style><div class="zptext zptext-align-left " data-editor="true"><div style="color:inherit;"><div><div>&nbsp; &nbsp;&nbsp;<span style="font-weight:700;">Wiring:</span></div></div><div>&nbsp; &nbsp; For Arduino Nano → connect the ESC signal wire to pin D3</div><div>&nbsp; &nbsp; For Arduino Uno → connect the ESC signal wire to pin D11</div><div>&nbsp; &nbsp; For Arduino Mega → connect the ESC signal wire to pin D51</div><div>&nbsp; &nbsp; Ground always connects to GND</div><div><br></div><div><div>&nbsp; &nbsp;&nbsp;<span style="font-weight:700;">How to use:</span></div></div><div><span style="color:inherit;">&nbsp; &nbsp; Open the code below in Arduino IDE.</span></div><div>&nbsp; &nbsp; Select your board (Uno or Nano) under Tools &gt; Board.</div><div>&nbsp; &nbsp; Upload the sketch — the correct pin is selected automatically based on your board choice.</div><div>&nbsp; &nbsp; Wire your ESC signal wire to the pin mentioned above, and ground to ground.</div><div>&nbsp; &nbsp; Connect to BLHeliSuite or AM32 configurator and flash your ESC.</div><br><div><div><span style="color:inherit;">&nbsp; &nbsp;&nbsp;<span style="font-weight:700;">Code:</span></span></div></div><div><span style="color:inherit;">&nbsp; &nbsp; &nbsp;#include &lt;avr/io.h&gt;</span></div><div><span style="color:inherit;">&nbsp; &nbsp; &nbsp;//1-Wire Pin:</span></div><div>&nbsp; &nbsp; //Arduino Nano only -&gt; PD3=&quot;D3</div><div><span style="color:inherit;">&nbsp; &nbsp; //MEGA boards -&gt; PB2=&quot;D51=MOSI&quot;&nbsp;</span><br><div>&nbsp; &nbsp; //all other -&gt; PB3=&quot;D11=MOSI</div><div><span style="color:inherit;">&nbsp; &nbsp; #define OW_PINB3</span><div><span style="color:inherit;">&nbsp; &nbsp; #if defined OW_PINB3</span></div><div>&nbsp; &nbsp; #define OW_DDR DDRB</div><div>&nbsp; &nbsp; #define OW_PORT PORTB</div><div>&nbsp; &nbsp; #define OW_PIN PINB</div><div>&nbsp; &nbsp; #define OW PINB3</div><div>&nbsp; &nbsp; #elif defined OW_PIND3</div><div>&nbsp; &nbsp; #define OW_DDR DDRD</div><div>&nbsp; &nbsp; #define OW_PORT PORTD</div><div>&nbsp; &nbsp; #define OW_PIN PIND</div><div>&nbsp; &nbsp; #define OW PIND3</div><div>&nbsp; &nbsp; #elif defined OW_PINB2</div><div>&nbsp; &nbsp; #define OW_DDR DDRB</div><div>&nbsp; &nbsp; #define OW_PORT PORTB</div><div>&nbsp; &nbsp; #define OW_PIN PINB</div><div>&nbsp; &nbsp; #define OW PINB2</div><div>&nbsp; &nbsp; #endif</div><br><div><span style="color:inherit;">&nbsp; &nbsp; #if (defined (_AVR_ATmega2560) || defined (AVR_ATmega1280_))</span></div><div>&nbsp; &nbsp; #define IN_DDR DDRE</div><div>&nbsp; &nbsp; #define IN_PORT PORTE</div><div>&nbsp; &nbsp; #define IN_PIN PINE</div><div><br></div><div><span style="color:inherit;">&nbsp; &nbsp; #define IN_RX PINE0</span></div><div>&nbsp; &nbsp; #define IN_TX PINE1</div><div>&nbsp; &nbsp; #else</div><div><br></div><div><span style="color:inherit;">&nbsp; &nbsp; #define IN_DDR DDRD</span></div><div>&nbsp; &nbsp; #define IN_PORT PORTD</div><div><span style="color:inherit;">&nbsp; &nbsp; #define IN_PIN PIND</span></div><div><span style="color:inherit;"><br></span></div><div><span style="color:inherit;">&nbsp; &nbsp; #define IN_RX PIND0&nbsp;</span></div><div>&nbsp; &nbsp; #define IN_TX PIND1</div><br><div><span style="color:inherit;">&nbsp; &nbsp; #endif&nbsp;</span></div><br><div>&nbsp; &nbsp;&nbsp;<span style="color:inherit;">#define SetOWout (OW_DDR|= (1&lt;&lt; OW))</span></div><div>&nbsp; &nbsp; #define SetOWin (OW_DDR &amp;= ~(1&lt;&lt; OW))</div><div>&nbsp; &nbsp; #define SetOWlow (OW_PORT &amp;= ~(1&lt;&lt; OW))</div><div>&nbsp; &nbsp; #define SetOWhigh (OW_PORT |= (1&lt;&lt; OW))</div><div>&nbsp; &nbsp; #define IsOWhigh (OW_PIN &amp; (1&lt;&lt; OW))</div><div>&nbsp; &nbsp; #define IsOWlow (!(OW_PIN &amp; (1&lt;&lt; OW)))</div><br><div><span style="color:inherit;">&nbsp; &nbsp; #define SetTXlow (IN_PORT &amp;= ~(1&lt;&lt; IN_TX))</span></div><div><span style="color:inherit;">&nbsp; &nbsp; #define SetTXhigh (IN_PORT |= (1&lt;&lt; IN_TX))</span></div><div>&nbsp; &nbsp; #define IsRXhigh (IN_PIN &amp; (1&lt;&lt; IN_RX))</div><div>&nbsp; &nbsp; #define IsRXlow (!(IN_PIN &amp; (1&lt;&lt; IN_RX)))</div><br><div><span style="color:inherit;">&nbsp; &nbsp; int main(void)</span></div><div>&nbsp; &nbsp; {</div><div><span style="color:inherit;">&nbsp; &nbsp; &nbsp; &nbsp;//Very important disable hardware UART</span></div><div>&nbsp; &nbsp; &nbsp; &nbsp;UCSR0B =0;</div><div>&nbsp; &nbsp; &nbsp; &nbsp;IN_DDR |=&nbsp; (1&lt;&lt;IN_TX );</div><div>&nbsp; &nbsp; &nbsp; &nbsp;IN_DDR &amp;= ~(0&lt;&lt; IN_RX);</div><div>&nbsp; &nbsp; &nbsp; &nbsp;IN_PORT|= (1&lt;&lt;IN_TX )|(1&lt;&lt; IN_RX); //pullup RX ;TX high</div><div>&nbsp; &nbsp; &nbsp; &nbsp;//SetOWin;//Set OW as input / default</div><div><span style="color:inherit;">&nbsp; &nbsp; &nbsp; &nbsp;SetOWhigh; //pull up on</span></div><br><div><span style="color:inherit;">&nbsp; &nbsp; &nbsp; &nbsp;while(IsRXhigh); //wait for RX go Low = 1 Incoming data</span></div><div>&nbsp; &nbsp; &nbsp; &nbsp;while(1)</div><div>&nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //RX low = 1 -&gt; set oneWire to output&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetOWout;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetOWlow; //Set oneWire low =1</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetTXlow;&nbsp; //Echo low to TX&nbsp;</div><br><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color:inherit;">//Wait RX go high = 0 again</span></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while(IsRXlow);</div><br><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:inherit;">&nbsp;// input // RX is high (or high again) = 0 end of bit or idle - so listen to data from TRX&nbsp;</span></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetOWhigh;&nbsp; //Set OneWire High = 0 for sharper edge //can be skipped?</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //and Echo low to TX&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetOWin;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetOWhigh;&nbsp; //Set OneWire pull up</div><div><span style="color:inherit;"><br></span></div><div><span style="color:inherit;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (IsRXhigh) //while RX high (no incoming bytes)</span></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if&nbsp; (IsOWhigh) SetTXhigh; //Set TX High = 0</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else SetTXlow; //Set TX Low = 1&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}&nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; }</div></div></div></div></div>
</div><div data-element-id="elm_pft74j__Sg6wJ-fc5kBw-A" data-element-type="button" class="zpelement zpelem-button "><style></style><div class="zpbutton-container zpbutton-align-center"><style type="text/css"></style><a role="button" class="zpbutton-wrapper zpbutton zpbutton-type-primary zpbutton-size-md " href="javascript:;" target="_blank"><span class="zpbutton-content">Get Started Now</span></a></div>
</div></div></div></div></div></div> ]]></content:encoded><pubDate>Wed, 01 Jul 2026 07:07:04 +0000</pubDate></item></channel></rss>