<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Games Creators Club PiWars Blog (Posts about hub controller)</title><link>http://piwars.raspberrypilot.com/</link><description></description><atom:link type="application/rss+xml" rel="self" href="http://piwars.raspberrypilot.com/categories/hub-controller.xml"></atom:link><language>en</language><copyright>Contents © 2019 &lt;a href="mailto:edward@raspberrypilot.com"&gt;GCC&lt;/a&gt; </copyright><lastBuildDate>Sun, 20 Jan 2019 18:20:07 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>i²c Multiplexer</title><link>http://piwars.raspberrypilot.com/posts/2018/12/10/i2c-multiplexer/</link><dc:creator>Daniel Sendula</dc:creator><description>&lt;div&gt;&lt;h2&gt;i²c Multiplexer&lt;/h2&gt;
&lt;p&gt;For steering wheels we need 4 x AS5600 and, unfortunately, AS5600 only has one i²c address and it cannot be moved. So the only way to overcome this problem is to introduce an i²c multiplexer - a chip to allow splitting of i²c bus to many sub-buses. For this we chose PCA9545A, a 4 way multiplexer. But they don't make it in DIP packages as well and 24 pin adapter was in order, too.&lt;/p&gt;
&lt;p&gt;But, 4 way multiplexer has quite a few wires, especially if we want to use each sub-bus several times. For instance, on each sub-bust we can put two VL53L1X with only one extra GPIO (to discriminate between two VL53L1X sensors in setup). That would mean that from this tiny chip we would need to draw 5 (GND, VCC, SDA, SCL, GPIO) x 3 (2 x VL53L1X and AS5600) x 4 (4 sub-buses) + another 5 (GND, VCC, SDA, SCL, GPIO - connection to main bus) lines. 64 in total! OK, we can omit 4 x GPIO to AS5600 but that's pretty much it. Here's what we did to alleviate situation:&lt;/p&gt;
&lt;p&gt;&lt;img : alt="Step 1" src="http://piwars.raspberrypilot.com/2018/12/i2c-multiplexer-2.jpg" style="width:100%;" title="Step 1"&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://piwars.raspberrypilot.com/posts/2018/12/10/i2c-multiplexer/"&gt;Read more…&lt;/a&gt; (3 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>Blog</category><category>Home</category><category>hub controller</category><category>i2c</category><category>i2c multiplexer</category><category>multiplexer</category><category>piwars</category><guid>http://piwars.raspberrypilot.com/posts/2018/12/10/i2c-multiplexer/</guid><pubDate>Mon, 10 Dec 2018 21:43:00 GMT</pubDate></item><item><title>Hub Controller</title><link>http://piwars.raspberrypilot.com/posts/2018/12/01/hub-controller/</link><dc:creator>Daniel Sendula</dc:creator><description>&lt;div&gt;&lt;h2&gt;Hub Controller&lt;/h2&gt;
&lt;p&gt;Now we have sorted out getting power inside of wheel hub - next is to control the wheel. The wheel needs to know should it spin, which direction, which speed or if it should stop. Also, since we opted for &lt;a href="https://ams.com/as5600"&gt;AS5600 (12-bit Programmable Contactless Potentiometer)&lt;/a&gt; for a 'rotary encoder' we would like to have the position of each wheel reported back to the RPi.&lt;/p&gt;
&lt;p&gt;For the  brain behind the controller we have chosen ATmega328p - a well known µController used in Arduinos. Its responsibility here is to the control H bridge using PWM (using 8-bin Timer 0), read from AS5600 using i²c and listens requests from Raspberry Pi - controlling nRF24L01 using SPI interface. &lt;/p&gt;
&lt;p&gt;&lt;img : alt="Diagram" src="http://piwars.raspberrypilot.com/2018/12/wheels-diagram.jpg" style="width:100%;" title="Diagram"&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://piwars.raspberrypilot.com/posts/2018/12/01/hub-controller/"&gt;Read more…&lt;/a&gt; (7 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>Blog</category><category>Home</category><category>hub controller</category><category>piwars</category><guid>http://piwars.raspberrypilot.com/posts/2018/12/01/hub-controller/</guid><pubDate>Sat, 01 Dec 2018 11:12:00 GMT</pubDate></item></channel></rss>