<?xml version="1.0" encoding="UTF-8"?><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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using SPI on an AVR (1)</title>
	<atom:link href="http://www.rocketnumbernine.com/2009/04/26/using-spi-on-an-avr-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rocketnumbernine.com/2009/04/26/using-spi-on-an-avr-1/</link>
	<description>Andrew&#039;s Project Blog - hardware, software, things</description>
	<lastBuildDate>Tue, 31 Aug 2010 07:51:52 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: andrew</title>
		<link>http://www.rocketnumbernine.com/2009/04/26/using-spi-on-an-avr-1/comment-page-1/#comment-167</link>
		<dc:creator>andrew</dc:creator>
		<pubDate>Thu, 08 Jul 2010 17:04:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.rocketnumbernine.com/?p=124#comment-167</guid>
		<description>Atmel datasheet states that max SPI rate is clock/2 in master mode and clock/4 in slave. So in theory yes if run at 16MHz.  But do any of the ATtiny chips have hardware SPI built in?</description>
		<content:encoded><![CDATA[<p>Atmel datasheet states that max SPI rate is clock/2 in master mode and clock/4 in slave. So in theory yes if run at 16MHz.  But do any of the ATtiny chips have hardware SPI built in?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udi</title>
		<link>http://www.rocketnumbernine.com/2009/04/26/using-spi-on-an-avr-1/comment-page-1/#comment-166</link>
		<dc:creator>udi</dc:creator>
		<pubDate>Thu, 08 Jul 2010 13:42:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.rocketnumbernine.com/?p=124#comment-166</guid>
		<description>Hi All,
Can anyone state what is the fastest SPI clock you&#039;ve reached with ATtiny?
I need a super low power solution with 8MHz SPI. is this doable ?
uDi</description>
		<content:encoded><![CDATA[<p>Hi All,<br />
Can anyone state what is the fastest SPI clock you&#8217;ve reached with ATtiny?<br />
I need a super low power solution with 8MHz SPI. is this doable ?<br />
uDi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andrew</title>
		<link>http://www.rocketnumbernine.com/2009/04/26/using-spi-on-an-avr-1/comment-page-1/#comment-151</link>
		<dc:creator>andrew</dc:creator>
		<pubDate>Sun, 16 May 2010 08:46:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.rocketnumbernine.com/?p=124#comment-151</guid>
		<description>ahh yes, typo - I&#039;ll fix in the page.  It wouldn&#039;t make any difference in the example above but would if multiple devices were on the same SPI bus.</description>
		<content:encoded><![CDATA[<p>ahh yes, typo &#8211; I&#8217;ll fix in the page.  It wouldn&#8217;t make any difference in the example above but would if multiple devices were on the same SPI bus.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sony</title>
		<link>http://www.rocketnumbernine.com/2009/04/26/using-spi-on-an-avr-1/comment-page-1/#comment-150</link>
		<dc:creator>Sony</dc:creator>
		<pubDate>Sun, 16 May 2010 08:14:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.rocketnumbernine.com/?p=124#comment-150</guid>
		<description>I know that but turn on MCP3201 twice. In main before you setup SPI and again
when you read_adc. Confusing.
Moreover in that code different. Why?
http://code.google.com/p/rocketnumbernine/source/browse/trunk/AVR/spi/Arduino/SPI/examples/MCP3201_ADC/MCP3201_ADC.pde</description>
		<content:encoded><![CDATA[<p>I know that but turn on MCP3201 twice. In main before you setup SPI and again<br />
when you read_adc. Confusing.<br />
Moreover in that code different. Why?<br />
<a href="http://code.google.com/p/rocketnumbernine/source/browse/trunk/AVR/spi/Arduino/SPI/examples/MCP3201_ADC/MCP3201_ADC.pde" rel="nofollow">http://code.google.com/p/rocketnumbernine/source/browse/trunk/AVR/spi/Arduino/SPI/examples/MCP3201_ADC/MCP3201_ADC.pde</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andrew</title>
		<link>http://www.rocketnumbernine.com/2009/04/26/using-spi-on-an-avr-1/comment-page-1/#comment-149</link>
		<dc:creator>andrew</dc:creator>
		<pubDate>Sat, 15 May 2010 20:14:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.rocketnumbernine.com/?p=124#comment-149</guid>
		<description>The  MCP3201 requires a low value on its chip select pin to select the device.  SELECT_ADC sets the pin (connected to PB4) to 0:
#define SELECT_ADC PORTB &amp;= ~(1&lt;&lt;PB4)

Hope that makes sense.
Andrew</description>
		<content:encoded><![CDATA[<p>The  MCP3201 requires a low value on its chip select pin to select the device.  SELECT_ADC sets the pin (connected to PB4) to 0:<br />
#define SELECT_ADC PORTB &#038;= ~(1<<PB4)</p>
<p>Hope that makes sense.<br />
Andrew</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sony</title>
		<link>http://www.rocketnumbernine.com/2009/04/26/using-spi-on-an-avr-1/comment-page-1/#comment-148</link>
		<dc:creator>Sony</dc:creator>
		<pubDate>Sat, 15 May 2010 18:27:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.rocketnumbernine.com/?p=124#comment-148</guid>
		<description>Hello, 

&quot;
// make sure ADC is unselected and setup spi
  SELECT_ADC; &quot;

Why do you have &quot;SELECT_ADC&quot;?
I think that &quot;DESELCT_ADC&quot; is correct?
If i am wrong explain me it please.
Regards,
Sony</description>
		<content:encoded><![CDATA[<p>Hello, </p>
<p>&#8221;<br />
// make sure ADC is unselected and setup spi<br />
  SELECT_ADC; &#8221;</p>
<p>Why do you have &#8220;SELECT_ADC&#8221;?<br />
I think that &#8220;DESELCT_ADC&#8221; is correct?<br />
If i am wrong explain me it please.<br />
Regards,<br />
Sony</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andrew</title>
		<link>http://www.rocketnumbernine.com/2009/04/26/using-spi-on-an-avr-1/comment-page-1/#comment-147</link>
		<dc:creator>andrew</dc:creator>
		<pubDate>Mon, 03 May 2010 15:14:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.rocketnumbernine.com/?p=124#comment-147</guid>
		<description>The left shift operator shifts the entire bit pattern on the left of the operand (0x1F &amp; one) by the number on the right (7), filling with zeros.  As were shifting into a 2 byte variable we&#039;ll end  up with 0000A1A2A3A4 A50000000.
regards
Andrew</description>
		<content:encoded><![CDATA[<p>The left shift operator shifts the entire bit pattern on the left of the operand (0&#215;1F &#038; one) by the number on the right (7), filling with zeros.  As were shifting into a 2 byte variable we&#8217;ll end  up with 0000A1A2A3A4 A50000000.<br />
regards<br />
Andrew</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sony</title>
		<link>http://www.rocketnumbernine.com/2009/04/26/using-spi-on-an-avr-1/comment-page-1/#comment-146</link>
		<dc:creator>Sony</dc:creator>
		<pubDate>Mon, 03 May 2010 10:01:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.rocketnumbernine.com/?p=124#comment-146</guid>
		<description>Thanks for the quick replay but i have another question:

&quot;((0×1F &amp; one) &lt;&lt; 7) &quot;

for example as you mention we have:

(0×1F &amp; one) = 000A1A2A3A4A5 (A1..A5 single bit).
When you shift left everything 7 bit you get this:

A5000A1A2A3A4?</description>
		<content:encoded><![CDATA[<p>Thanks for the quick replay but i have another question:</p>
<p>&#8220;((0×1F &amp; one) &lt;&lt; 7) &quot;</p>
<p>for example as you mention we have:</p>
<p>(0×1F &amp; one) = 000A1A2A3A4A5 (A1..A5 single bit).<br />
When you shift left everything 7 bit you get this:</p>
<p>A5000A1A2A3A4?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andrew</title>
		<link>http://www.rocketnumbernine.com/2009/04/26/using-spi-on-an-avr-1/comment-page-1/#comment-145</link>
		<dc:creator>andrew</dc:creator>
		<pubDate>Mon, 03 May 2010 07:46:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.rocketnumbernine.com/?p=124#comment-145</guid>
		<description>You&#039;re right the _delays are not required - they were just added to simplify observation with a logic analyzer, the example Arduino Sketch that&#039;s shiped with SPI library doesn&#039;t include them - see &lt;a href=&quot;http://code.google.com/p/rocketnumbernine/source/browse/trunk/AVR/spi/Arduino/SPI/examples/MCP3201_ADC/MCP3201_ADC.pde&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>You&#8217;re right the _delays are not required &#8211; they were just added to simplify observation with a logic analyzer, the example Arduino Sketch that&#8217;s shiped with SPI library doesn&#8217;t include them &#8211; see <a href="http://code.google.com/p/rocketnumbernine/source/browse/trunk/AVR/spi/Arduino/SPI/examples/MCP3201_ADC/MCP3201_ADC.pde" rel="nofollow">here</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sony</title>
		<link>http://www.rocketnumbernine.com/2009/04/26/using-spi-on-an-avr-1/comment-page-1/#comment-143</link>
		<dc:creator>Sony</dc:creator>
		<pubDate>Sun, 02 May 2010 21:42:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.rocketnumbernine.com/?p=124#comment-143</guid>
		<description>Hello,

i have  3 question about time delay in your program.

1) in function read_adc()
after you power on adc you have:
_delay_us(100)
why so long? 3)  in datasheet CS disable time is 625 ns so 1us delay wiil be enough?

2)
&quot;  unsigned char one = send_spi(0xFF);
  _delay_us(100);&quot;

why you delay after you send first byte?;&gt;

3)

&quot;    PORTD = (1&lt;&gt; 9));  // use the top 3 bytes to turn on LED
    _delay_ms(1);&quot;

_delay_ms(1) - what for is that delay?

My English is not very good but i hope that you understand me.

Regards,
Sony</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>i have  3 question about time delay in your program.</p>
<p>1) in function read_adc()<br />
after you power on adc you have:<br />
_delay_us(100)<br />
why so long? 3)  in datasheet CS disable time is 625 ns so 1us delay wiil be enough?</p>
<p>2)<br />
&#8221;  unsigned char one = send_spi(0xFF);<br />
  _delay_us(100);&#8221;</p>
<p>why you delay after you send first byte?;&gt;</p>
<p>3)</p>
<p>&#8221;    PORTD = (1&lt;&gt; 9));  // use the top 3 bytes to turn on LED<br />
    _delay_ms(1);&#8221;</p>
<p>_delay_ms(1) &#8211; what for is that delay?</p>
<p>My English is not very good but i hope that you understand me.</p>
<p>Regards,<br />
Sony</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 4.075 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-09-06 14:11:44 -->
