3.8. Raspberry Pi interface and level shifters

<p>The A-Star 32U4 Robot Controller with Raspberry Pi Bridge can be used as an expansion board on top of a Raspberry Pi single-board computer. It conforms to the Raspberry Pi HAT (Hardware Attached on Top) specification and is designed to connect to the Model B+ and newer versions of the Raspberry Pi with 40-pin GPIO headers (including the <a href="/product/2759">Raspberry Pi&nbsp;3 Model&nbsp;B</a> and <a href="/product/2760">Model&nbsp;A+</a>). A <a href="/product/1037">2&#215;20-pin 0.1″ female header</a> is soldered to the assembled version of the robot controller, and it ships with a set of four <a href="/product/1952">standoffs</a>, <a href="/product/1968">screws</a>, and <a href="/product/1967">nuts</a>. (The header and mounting hardware are not included with the SMT-only version, but you can solder in either a standard or <a href="/product/2748">stackable</a> header yourself.)</p> <table class="picture_with_caption center"><tr><td><a href="https://a.pololu-files.com/picture/0J6666.1200.jpg?3af7218d00127222b1596fa9744e6c02" class="noscript-fallback"><img alt="" class="zoomable" data-gallery-pictures="[{&quot;id&quot;:&quot;0J6666&quot;,&quot;caption&quot;:&quot;\u003cp\u003eA-Star 32U4 Robot Controller LV with Raspberry Pi Bridge on a Raspberry Pi Model B+.\u003c/p\u003e&quot;,&quot;url_tiny&quot;:&quot;https://a.pololu-files.com/picture/0J6666.98x98.jpg?3af7218d00127222b1596fa9744e6c02&quot;,&quot;url_medium&quot;:&quot;https://a.pololu-files.com/picture/0J6666.600x480.jpg?3af7218d00127222b1596fa9744e6c02&quot;,&quot;url_full&quot;:&quot;https://a.pololu-files.com/picture/0J6666.1200.jpg?3af7218d00127222b1596fa9744e6c02&quot;,&quot;longest_side&quot;:1200}]" data-picture-id="0J6666" data-picture-longest_side="1200" src="https://a.pololu-files.com/picture/0J6666.400.jpg?3af7218d00127222b1596fa9744e6c02" /></a></td><p></tr></table></p> <h4>I²C communication</h4> <p>When used as a Raspberry Pi add-on, the A-Star is designed to serve as an auxiliary controller, communicating with the Raspberry Pi using an I²C interface (also known as 2-wire Serial Interface, or TWI). As such, the ATmega32U4 microcontroller&#8217;s I²C data and clock lines (SDA and SCL) are connected to the corresponding lines on the Raspberry Pi&#8217;s I²C bus 1 through on-board level-shifting circuits. These bidirectional level shifters convert between the AVR&#8217;s 5&nbsp;V logic level and the Raspberry Pi&#8217;s 3.3&nbsp;V logic level.</p> <p>We have written an <a href="https://github.com/pololu/pololu-rpi-slave-arduino-library">Arduino library</a> for the robot controller that lets it act as an I²C slave and provides a framework for communication between the A-Star and a Raspberry Pi master. A <a href="/blog/577">tutorial</a> on the Pololu blog demonstrates this library and its included example code, using them to make a robot that can be remotely controlled and monitored through a web server running on the Raspberry Pi.</p> <table class="picture_with_caption center"><tr><td style="max-width: 400px"><a href="https://a.pololu-files.com/picture/0J7050.1200.jpg?bfc943a9e5b64604e274263489fafa9f" class="noscript-fallback"><img alt="" class="zoomable" data-gallery-pictures="[{&quot;id&quot;:&quot;0J7050&quot;,&quot;caption&quot;:&quot;\u003cp\u003eRaspberry Pi robot using the A-Star 32U4 Robot Controller.\u003c/p\u003e&quot;,&quot;url_tiny&quot;:&quot;https://a.pololu-files.com/picture/0J7050.98x98.jpg?bfc943a9e5b64604e274263489fafa9f&quot;,&quot;url_medium&quot;:&quot;https://a.pololu-files.com/picture/0J7050.600x480.jpg?bfc943a9e5b64604e274263489fafa9f&quot;,&quot;url_full&quot;:&quot;https://a.pololu-files.com/picture/0J7050.1200.jpg?bfc943a9e5b64604e274263489fafa9f&quot;,&quot;longest_side&quot;:1200}]" data-picture-id="0J7050" data-picture-longest_side="1200" src="https://a.pololu-files.com/picture/0J7050.400.jpg?bfc943a9e5b64604e274263489fafa9f" /></a></td><p></tr><tr><th style="max-width: 400px"><p>Raspberry Pi robot using the A-Star 32U4 Robot Controller.</p></th></tr></table></p> <h4>General-purpose level shifters</h4> <p>In addition to the dedicated I²C level shifters, the A-Star board also makes available a few general-purpose level shifters that are not connected to any signals by default.</p> <p><strong>LS1</strong> is a dual-channel unidirectional level shifter that converts a pair of 5&nbsp;V inputs (<strong>HA</strong> and <strong>HB</strong>) to a pair of corresponding 3.3&nbsp;V outputs (<strong>LA</strong> and <strong>LB</strong>).</p> <table class="picture_with_caption center wide"><tr><td><img alt="" class="wide" data-gallery-pictures="[{&quot;id&quot;:&quot;0J6669&quot;,&quot;caption&quot;:&quot;\u003cp\u003eLevel shifter LS1 on the A-Star 32U4 Robot Controller LV with Raspberry Pi Bridge.\u003c/p\u003e&quot;,&quot;url_tiny&quot;:&quot;https://a.pololu-files.com/picture/0J6669.98x98.jpg?c2794fe3fa75f4d6b7d616be5b10082f&quot;,&quot;url_medium&quot;:&quot;https://a.pololu-files.com/picture/0J6669.600x480.jpg?c2794fe3fa75f4d6b7d616be5b10082f&quot;,&quot;url_full&quot;:&quot;https://a.pololu-files.com/picture/0J6669.1200.png?c2794fe3fa75f4d6b7d616be5b10082f&quot;,&quot;longest_side&quot;:600}]" data-picture-id="0J6669" data-picture-longest_side="600" src="https://a.pololu-files.com/picture/0J6669.600.png?c2794fe3fa75f4d6b7d616be5b10082f" /></td><p></tr></table></p> <p><strong>LS2</strong> and <strong>LS3</strong> are each single-channel, tristatable, unidirectional level shifters. Each of these exposes four pins: <strong><span class="overline">OE</span></strong> (output enable), <strong>IN</strong> (input), <strong>OUT</strong> (shifted output), and <strong>VCC</strong> (logic supply voltage).</p> <ul> <li>When <span class="overline">OE</span> is high, OUT is in a high impedance state.</li> <li>When <span class="overline">OE</span> is low, OUT matches the state of <strong>IN</strong>, shifted to the voltage supplied on VCC.</li> </ul><table class="picture_with_caption center wide"><tr><td><img alt="" class="wide" data-gallery-pictures="[{&quot;id&quot;:&quot;0J6670&quot;,&quot;caption&quot;:&quot;\u003cp\u003eLevel shifters LS2 and LS3 on the A-Star 32U4 Robot Controller LV with Raspberry Pi Bridge.\u003c/p\u003e&quot;,&quot;url_tiny&quot;:&quot;https://a.pololu-files.com/picture/0J6670.98x98.jpg?0792395c1285537913add443c259a3cc&quot;,&quot;url_medium&quot;:&quot;https://a.pololu-files.com/picture/0J6670.600x480.jpg?0792395c1285537913add443c259a3cc&quot;,&quot;url_full&quot;:&quot;https://a.pololu-files.com/picture/0J6670.1200.png?0792395c1285537913add443c259a3cc&quot;,&quot;longest_side&quot;:600}]" data-picture-id="0J6670" data-picture-longest_side="600" src="https://a.pololu-files.com/picture/0J6670.600.png?0792395c1285537913add443c259a3cc" /></td><p></tr></table></p> <p>For example, if you pull <span class="overline">OE</span> low, connect a 3.3&nbsp;V signal to IN, and connect 5V to VCC, the signal will be shifted to 5&nbsp;V logic level on OUT.</p> <p>The input logic level can be 1.8&nbsp;V to 5.5&nbsp;V, while VCC (and the output logic level) can be 3&nbsp;V to 5.5&nbsp;V. The IN signal can have either a lower or higher logic level than the VCC voltage: you could connect a 5&nbsp;V signal to IN and a 3.3&nbsp;V to VCC <em>or</em> a 3.3&nbsp;V signal to IN and a 5&nbsp;V to VCC.</p> <h4>Powering the Raspberry Pi from the robot controller</h4> <p>The robot controller will provide 5&nbsp;V power to an attached Raspberry Pi by default, and 3.3&nbsp;V from the Raspberry Pi will be used to supply some of the level shifters. See <a href="/docs/0J66/3.5">Section 3.5</a> for more details about how power is shared and can be controlled between the two boards.</p> <h4>ID EEPROM</h4> <p>The A-Star board includes a 32-kilobit (4096-byte) EEPROM that connects to the Raspberry Pi&#8217;s ID_SD and ID_SC pins. The EEPROM ships with its contents blank, but you can program it as an ID EEPROM in the format specified by the <a href="https://github.com/raspberrypi/hats">Raspberry Pi HAT specifications</a>, using the utilities provided there. When suitably programmed, the EEPROM can help the Raspberry Pi identify and configure itself to work with the add-on board.</p> <p>Write protection for the EEPROM can be enabled by using solder to bridge the surface-mount jumper labeled &#8220;WP&#8221; next to the EEPROM chip. (The EEPROM is not write-protected by default.)</p>

Related Products

A-Star 32U4 Robot Controller LV with Raspberry Pi Bridge (SMT Components Only)
A-Star 32U4 Robot Controller LV with Raspberry Pi Bridge
A-Star 32U4 Robot Controller SV with Raspberry Pi Bridge (SMT Components Only)
A-Star 32U4 Robot Controller SV with Raspberry Pi Bridge
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Menu
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors