<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: Can I just ignore the &#039;NSS pin&#039;</title>
		<link>http://forums.leaflabs.com/topic.php?id=11962</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:08:02 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=11962" rel="self" type="application/rss+xml" />

		<item>
			<title>joyzhou on "Can I just ignore the &#039;NSS pin&#039;"</title>
			<link>http://forums.leaflabs.com/topic.php?id=11962#post-26734</link>
			<pubDate>Fri, 14 Jun 2013 05:35:42 +0000</pubDate>
			<dc:creator>joyzhou</dc:creator>
			<guid isPermaLink="false">26734@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;higwoshy and robodude666:&#60;br /&#62;
Thank you very much for the help!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>robodude666 on "Can I just ignore the &#039;NSS pin&#039;"</title>
			<link>http://forums.leaflabs.com/topic.php?id=11962#post-26569</link>
			<pubDate>Sat, 08 Jun 2013 11:15:46 +0000</pubDate>
			<dc:creator>robodude666</dc:creator>
			<guid isPermaLink="false">26569@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;&#60;code&#62;spi_gpio_cfg&#60;/code&#62; gives you the option to set the pins as input/output that you plan to use for the SPI port. While each SPI Bus has its own NSS pin associated with it, you need to manually toggle the pin yourself before/after read/writes. Because of this, this function gives you the option to define the NSS bit on a different GPIO port than the SPI bus. &#60;/p&#62;
&#60;p&#62;If you're looking for a more all-in-one solution, that does everything for you take a look at the &#60;a href=&#34;http://leaflabs.com/docs/lang/api/hardwarespi.html#lang-hardwarespi&#34;&#62;HardwareSPI&#60;/a&#62; class. It still doesn't handle NSS toggling, but it configures the correct GPIOs for each SPI bus.&#60;/p&#62;
&#60;p&#62;For your questions:&#60;/p&#62;
&#60;p&#62;1. spi.h defines hardware spi.&#60;/p&#62;
&#60;p&#62;2. You can use any NSS pin you want as the chip select. libmaple and MapleIDE don't toggle it for you, so it doesn't care which you pick. Neither does HardwareSPI.&#60;/p&#62;
&#60;p&#62;3.  If you want. All &#60;code&#62;spi_gpio_cfg&#60;/code&#62; does is call &#60;code&#62;gpio_set_mode&#60;/code&#62;, which is just a lower-level version of &#60;code&#62;pinMode&#60;/code&#62;. It's better to use&#60;code&#62;spi_gpio_cfg&#60;/code&#62; as it sets the output mode based on master/slave and sets the mode correctly. If you know what you're doing,  you can make the calls yourself.&#60;/p&#62;
&#60;p&#62;-robodude666
&#60;/p&#62;</description>
		</item>
		<item>
			<title>higwoshy on "Can I just ignore the &#039;NSS pin&#039;"</title>
			<link>http://forums.leaflabs.com/topic.php?id=11962#post-26564</link>
			<pubDate>Sat, 08 Jun 2013 07:16:46 +0000</pubDate>
			<dc:creator>higwoshy</dc:creator>
			<guid isPermaLink="false">26564@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Have you tried the HardWireSpi library? It makes it easier. It's built in (I think)&#60;/p&#62;
&#60;p&#62;I seem to recall that NSS is basically a chip select pin, and you can use any pin you want - well using hardwarespi you can anyway. If you have two identical chips, you can use the same code to get data from them, just pull the NSS/CS pin low (and the other chip CS back to high!) to select which chip you want. Try not to read from two chips at the same time:)&#60;/p&#62;
&#60;p&#62;If you have a 16bit SPI, just use two 8 bit writes.&#60;/p&#62;
&#60;p&#62;HTH
&#60;/p&#62;</description>
		</item>
		<item>
			<title>joyzhou on "Can I just ignore the &#039;NSS pin&#039;"</title>
			<link>http://forums.leaflabs.com/topic.php?id=11962#post-26509</link>
			<pubDate>Fri, 07 Jun 2013 03:43:53 +0000</pubDate>
			<dc:creator>joyzhou</dc:creator>
			<guid isPermaLink="false">26509@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi, guys.&#60;/p&#62;
&#60;p&#62;Here is the document on &#38;lt;spi.h&#38;gt;&#60;br /&#62;
&#60;a href=&#34;http://leaflabs.com/docs/libmaple/api/spi.html&#34; rel=&#34;nofollow&#34;&#62;http://leaflabs.com/docs/libmaple/api/spi.html&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;When I call this function:&#60;/p&#62;
&#60;p&#62;void spi_gpio_cfg(uint8 as_master, gpio_dev * nss_dev, uint8 nss_bit, gpio_dev * comm_dev, uint8 sck_bit, uint8 miso_bit, uint8 mosi_bit)&#60;/p&#62;
&#60;p&#62;'nss_dev' and 'nss_bit' will specify a certain pin for SS,&#60;br /&#62;
'comm_dev', 'sck_bit', 'miso_bit', 'mosi_bit' will specify pins for SCK, MOSI, and MISO.&#60;/p&#62;
&#60;p&#62;My question:&#60;br /&#62;
1. Does this mean &#38;lt;spi.h&#38;gt; provides * software spi* ?&#60;br /&#62;
For a hardware spi, SCK, MOSI, MISO should not have too nuch choices.&#60;br /&#62;
2. May I just ignore the NSS pin, and set other pins for SS?&#60;br /&#62;
VS1003B needs 2 pins, one for command SS and one for data SS.&#60;br /&#62;
3. May I use pinMode(...) for the SCK, MISO, MOSI pins?&#60;br /&#62;
Or, the only way to set them is to use functions provided by &#38;lt;gpio.h&#38;gt;?&#60;br /&#62;
Or, it is not necessary to do so?&#60;/p&#62;
&#60;p&#62;Thank you very much!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
