<?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: L9822 solenoid 8bit spi driver</title>
		<link>http://forums.leaflabs.com/topic.php?id=12403</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:17:32 +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=12403" rel="self" type="application/rss+xml" />

		<item>
			<title>gbulmer on "L9822 solenoid 8bit spi driver"</title>
			<link>http://forums.leaflabs.com/topic.php?id=12403#post-27163</link>
			<pubDate>Sat, 22 Jun 2013 16:12:34 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">27163@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;stephanschulz - It might be helpful to add that that device appears to like a nominal 5V power supply.&#60;br /&#62;
At that voltage, its spec says its input pins would like a minimum of 0.7*5V  = 3.5V.&#60;br /&#62;
It's signal pins could be driven directly at a slightly lower voltage, e.g. a Maple output pin. Certainly try it, but it might be a bit sensitive to electrical noise.&#60;/p&#62;
&#60;p&#62;So the pins could be driven by 5V tolerant pins, using pull-up resistors to reach 5V, and set up with pinMode OUTPUT_OPEN_DRAIN.&#60;br /&#62;
AFAICT, the SPI input signals need to rise and fall reasonably quickly (i.e. 200ns), so relatively small pull-up resistors would be needed.&#60;/p&#62;
&#60;p&#62;Some of the Maple SPI pins are &#60;strong&#62;not&#60;/strong&#62; 5V tolerant.&#60;br /&#62;
So, for example D11 (SPI MOSI) and D13 (SPI SCK) are not 5V tolerant, and if they have a bit of a problem driving that chip directly, they couldn't be pulled up to 5V with pull-up resistors.&#60;br /&#62;
D32 (SCK) and D34 (MOSI) might be better because they are 5V tolerant, so you could try directly driving L9822 pins, or using pull-up resistors.&#60;/p&#62;
&#60;p&#62;It looks like all the SPI signals need have 'slower' rise time, or fall time than 200ns.&#60;br /&#62;
The Maple GPIOs are normally set up for a 50MHz rise/fall, so if there are problems, it might be worth having a look at &#60;code&#62;gpio_set_mode&#60;/code&#62; and setting the rise/fall time a bit slower.&#60;br /&#62;
For example &#60;code&#62;GPIO_CR_CNF_OUTPUT_OD &#124; GPIO_CR_MODE_OUTPUT_10MHZ&#60;/code&#62; or even &#60;code&#62;&#60;/code&#62;GPIO_CR_CNF_OUTPUT_OD &#124; GPIO_CR_MODE_OUTPUT_2MHZ`&#60;br /&#62;
WARNING: I've never tried this!&#60;/p&#62;
&#60;p&#62;The L9822 looks very tolerant to being driven at low speed. AFAICT, it has no lower speed.&#60;br /&#62;
So you could write a simple 'shift_out' function using two digital pins, and just setting them with digitalWrite. This might be useful if you haven't got an oscilloscope, or have problems with SPI. Using a 'soft-SPI' would allow the bits to be written so slowly that LEDs could be wired up the the soft-SPI-equivalent signals, or &#60;code&#62;print/println&#60;/code&#62; could be used, and you could see what is happening. The pins would be set up for pinMode OUTPUT_OPEN_DRAIN.&#60;/p&#62;
&#60;p&#62;A small aside; that chip could be 'emulates' using an ordinary, cheap 8bit SIPO shift register ($0.50) driving LEDs. Judicous choice of part would work at 3.3V too, so you could do software development and testing without a 5V power supply.&#60;/p&#62;
&#60;p&#62;Tiny aside: the L9822 is listed as obsolete e.g. a Mouser, but the L9822E is active, so I assume that's the part about to be used.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mlundinse on "L9822 solenoid 8bit spi driver"</title>
			<link>http://forums.leaflabs.com/topic.php?id=12403#post-27123</link>
			<pubDate>Fri, 21 Jun 2013 13:10:49 +0000</pubDate>
			<dc:creator>mlundinse</dc:creator>
			<guid isPermaLink="false">27123@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Its all in the datasheet so its good to practice how to read them, sure&#60;br /&#62;
they can be anything from clear  and easy to understand to completly confusing&#60;br /&#62;
and filled with errors.&#60;/p&#62;
&#60;p&#62;You will not be sure until you have tried it out, but from what I can see&#60;br /&#62;
it is MSB, clock idling low, data capture on first clock transition, that would be&#60;br /&#62;
Spi Mode 0, and max clock frequency of 2MHz. &#60;/p&#62;
&#60;p&#62;The maximumum clock frequency also depends upon the amount of noise in the system&#60;br /&#62;
and length and capacitance of connecting leads. So start with a low clock and&#60;br /&#62;
increase it. If you have an oscilloscope you can watch the waveforms as you increase&#60;br /&#62;
spi clock frequency.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stephanschulz on "L9822 solenoid 8bit spi driver"</title>
			<link>http://forums.leaflabs.com/topic.php?id=12403#post-27113</link>
			<pubDate>Fri, 21 Jun 2013 09:23:08 +0000</pubDate>
			<dc:creator>stephanschulz</dc:creator>
			<guid isPermaLink="false">27113@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;i am planning to use this smart solenoid driver &#60;a href=&#34;http://www.st.com/web/en/resource/technical/document/datasheet/CD00000110.pdf&#34; rel=&#34;nofollow&#34;&#62;http://www.st.com/web/en/resource/technical/document/datasheet/CD00000110.pdf&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;but i am uncertain how to use the maple's spi library to communicate with this chip&#60;/p&#62;
&#60;p&#62;can anyone take a look at the documentation and tell me which mhz, which mode etc to select?&#60;/p&#62;
&#60;p&#62;thanks so much.&#60;br /&#62;
stephan
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
