<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Breadkout board | Learn with Edwin Robotics</title>
	<atom:link href="https://learn.edwinrobotics.com/tag/breadkout-board/feed/" rel="self" type="application/rss+xml" />
	<link>https://learn.edwinrobotics.com</link>
	<description>Tutorials on basics of electronics, etc.</description>
	<lastBuildDate>Sun, 26 Mar 2017 11:28:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
	<item>
		<title>MCP23S17 &#8211; Hook Up Guide</title>
		<link>https://learn.edwinrobotics.com/mcp23s17-hook-up-guide/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mcp23s17-hook-up-guide</link>
					<comments>https://learn.edwinrobotics.com/mcp23s17-hook-up-guide/#comments</comments>
		
		<dc:creator><![CDATA[emil]]></dc:creator>
		<pubDate>Sun, 26 Mar 2017 05:51:10 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Breadkout board]]></category>
		<category><![CDATA[MCP23S17]]></category>
		<category><![CDATA[Port Expander]]></category>
		<guid isPermaLink="false">http://learn.edwinrobotics.com/?p=1606</guid>

					<description><![CDATA[<img width="1500" height="1000" src="https://learn.edwinrobotics.com/wp-content/uploads/Feature-Image.jpg" class="attachment- size- wp-post-image" alt="" style="float:left; margin:0 15px 15px 0;" decoding="async" fetchpriority="high" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Feature-Image.jpg 1500w, https://learn.edwinrobotics.com/wp-content/uploads/Feature-Image-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Feature-Image-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/Feature-Image-1080x720.jpg 1080w, https://learn.edwinrobotics.com/wp-content/uploads/Feature-Image-140x94.jpg 140w" sizes="(max-width: 1500px) 100vw, 1500px" />Introduction The MCP23S17 is a SPI Based Port Expander which can add 16 more digital I/O pins to your Arduino or Raspberry Pi. Thanks to the wide operating voltage of 1.8 &#8211; 5.5V,  you can add 5V I/O pins to the Raspberry Pi or 3.3V based Arduino thereby avoiding a level shifter and simplifying connections. [&#8230;]]]></description>
										<content:encoded><![CDATA[<img width="1500" height="1000" src="https://learn.edwinrobotics.com/wp-content/uploads/Feature-Image.jpg" class="attachment- size- wp-post-image" alt="" style="float:left; margin:0 15px 15px 0;" decoding="async" loading="lazy" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Feature-Image.jpg 1500w, https://learn.edwinrobotics.com/wp-content/uploads/Feature-Image-300x200.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Feature-Image-1024x683.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/Feature-Image-1080x720.jpg 1080w, https://learn.edwinrobotics.com/wp-content/uploads/Feature-Image-140x94.jpg 140w" sizes="auto, (max-width: 1500px) 100vw, 1500px" /><h2>Introduction</h2>
<p>The MCP23S17 is a SPI Based Port Expander which can add 16 more digital I/O pins to your Arduino or Raspberry Pi. Thanks to the wide operating voltage of 1.8 &#8211; 5.5V,  you can add 5V I/O pins to the Raspberry Pi or 3.3V based Arduino thereby avoiding a level shifter and simplifying connections.</p>
<h2>Hardware Required:</h2>

<table id="tablepress-18" class="tablepress tablepress-id-18">
<tbody>
<tr class="row-1">
	<td class="column-1"><div id="attachment_1607" style="width: 160px" class="wp-caption alignleft"><a href="https://shop.edwinrobotics.com/breakout-boards/603-edwin-robotics-16-inputoutput-port-expander-breakout-mcp23s17.html" target="_blank"><img decoding="async" aria-describedby="caption-attachment-1607" class="wp-image-1607 size-thumbnail" src="http://learn.edwinrobotics.com/wp-content/uploads/Port-Expander-150x150.jpg" alt="MCP23S17 Port Expander" width="150" height="150" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Port-Expander-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/Port-Expander-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Port-Expander-184x184.jpg 184w, https://learn.edwinrobotics.com/wp-content/uploads/Port-Expander.jpg 940w" sizes="(max-width: 150px) 100vw, 150px" /></a><p id="caption-attachment-1607" class="wp-caption-text">MCP23S17 Port  Expander</p></div></td><td class="column-2"><div id="attachment_1609" style="width: 160px" class="wp-caption alignnone"><a href="https://shop.edwinrobotics.com/prototyping/40-breadboard.html"target="_blank"><img decoding="async" aria-describedby="caption-attachment-1609" src="http://learn.edwinrobotics.com/wp-content/uploads/breadboard.jpg" alt="Breadboard" width="150" height="50" class="size-full wp-image-1609" /></a><p id="caption-attachment-1609" class="wp-caption-text"></p><b><em> Breadboard</em></b></p></div></td><td class="column-3"><div id="attachment_1620" style="width: 160px" class="wp-caption alignleft"><a href="https://shop.edwinrobotics.com/34-wires" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1620" class="wp-image-1620 size-thumbnail" src="http://learn.edwinrobotics.com/wp-content/uploads/826-04-150x150.jpg" alt="Male - Female Jumper Wires" width="150" height="150" srcset="https://learn.edwinrobotics.com/wp-content/uploads/826-04-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/826-04-184x184.jpg 184w" sizes="auto, (max-width: 150px) 100vw, 150px" /></a><p id="caption-attachment-1620" class="wp-caption-text">Jumper Wires</p></div></td>
</tr>
</tbody>
</table>
<!-- #tablepress-18 from cache -->
<h2>Board Overview<a href="http://learn.edwinrobotics.com/wp-content/uploads/Port-Expander.jpg" target="_blank"><img loading="lazy" decoding="async" class="wp-image-1607 aligncenter" src="http://learn.edwinrobotics.com/wp-content/uploads/Port-Expander.jpg" alt="MCP23S17 Port Expander" width="500" height="500" srcset="https://learn.edwinrobotics.com/wp-content/uploads/Port-Expander.jpg 940w, https://learn.edwinrobotics.com/wp-content/uploads/Port-Expander-150x150.jpg 150w, https://learn.edwinrobotics.com/wp-content/uploads/Port-Expander-300x300.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/Port-Expander-184x184.jpg 184w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a></h2>
<p>The board consists of 2 Port Banks (A and B), a 3-way switch, power and SPI headers</p>
<p><strong>3-Way switch </strong>is used to set the address of the Port Expander, the switch positioned towards ON sets the address as &#8216;0&#8217;. The image above sets the address as &#8216;7&#8217;</p>
<p><strong>INT B </strong>Interrupt output for PortB</p>
<p><strong>B.0 &#8211; B.7</strong> Bidirectional I/O</p>
<p><strong>INT A </strong>Interrupt output for PortA</p>
<p><strong>A.0 &#8211; A.7</strong> Bidirectional I/O</p>
<p><strong>VCC</strong> Power supply pin for the MCP23S17, connect to a voltage source between 1.8V -5V</p>
<p><strong>GND </strong>connect to ground of power supply</p>
<p><strong>SO, SI, SCK &amp; CS </strong>SPI Pins</p>
<p><strong>RESET </strong>connect to ground to reset the port expander</p>
<p><span style="color: #ff0000;"><strong style="color: #ff0000;">Note: </strong>The silkscreen on Port A is reversed, meaning <strong style="color: #ff0000;">INT A</strong> actually is <strong style="color: #ff0000;">A.7</strong> and <strong style="color: #ff0000;">A.7</strong> actually is <strong style="color: #ff0000;">INT A</strong></span></p>
<p>&nbsp;</p>
<h2>Enabling SPI on the Raspberry Pi</h2>
<p>By default the SPI peripheral is not enabled, we cannot continue unless this is done first. Have a look at the tutorial by SparkFun on <strong><a href="https://learn.sparkfun.com/tutorials/raspberry-pi-spi-and-i2c-tutorial#spi-on-pi" target="_blank">how to do this.</a></strong></p>
<h2></h2>
<p>&nbsp;</p>
<h2>Interfacing the MCP23S17 Port Expander with the Raspberry Pi</h2>
<div id="attachment_1611" style="width: 510px" class="wp-caption aligncenter"><a href="http://learn.edwinrobotics.com/wp-content/uploads/RPi-to-MCP23S17.jpg" target="_blank"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1611" class="wp-image-1611" src="http://learn.edwinrobotics.com/wp-content/uploads/RPi-to-MCP23S17.jpg" alt="Connection Diagram for the MCP23S17 to the Raspberry Pi 3" width="500" height="356" srcset="https://learn.edwinrobotics.com/wp-content/uploads/RPi-to-MCP23S17.jpg 1389w, https://learn.edwinrobotics.com/wp-content/uploads/RPi-to-MCP23S17-300x213.jpg 300w, https://learn.edwinrobotics.com/wp-content/uploads/RPi-to-MCP23S17-1024x728.jpg 1024w, https://learn.edwinrobotics.com/wp-content/uploads/RPi-to-MCP23S17-400x284.jpg 400w, https://learn.edwinrobotics.com/wp-content/uploads/RPi-to-MCP23S17-1080x768.jpg 1080w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-1611" class="wp-caption-text">Interfacing the MCP23S17 to the Raspberry Pi</p></div>
<p>&nbsp;</p>
<h3>Connections from Raspberry Pi to MCP23S17 Port Expander</h3>

<table id="tablepress-14" class="tablepress tablepress-id-14">
<thead>
<tr class="row-1">
	<th class="column-1">MCP23S17 Pin</th><th class="column-2">Raspberry Pi GPIO Pin</th>
</tr>
</thead>
<tbody class="row-striping row-hover">
<tr class="row-2">
	<td class="column-1">VCC</td><td class="column-2">5V/3.3V</td>
</tr>
<tr class="row-3">
	<td class="column-1">GND</td><td class="column-2">GND</td>
</tr>
<tr class="row-4">
	<td class="column-1">SO</td><td class="column-2">SPI_MISO / GPIO9 / Pin 21</td>
</tr>
<tr class="row-5">
	<td class="column-1">SI</td><td class="column-2">SPI_MOSI / GPIO10 / Pin 19</td>
</tr>
<tr class="row-6">
	<td class="column-1">SCK</td><td class="column-2">SPI_CLK / GPIO11 /  Pin 23</td>
</tr>
<tr class="row-7">
	<td class="column-1">CS</td><td class="column-2">SPI_CE0_N / GPIO8 / Pin 24</td>
</tr>
</tbody>
</table>
<!-- #tablepress-14 from cache -->
<h3>Installing the Python Library</h3>
<p>In order to get started the python library needs to be installed first. Run the following command in terminal to install the library</p>
<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="mootwo">sudo pip install RPiMCP23S17</pre>
<p>&nbsp;</p>
<h3><strong>Sample Code</strong></h3>
<p>The below code will turn ON and OFF all the pins at an interval of 1 second.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="mootwo">from RPiMCP23S17.MCP23S17 import MCP23S17
import time

mcp = MCP23S17(bus=0x00, ce=0x00, deviceID=0x00)
mcp.open()

for x in range(0, 16):
    mcp.setDirection(x, mcp.DIR_OUTPUT)

print "Starting blinky on all pins (CTRL+C to quit)"
while (True):
    for x in range(0, 16):
        mcp.digitalWrite(x, MCP23S17.LEVEL_HIGH)
    time.sleep(1)
    for x in range(0, 16):
        mcp.digitalWrite(x, MCP23S17.LEVEL_LOW)
    time.sleep(1)</pre>
<h2>Further Reading</h2>
<p><a href="https://github.com/petrockblog/RPi-MCP23S17" target="_blank">RPiMCP23S17 Github Repo</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://learn.edwinrobotics.com/mcp23s17-hook-up-guide/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Object Caching 62/97 objects using APC
Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Database Caching 6/22 queries in 0.011 seconds using APC

Served from: learn.edwinrobotics.com @ 2025-08-14 22:30:22 by W3 Total Cache
-->