<?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: USB Communication &#38; Maple</title>
		<link>http://forums.leaflabs.com/topic.php?id=936</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:22:23 +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=936" rel="self" type="application/rss+xml" />

		<item>
			<title>samtal on "USB Communication &#38; Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=936#post-5810</link>
			<pubDate>Sat, 30 Jul 2011 03:25:35 +0000</pubDate>
			<dc:creator>samtal</dc:creator>
			<guid isPermaLink="false">5810@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi, &#60;/p&#62;
&#60;p&#62;Sorry for my silly question.&#60;br /&#62;
Why did I expect to get data from the serial2 when I am sending it to the USB?&#60;br /&#62;
I'll have to change all print command to one of the serials rather than to the USB.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>samtal on "USB Communication &#38; Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=936#post-5807</link>
			<pubDate>Fri, 29 Jul 2011 21:54:11 +0000</pubDate>
			<dc:creator>samtal</dc:creator>
			<guid isPermaLink="false">5807@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thanks robodude666&#60;/p&#62;
&#60;p&#62;I'll have to be patient and wait for a durable solution.&#60;br /&#62;
As I wrote, I also have an additional Serial2 connected (via Silabs USB adapter).&#60;br /&#62;
I use it mainly to upload the flash (which, I suspect (?) helps me out occasionally with the usb).&#60;br /&#62;
I can upload the program via that port, but when opening the Serial Monitor, although it shows the correct port number, I get no data in the window.&#60;br /&#62;
I did not yet look into it, but does anyone have an idea?&#60;br /&#62;
samtal
&#60;/p&#62;</description>
		</item>
		<item>
			<title>robodude666 on "USB Communication &#38; Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=936#post-5796</link>
			<pubDate>Fri, 29 Jul 2011 13:38:49 +0000</pubDate>
			<dc:creator>robodude666</dc:creator>
			<guid isPermaLink="false">5796@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;There are known issues with the USB not working properly after certain situations. LeafLabs is working on rewriting some of the USB functionality to relieve these issues.&#60;/p&#62;
&#60;p&#62;Because it's annoying to have to disconnect/reconnect USB for serial communication, I've gotten an FTDI adapter (aka an old Arduino) and using Serial2 for my debugging.&#60;/p&#62;
&#60;p&#62;-robodude666
&#60;/p&#62;</description>
		</item>
		<item>
			<title>samtal on "USB Communication &#38; Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=936#post-5795</link>
			<pubDate>Fri, 29 Jul 2011 13:11:30 +0000</pubDate>
			<dc:creator>samtal</dc:creator>
			<guid isPermaLink="false">5795@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi,&#60;br /&#62;
I am having real trouble with the USB connection.&#60;br /&#62;
Every now and then I lose my USB port without any noticeable relation to what I am doing.&#60;br /&#62;
I read stars comment above, but could not find any USB 'initialize' function.&#60;br /&#62;
Furthermore, the documentation clearly states that the USB is always automatically initialized at startup and is singleton. &#60;/p&#62;
&#60;p&#62;In my case, on one program upload it works, and on the next I get the USB error message, and the port disappears.&#60;br /&#62;
This is extremely annoying, especially that I work remotely on a board that is in another location, and even when at the board, I don't really know how to get it back.&#60;br /&#62;
I reset the board, re-connect the usb (with the power), some times it will come back, but some other times I re-flash without even knowing if this helps.&#60;br /&#62;
(Fortunately, I also have one additional RS232 connected which makes it easier to revive).&#60;br /&#62;
I have tried to change the 'Delay after reset' up and down, for no avail.&#60;br /&#62;
By the way: It has nothng to do with my program. The problem can appear also with Maple examples.&#60;/p&#62;
&#60;p&#62;Can anyone help?&#60;br /&#62;
Thanks&#60;br /&#62;
samtal
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stars on "USB Communication &#38; Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=936#post-5781</link>
			<pubDate>Thu, 28 Jul 2011 01:17:29 +0000</pubDate>
			<dc:creator>stars</dc:creator>
			<guid isPermaLink="false">5781@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Own question == ANSWERED!&#60;/p&#62;
&#60;p&#62;Answer:&#60;/p&#62;
&#60;pre&#62;
// Force init to be called *first*, i.e. before static object allocation.
// Otherwise, statically allocated objects that need libmaple may fail.
__attribute__((constructor)) void premain() {
    init();
}
&#60;/pre&#62;
 is mandatory and cannot be ommitted.  This solves everything!  Hooray!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stars on "USB Communication &#38; Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=936#post-5780</link>
			<pubDate>Wed, 27 Jul 2011 23:28:58 +0000</pubDate>
			<dc:creator>stars</dc:creator>
			<guid isPermaLink="false">5780@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Also it's my understanding that SerialUSB does not need to be .begin()'d or otherwise initialized; could that be where the error lies?  Correct me if I'm mistaken about that.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stars on "USB Communication &#38; Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=936#post-5779</link>
			<pubDate>Wed, 27 Jul 2011 23:27:38 +0000</pubDate>
			<dc:creator>stars</dc:creator>
			<guid isPermaLink="false">5779@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi!  I'm working through some of the basic get-toes-wet steps to maple development, and wrote a limited version of the main.cpp.example to test ADC reading.&#60;/p&#62;
&#60;p&#62;However, my code causes the maple to no longer mount as /dev/ttyACM (hi from Debian).&#60;/p&#62;
&#60;p&#62;I've read over main.cpp.example many times but can't seem to pin it down.  What relevant code am I missing?&#60;/p&#62;
&#60;p&#62;Here's mine as sample:&#60;/p&#62;
&#60;pre&#62;
#include &#34;wirish.h&#34;
#define BAUD 9600

void print_adc(uint8 pin);

void print_adc(uint8 pin){
  int sample = analogRead(pin);
  SerialUSB.print(sample, DEC);
}

void setup() {
  //use pins 15-18 for ADC testing
  pinMode(15, INPUT_ANALOG);
  pinMode(16, INPUT_ANALOG);
  pinMode(17, INPUT_ANALOG);
  pinMode(18, INPUT_ANALOG);

}

void loop(){
  while (SerialUSB.available()) {
    uint8 input = SerialUSB.read();
    SerialUSB.println(input);

    switch(input) {
      case 'p':
        for(int i = 15; i &#38;lt; 19; i++) {
          print_adc(i);
      }
      break;
    }
  }
}

int main() {
    setup();

    while (1) {
        loop();
    }
    return 0;
}
&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
