<?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: Communication  over SPI with SC16IS750 from the Sparkfun WiFly-Shield</title>
		<link>http://forums.leaflabs.com/topic.php?id=2164</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:18:42 +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=2164" rel="self" type="application/rss+xml" />

		<item>
			<title>feurig on "Communication  over SPI with SC16IS750 from the Sparkfun WiFly-Shield"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2164#post-11820</link>
			<pubDate>Wed, 18 Jul 2012 22:50:53 +0000</pubDate>
			<dc:creator>feurig</dc:creator>
			<guid isPermaLink="false">11820@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;FYI. The libmaple spi port implementation has a nice chip select mechanism for each port: nssPin() ( zb. digitalWrite(wifispi-&#38;gt;nssPin(),LOW); )&#60;/p&#62;
&#60;p&#62;Unless you are a hardcore &#34;arduino style&#34; coder that stuff should never be hard coded.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>asterix on "Communication  over SPI with SC16IS750 from the Sparkfun WiFly-Shield"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2164#post-11818</link>
			<pubDate>Wed, 18 Jul 2012 19:18:31 +0000</pubDate>
			<dc:creator>asterix</dc:creator>
			<guid isPermaLink="false">11818@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Also, try putting in a 3 second or so delay before you begin spi communication with the WiFly as it takes a little while to boot up at power on (I've found at least anyway - particularly if it isn't configured).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>asterix on "Communication  over SPI with SC16IS750 from the Sparkfun WiFly-Shield"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2164#post-11817</link>
			<pubDate>Wed, 18 Jul 2012 19:15:11 +0000</pubDate>
			<dc:creator>asterix</dc:creator>
			<guid isPermaLink="false">11817@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Shouldn't:&#60;/p&#62;
&#60;p&#62;write_register(byte(i) &#38;lt;&#38;lt; 3, 0x02);&#60;/p&#62;
&#60;p&#62;come after:&#60;br /&#62;
WiFly.write(SPI_READ_MODE_FLAG &#124; address);&#60;/p&#62;
&#60;p&#62;Im working on a WiFly project at the moment (using a gsx breakout board with RN 131C).&#60;br /&#62;
I gave up trying to configure the WiFly through UART (rx tx) and put my WiFly on my network by telneting via the adhoc method (described in the documentation).&#60;/p&#62;
&#60;p&#62;Once that was done I could easily receive telnet commands over the UART. Haven't quite made it to spi yet but fingers crossed.&#60;/p&#62;
&#60;p&#62;Perhaps try getting it on your network first and seeing if you can catch some telnet data rather than expecting a response from WiFly from a maple write/read scenario?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pmp0x on "Communication  over SPI with SC16IS750 from the Sparkfun WiFly-Shield"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2164#post-11786</link>
			<pubDate>Tue, 17 Jul 2012 07:40:45 +0000</pubDate>
			<dc:creator>pmp0x</dc:creator>
			<guid isPermaLink="false">11786@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hello!&#60;br /&#62;
I'm new to the microcontroller-world so this might be more of a beginner question.&#60;br /&#62;
But I'm trying work with the WiFly-Shield from Sparkfun. For that to work I figure out that I have to setup the onboard SPI-to-Uart chip (&#60;a href=&#34;http://www.sparkfun.com/datasheets/Components/SMD/SC16IS740_750_760.pdf&#34;&#62;SC16IS750&#60;/a&#62; ) [I think it would have been way easier to just use the RN-131-C chip over UART but well… ]&#60;/p&#62;
&#60;p&#62;So the first attempt to just drop in the WiFly-Library and try to run the SpiUartTerminal-example didn't work out. Even though I modified the SpiUart.cpp that it should have run with Maple… Therefore I tried the most simple attemp…just writing and reading to the registers. (I know that not all registers are writeable…etc.) BUT all I get back on every register is 0xff…&#60;br /&#62;
But according to the datasheet (p14) nearly all should be cleared.  &#60;/p&#62;
&#60;p&#62;Can somebody please give me a hint what I'm doing wrong?!&#60;br /&#62;
Thanks&#60;br /&#62;
/Marcus&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
#define DEFAULT_CHIP_SELECT_PIN 10&#60;br /&#62;
#define DEFAULT_SPI_PORT 1&#60;br /&#62;
#define SPI_READ_MODE_FLAG 0x80&#60;/p&#62;
&#60;p&#62;#include &#34;libmaple.h&#34;&#60;br /&#62;
#include &#34;wirish.h&#34;&#60;/p&#62;
&#60;p&#62;void write_register(uint8 address, uint8 data);&#60;br /&#62;
uint8 read_register(uint8 address);&#60;/p&#62;
&#60;p&#62;boolean foo = false;&#60;/p&#62;
&#60;p&#62;HardwareSPI WiFly(DEFAULT_SPI_PORT);&#60;br /&#62;
void setup() {&#60;/p&#62;
&#60;p&#62;    WiFly.begin(SPI_9MHZ, MSBFIRST, 0);&#60;br /&#62;
    pinMode(DEFAULT_CHIP_SELECT_PIN, OUTPUT);&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;void loop() {&#60;br /&#62;
    if(SerialUSB.available() &#38;amp;&#38;amp; foo == false) {&#60;/p&#62;
&#60;p&#62;        for(int i=0; i&#38;lt;16; i++){&#60;br /&#62;
            SerialUSB.println(&#34;Writing to adress:&#34;);&#60;br /&#62;
            SerialUSB.println( byte(i) &#38;lt;&#38;lt; 3, BIN);&#60;br /&#62;
            write_register(byte(i) &#38;lt;&#38;lt; 3, 0x02);&#60;br /&#62;
        }&#60;br /&#62;
        delay(20);&#60;/p&#62;
&#60;p&#62;        for(int i=0; i&#38;lt;16; i++){&#60;br /&#62;
            SerialUSB.println(&#34;Reading from adress:&#34;);&#60;br /&#62;
            SerialUSB.println( byte(i) &#38;lt;&#38;lt; 3, BIN);&#60;br /&#62;
            SerialUSB.println( read_register(byte(i) &#38;lt;&#38;lt; 3) );&#60;/p&#62;
&#60;p&#62;        }&#60;/p&#62;
&#60;p&#62;        foo = true;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;void select(){&#60;br /&#62;
    digitalWrite(DEFAULT_CHIP_SELECT_PIN, LOW);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;void deselect(){&#60;br /&#62;
    digitalWrite(DEFAULT_CHIP_SELECT_PIN, HIGH);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;void write_register(uint8 address, uint8 data){&#60;/p&#62;
&#60;p&#62;    select();&#60;br /&#62;
    WiFly.write(address);&#60;br /&#62;
    WiFly.write(data);&#60;/p&#62;
&#60;p&#62;    deselect();&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;uint8 read_register(uint8 address){&#60;br /&#62;
    uint8 data;&#60;br /&#62;
    select();&#60;br /&#62;
// see Chapter 11 in Datasheed&#60;br /&#62;
    WiFly.write(SPI_READ_MODE_FLAG &#124; address);&#60;br /&#62;
    data = WiFly.read();&#60;br /&#62;
    deselect();&#60;br /&#62;
    return data;&#60;br /&#62;
}&#60;br /&#62;
&#60;/code&#62;
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
