<?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: MCP2210 Library</title>
	<atom:link href="http://www.kerrywong.com/2012/09/27/mcp2210-library/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kerrywong.com/2012/09/27/mcp2210-library/</link>
	<description></description>
	<lastBuildDate>Sat, 18 May 2013 10:55:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Edgardo</title>
		<link>http://www.kerrywong.com/2012/09/27/mcp2210-library/comment-page-1/#comment-203308</link>
		<dc:creator>Edgardo</dc:creator>
		<pubDate>Tue, 07 May 2013 20:43:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrywong.com/?p=6830#comment-203308</guid>
		<description><![CDATA[Kerry, In your example you are toogling the GPIO0, but you are keeping track of the status of the GPIO. 
When you do:  def.GP[0].GPIOOutput = 1-def.GP[0].GPIOOutput; , def.GP[0].GPIOOutput is in the memory of your computer, not in the output register of the MCP2210.
I think Vic is trying to use the GPIO as both input and output at the same time. If you set the levels of the GPIO, there is no need to read them back (you just set the level yourself). If the GPIO is defined as input, then setting levels have no meaning since the level is forced by an external voltage.
So if the pin is Output, you can set the levels (to GND or VCC) but you probably wont be able to read the voltage (I should check the datasheet to see if it returns the flipflop value for the output bit).
If the pin is Input, there is no way of setting the voltage.

I wonder if the MCP2210 supports Open Colector output.

Best Regards]]></description>
		<content:encoded><![CDATA[<p>Kerry, In your example you are toogling the GPIO0, but you are keeping track of the status of the GPIO.<br />
When you do:  def.GP[0].GPIOOutput = 1-def.GP[0].GPIOOutput; , def.GP[0].GPIOOutput is in the memory of your computer, not in the output register of the MCP2210.<br />
I think Vic is trying to use the GPIO as both input and output at the same time. If you set the levels of the GPIO, there is no need to read them back (you just set the level yourself). If the GPIO is defined as input, then setting levels have no meaning since the level is forced by an external voltage.<br />
So if the pin is Output, you can set the levels (to GND or VCC) but you probably wont be able to read the voltage (I should check the datasheet to see if it returns the flipflop value for the output bit).<br />
If the pin is Input, there is no way of setting the voltage.</p>
<p>I wonder if the MCP2210 supports Open Colector output.</p>
<p>Best Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kwong</title>
		<link>http://www.kerrywong.com/2012/09/27/mcp2210-library/comment-page-1/#comment-203139</link>
		<dc:creator>kwong</dc:creator>
		<pubDate>Wed, 01 May 2013 18:09:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrywong.com/?p=6830#comment-203139</guid>
		<description><![CDATA[Hi Vic,

Could you give the example in this post a try? I used it to toggle GPIO0 and it worked fine. Did you try configure each individual pins separately? If you could post your code I can give it a try when I get back tonight.]]></description>
		<content:encoded><![CDATA[<p>Hi Vic,</p>
<p>Could you give the example in this post a try? I used it to toggle GPIO0 and it worked fine. Did you try configure each individual pins separately? If you could post your code I can give it a try when I get back tonight.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vic</title>
		<link>http://www.kerrywong.com/2012/09/27/mcp2210-library/comment-page-1/#comment-203138</link>
		<dc:creator>Vic</dc:creator>
		<pubDate>Wed, 01 May 2013 17:58:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrywong.com/?p=6830#comment-203138</guid>
		<description><![CDATA[Hi Kerry,

Once configured for CS, GPIO pins function extremely well for their intended purpose of serving SPI slaves.  However, standalone GPIO control for individual pins seems not to work!  I first read GET levels, assert a pin level, write SET levels, and read back GET levels for final confirmation and comparison.  However, the MCP2210 never responds correctly, even if I configure the device with Microchip&#039;s own utility.  Is this chip not intended for general purpose GPIO&#039;s, but specifically for SPI slaves or alternate functions?  Microchip documentation points in that direction, and their demo kit seems to fit that model also, since they SPI slave an EEPROM, Temp Sensor, IO Expansion, and A/D.  

Thank you, and best regards,
Vic]]></description>
		<content:encoded><![CDATA[<p>Hi Kerry,</p>
<p>Once configured for CS, GPIO pins function extremely well for their intended purpose of serving SPI slaves.  However, standalone GPIO control for individual pins seems not to work!  I first read GET levels, assert a pin level, write SET levels, and read back GET levels for final confirmation and comparison.  However, the MCP2210 never responds correctly, even if I configure the device with Microchip&#8217;s own utility.  Is this chip not intended for general purpose GPIO&#8217;s, but specifically for SPI slaves or alternate functions?  Microchip documentation points in that direction, and their demo kit seems to fit that model also, since they SPI slave an EEPROM, Temp Sensor, IO Expansion, and A/D.  </p>
<p>Thank you, and best regards,<br />
Vic</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kwong</title>
		<link>http://www.kerrywong.com/2012/09/27/mcp2210-library/comment-page-1/#comment-202644</link>
		<dc:creator>kwong</dc:creator>
		<pubDate>Tue, 23 Apr 2013 12:27:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrywong.com/?p=6830#comment-202644</guid>
		<description><![CDATA[Since Signal11&#039;s hidapi works in either Linux or Windows, technically speaking this library can be recompiled to work under Windows as well. But I have not tried it myself.]]></description>
		<content:encoded><![CDATA[<p>Since Signal11&#8242;s hidapi works in either Linux or Windows, technically speaking this library can be recompiled to work under Windows as well. But I have not tried it myself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rossi Eugenio</title>
		<link>http://www.kerrywong.com/2012/09/27/mcp2210-library/comment-page-1/#comment-202631</link>
		<dc:creator>Rossi Eugenio</dc:creator>
		<pubDate>Tue, 23 Apr 2013 07:33:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrywong.com/?p=6830#comment-202631</guid>
		<description><![CDATA[Can  I have all this information, with the operating system windows, xp, 7 ..?]]></description>
		<content:encoded><![CDATA[<p>Can  I have all this information, with the operating system windows, xp, 7 ..?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kwong</title>
		<link>http://www.kerrywong.com/2012/09/27/mcp2210-library/comment-page-1/#comment-202349</link>
		<dc:creator>kwong</dc:creator>
		<pubDate>Wed, 17 Apr 2013 23:21:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrywong.com/?p=6830#comment-202349</guid>
		<description><![CDATA[Hi Vic,

Thanks for your comments. The way MCP2210 works is that once you have designated a pin as CS, it will automatically select/deselect when you issue SPI command. You can see this in my example here (http://www.kerrywong.com/2012/10/22/mcp2210-library-mcp3204-spi-adc/)

....
    //chip select is GP1
    def.ActiveChipSelectValue = 0xfffd;
    def.IdleChipSelectValue = 0xffff;
....]]></description>
		<content:encoded><![CDATA[<p>Hi Vic,</p>
<p>Thanks for your comments. The way MCP2210 works is that once you have designated a pin as CS, it will automatically select/deselect when you issue SPI command. You can see this in my example here (<a href="http://www.kerrywong.com/2012/10/22/mcp2210-library-mcp3204-spi-adc/" rel="nofollow">http://www.kerrywong.com/2012/10/22/mcp2210-library-mcp3204-spi-adc/</a>)</p>
<p>&#8230;.<br />
    //chip select is GP1<br />
    def.ActiveChipSelectValue = 0xfffd;<br />
    def.IdleChipSelectValue = 0xffff;<br />
&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vic</title>
		<link>http://www.kerrywong.com/2012/09/27/mcp2210-library/comment-page-1/#comment-202330</link>
		<dc:creator>Vic</dc:creator>
		<pubDate>Wed, 17 Apr 2013 15:29:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrywong.com/?p=6830#comment-202330</guid>
		<description><![CDATA[Hi Kerry,

How should one handle the toggling of GPIO&#039;s after SPI has been configured with one GPIO dedicated to CS for the downstream device (tilt sensor)?
The tilt sensor will be periodically queried for its data, but GPIO changes will be sporadic.  The issue is that the GPIO Levels are all set
in two bytes in command 0x30, datasheet p.49, but what does one put for the CS? 0x00?

Thanks!  Great work, btw!]]></description>
		<content:encoded><![CDATA[<p>Hi Kerry,</p>
<p>How should one handle the toggling of GPIO&#8217;s after SPI has been configured with one GPIO dedicated to CS for the downstream device (tilt sensor)?<br />
The tilt sensor will be periodically queried for its data, but GPIO changes will be sporadic.  The issue is that the GPIO Levels are all set<br />
in two bytes in command 0&#215;30, datasheet p.49, but what does one put for the CS? 0&#215;00?</p>
<p>Thanks!  Great work, btw!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kwong</title>
		<link>http://www.kerrywong.com/2012/09/27/mcp2210-library/comment-page-1/#comment-199147</link>
		<dc:creator>kwong</dc:creator>
		<pubDate>Wed, 06 Feb 2013 01:06:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrywong.com/?p=6830#comment-199147</guid>
		<description><![CDATA[Yes, as you observed the buffer size needs to match the length of the data you are sending. As you concluded, if the buffer length is larger then the size of the data, 0&#039;s will be clocked in as the buffer is initialized to 0 with the maximum length.]]></description>
		<content:encoded><![CDATA[<p>Yes, as you observed the buffer size needs to match the length of the data you are sending. As you concluded, if the buffer length is larger then the size of the data, 0&#8242;s will be clocked in as the buffer is initialized to 0 with the maximum length.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vchene</title>
		<link>http://www.kerrywong.com/2012/09/27/mcp2210-library/comment-page-1/#comment-199129</link>
		<dc:creator>vchene</dc:creator>
		<pubDate>Tue, 05 Feb 2013 17:04:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrywong.com/?p=6830#comment-199129</guid>
		<description><![CDATA[Hi Kerry,

Thank you for your work it was a great help.

But there&#039;s something not really clear about how the MCP2210 handles the data size and transmission size:

If I configure the SPI to send 2 bytes per transmission and I want to send let&#039;s say 4 bytes.
Will the MCP trigger 2 transmissions or only one and give up on the remaining data ?
So far it seems the data sent are truncated (not sent) when bigger than a transmission size.

Is it actually how it works ? The only point of the message size is, in case it&#039;s smaller than the transmission size, to allow the master keeping the CS and the clock active until the transmission is done ?

Any information on this would be greatly appreciated !]]></description>
		<content:encoded><![CDATA[<p>Hi Kerry,</p>
<p>Thank you for your work it was a great help.</p>
<p>But there&#8217;s something not really clear about how the MCP2210 handles the data size and transmission size:</p>
<p>If I configure the SPI to send 2 bytes per transmission and I want to send let&#8217;s say 4 bytes.<br />
Will the MCP trigger 2 transmissions or only one and give up on the remaining data ?<br />
So far it seems the data sent are truncated (not sent) when bigger than a transmission size.</p>
<p>Is it actually how it works ? The only point of the message size is, in case it&#8217;s smaller than the transmission size, to allow the master keeping the CS and the clock active until the transmission is done ?</p>
<p>Any information on this would be greatly appreciated !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kwong</title>
		<link>http://www.kerrywong.com/2012/09/27/mcp2210-library/comment-page-1/#comment-194754</link>
		<dc:creator>kwong</dc:creator>
		<pubDate>Mon, 01 Oct 2012 20:25:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrywong.com/?p=6830#comment-194754</guid>
		<description><![CDATA[Hi Russel,

Yep, that&#039;s the exactly approach you would need. The SPI command needs to be issued continuously until all the data has been received as indicated by the engine status as I mentioned previously. I have found that the number of bytes field does not need to be 0 though (at least from my testing), it seems that that field is not used the subsequent SPI calls are made when retrieving the result.]]></description>
		<content:encoded><![CDATA[<p>Hi Russel,</p>
<p>Yep, that&#8217;s the exactly approach you would need. The SPI command needs to be issued continuously until all the data has been received as indicated by the engine status as I mentioned previously. I have found that the number of bytes field does not need to be 0 though (at least from my testing), it seems that that field is not used the subsequent SPI calls are made when retrieving the result.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russel Haynes</title>
		<link>http://www.kerrywong.com/2012/09/27/mcp2210-library/comment-page-1/#comment-194751</link>
		<dc:creator>Russel Haynes</dc:creator>
		<pubDate>Mon, 01 Oct 2012 17:57:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrywong.com/?p=6830#comment-194751</guid>
		<description><![CDATA[Hi Kerry,

I&#039;ve got this working. In my particular case, the SPI results are read out during the second byte of a SPI transfer so sending out more clock cycles will not help. It turns out, if you receieve a 0x20 in byte 3, you need to initiate another SPI transfer but set the number of bytes (specified in byte 1) to zero. I got that from Microchip support and it seems to work well.

In the case of an F8 in byte 1, you need to start the whole SPI transfer over as if it never happened. I placed a 25ms sleep before retrying a SPI transfer and this seems to minimize the number of re-trys.

Thanks for looking over my question and giving me your thoughts on it.]]></description>
		<content:encoded><![CDATA[<p>Hi Kerry,</p>
<p>I&#8217;ve got this working. In my particular case, the SPI results are read out during the second byte of a SPI transfer so sending out more clock cycles will not help. It turns out, if you receieve a 0&#215;20 in byte 3, you need to initiate another SPI transfer but set the number of bytes (specified in byte 1) to zero. I got that from Microchip support and it seems to work well.</p>
<p>In the case of an F8 in byte 1, you need to start the whole SPI transfer over as if it never happened. I placed a 25ms sleep before retrying a SPI transfer and this seems to minimize the number of re-trys.</p>
<p>Thanks for looking over my question and giving me your thoughts on it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kwong</title>
		<link>http://www.kerrywong.com/2012/09/27/mcp2210-library/comment-page-1/#comment-194724</link>
		<dc:creator>kwong</dc:creator>
		<pubDate>Sun, 30 Sep 2012 12:51:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrywong.com/?p=6830#comment-194724</guid>
		<description><![CDATA[Hi Russel,

I have not run into the problem you described. The SPI clock needs to be issued until the results are received. Did you try this? If you continue issuing the SPI transfer command you should see the engine status comes back as 0x10 eventually.

Anyway, I am putting together a tutorial using MCP2210 SPI and should appear on this blog in the coming days.]]></description>
		<content:encoded><![CDATA[<p>Hi Russel,</p>
<p>I have not run into the problem you described. The SPI clock needs to be issued until the results are received. Did you try this? If you continue issuing the SPI transfer command you should see the engine status comes back as 0&#215;10 eventually.</p>
<p>Anyway, I am putting together a tutorial using MCP2210 SPI and should appear on this blog in the coming days.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russel Haynes</title>
		<link>http://www.kerrywong.com/2012/09/27/mcp2210-library/comment-page-1/#comment-194717</link>
		<dc:creator>Russel Haynes</dc:creator>
		<pubDate>Sun, 30 Sep 2012 04:31:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrywong.com/?p=6830#comment-194717</guid>
		<description><![CDATA[I&#039;ve been working on getting the MCP2210 to run with Java on a Mac. I&#039;m using the javahidapi based on signal11&#039;s work. It was really nice to come across your code for linux and use it as a model.

Unfortunately, I&#039;ve been having a difficult time getting SPI transfers to work reliably. After writing something like:

42 03 00 00 13 40 00

Part of the time, I get back this:

42 00 00 20

Meaning the write happened but nothing was read back. Part of the time I get this:

42 f8

Meaning the command was received but there was a SPI data transfer in progress. Also, part of the time I get this:

42 00 03 10 00 00 00

Meaning it finished and read correctly. The thing is, I think I have the connection configured synchronously so this sort of thing shouldn&#039;t happen.

Anyway, I know this is a different environment but I thought I would just take a shot at describing it and see if this sounds like a problem you solved.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve been working on getting the MCP2210 to run with Java on a Mac. I&#8217;m using the javahidapi based on signal11&#8242;s work. It was really nice to come across your code for linux and use it as a model.</p>
<p>Unfortunately, I&#8217;ve been having a difficult time getting SPI transfers to work reliably. After writing something like:</p>
<p>42 03 00 00 13 40 00</p>
<p>Part of the time, I get back this:</p>
<p>42 00 00 20</p>
<p>Meaning the write happened but nothing was read back. Part of the time I get this:</p>
<p>42 f8</p>
<p>Meaning the command was received but there was a SPI data transfer in progress. Also, part of the time I get this:</p>
<p>42 00 03 10 00 00 00</p>
<p>Meaning it finished and read correctly. The thing is, I think I have the connection configured synchronously so this sort of thing shouldn&#8217;t happen.</p>
<p>Anyway, I know this is a different environment but I thought I would just take a shot at describing it and see if this sounds like a problem you solved.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kwong</title>
		<link>http://www.kerrywong.com/2012/09/27/mcp2210-library/comment-page-1/#comment-194687</link>
		<dc:creator>kwong</dc:creator>
		<pubDate>Fri, 28 Sep 2012 20:29:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrywong.com/?p=6830#comment-194687</guid>
		<description><![CDATA[One more thing, if you are still having problems, could you tell me what is the returned status code? I just added a note in the blog posting above about the permissions. Thanks.]]></description>
		<content:encoded><![CDATA[<p>One more thing, if you are still having problems, could you tell me what is the returned status code? I just added a note in the blog posting above about the permissions. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kwong</title>
		<link>http://www.kerrywong.com/2012/09/27/mcp2210-library/comment-page-1/#comment-194685</link>
		<dc:creator>kwong</dc:creator>
		<pubDate>Fri, 28 Sep 2012 19:52:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrywong.com/?p=6830#comment-194685</guid>
		<description><![CDATA[Hi Pavel,

Yes, I had tested the provided code using multiple chips. One thing I forgot to mention is that you will need to follow signall11&#039;s directions to change device permissions on Linux, otherwise you will need to use sudo to run your code.

Yes, without root access to the devices, you will not be able to manipulate the settings.

Could you let me know if you are able to get it working by using sudo?]]></description>
		<content:encoded><![CDATA[<p>Hi Pavel,</p>
<p>Yes, I had tested the provided code using multiple chips. One thing I forgot to mention is that you will need to follow signall11&#8242;s directions to change device permissions on Linux, otherwise you will need to use sudo to run your code.</p>
<p>Yes, without root access to the devices, you will not be able to manipulate the settings.</p>
<p>Could you let me know if you are able to get it working by using sudo?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
