<?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: A little help with SPI</title>
		<link>http://forums.leaflabs.com/topic.php?id=1542</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:08:10 +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=1542" rel="self" type="application/rss+xml" />

		<item>
			<title>higwoshy on "A little help with SPI"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1542#post-10152</link>
			<pubDate>Mon, 09 Apr 2012 07:18:42 +0000</pubDate>
			<dc:creator>higwoshy</dc:creator>
			<guid isPermaLink="false">10152@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thanks, I'll give it a go. Off to ebay...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>crenn on "A little help with SPI"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1542#post-10151</link>
			<pubDate>Mon, 09 Apr 2012 06:56:53 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">10151@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;That is correctly, usually you need to pull a CS line low (there might be devices where you need to pull it high) to select the device.&#60;/p&#62;
&#60;p&#62;Technically it is possible, however some devices will not set their output to high impedance (which is important) when the device is not selected, there are ways around this. You can switch between mode and frequencies between devices, but you need to remember to set it before selecting each device, however having the same mode and frequency makes it easier.&#60;/p&#62;
&#60;p&#62;It's been a while since I last used the Hardware SPI library, but I do believe that is correct.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>higwoshy on "A little help with SPI"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1542#post-10149</link>
			<pubDate>Mon, 09 Apr 2012 06:39:54 +0000</pubDate>
			<dc:creator>higwoshy</dc:creator>
			<guid isPermaLink="false">10149@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I'm thinking of buying a MCP4922 which is a dual 12bit DAC with an SPI interface and not having much experience of SPI apart from using it in various libraries I need a bit of hand holding before I get started.&#60;/p&#62;
&#60;p&#62;Some simple (hopefully) questions.&#60;/p&#62;
&#60;p&#62;As far as I can tell the HardwareSPI library doesn't setup the CS pin itself, that needs to be done before calling &#60;code&#62;write&#60;/code&#62; - is that correct? &#60;/p&#62;
&#60;p&#62;Therefore I assume the two SPI lines (MISO/MOSI or SDI/SDO) can be shared between devices? I am currently using SPI_2 for a SD card and SPI_1 for a RF2401 transceiver. If I share the SPI lines between the SD card and the DAC and use a separate CS pin for each device to select will I run into problems, assuming they use the same &#60;code&#62;mode&#60;/code&#62; and clock frequency?&#60;/p&#62;
&#60;p&#62;The 4922 needs a 16bit word sent (4bits control, 12bits data)- will that be a problem with the maple which only sends a byte at a time. I'm assuming I just use the multi-byte &#60;code&#62;write&#60;/code&#62; command. Something like the code below should work?&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;uint16 fred = ccccdddddddddddd;  // (bits:c=control, d=data)
	digitalWrite( MCP4922A_CS, HIGH); // or low if it&#38;#39;s _CS...
	spi.write( (uint8 *) &#38;amp;fred, 2);
	digitalWrite( MCP4922A_CS, LOW);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I just need to know if I'm on more or less the right path before I purchase.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
