<?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: Using Maple r5 to control Serial device through SerialUSB</title>
		<link>http://forums.leaflabs.com/topic.php?id=1550</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:25:26 +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=1550" rel="self" type="application/rss+xml" />

		<item>
			<title>ExodusCSM on "Using Maple r5 to control Serial device through SerialUSB"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1550#post-10287</link>
			<pubDate>Thu, 19 Apr 2012 17:26:07 +0000</pubDate>
			<dc:creator>ExodusCSM</dc:creator>
			<guid isPermaLink="false">10287@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Well I had a program run iterations of baud rate with set stop and parity values. Never got a good read from the serial monitor that was watching what was being outputted. &#60;/p&#62;
&#60;p&#62;I have, however, found that when the serial device sent data to the maple board (with the device set to 8n1 and a 19200 baud rate) that the maple would read this 21 characters when it should only be 14. With this I made the maple read if there where any parity or frame errors. When the serial device would send 1 pulse of data (manually made it send only 1 set of data) the maple would split this into 4 sets of data. All 4 sets gave a Frame Error and 1 gave a Parity Error. &#60;/p&#62;
&#60;p&#62;I think I may end up just having to use a computer for this experiment, which I was hoping to not have to do, unless you have any more suggestions. I did try RTS/CTS but that didn't help either. Still gave incorrect characters. &#60;/p&#62;
&#60;p&#62;I do appreciate your help and time gbulmer.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Using Maple r5 to control Serial device through SerialUSB"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1550#post-10276</link>
			<pubDate>Wed, 18 Apr 2012 12:39:29 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">10276@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;When different numbers of characters are detected, the baud rate is often wrong.&#60;/p&#62;
&#60;p&#62;Try the characters 'A' 'B', 'D', 'H' which have only one bit set in each 4 bits (0x41, 0x42, 0x44, 0x48), also 0x00 and 0x7e.&#60;/p&#62;
&#60;p&#62;You're probably going to have to write a program which tries permutations of baud rate, start, stop and parity, and prints strings to see when it works.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ExodusCSM on "Using Maple r5 to control Serial device through SerialUSB"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1550#post-10273</link>
			<pubDate>Wed, 18 Apr 2012 11:17:20 +0000</pubDate>
			<dc:creator>ExodusCSM</dc:creator>
			<guid isPermaLink="false">10273@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;So I tried a quick check with the built in Serial monitor of the Maple IDE and CuteCom (Another Serial monitor).&#60;/p&#62;
&#60;p&#62;If I sent a &#34;1&#34; to the Maple through the USB to Serial Adapter the Maple would send a &#34;g&#34; to the Maple IDE serial monitor. If I reverse this process and send a &#34;1&#34; from the Maple to the Computer I get an out put of &#34;gy=&#34;.&#60;/p&#62;
&#60;p&#62;This is with the USB-Serial adapter being connected directly to the maple board.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ExodusCSM on "Using Maple r5 to control Serial device through SerialUSB"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1550#post-10239</link>
			<pubDate>Tue, 17 Apr 2012 16:46:25 +0000</pubDate>
			<dc:creator>ExodusCSM</dc:creator>
			<guid isPermaLink="false">10239@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Well I was able to set the STM32 USART controls to the correct items so that the Serial parity, handshake, &#38;amp; stopbits matched that of my serial device. &#60;/p&#62;
&#60;p&#62;However, I am still receiving random data and not the data the device should be sending as compared to when it sends it to a computer. &#60;/p&#62;
&#60;p&#62;Any idea on why this might be?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ExodusCSM on "Using Maple r5 to control Serial device through SerialUSB"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1550#post-10203</link>
			<pubDate>Fri, 13 Apr 2012 17:56:30 +0000</pubDate>
			<dc:creator>ExodusCSM</dc:creator>
			<guid isPermaLink="false">10203@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The serial monitor on the Maple IDE is set to match the baud rate in the code and receives the correct number of characters. It just doesn't get the correct characters.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Using Maple r5 to control Serial device through SerialUSB"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1550#post-10202</link>
			<pubDate>Fri, 13 Apr 2012 17:51:32 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">10202@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;ala42 - AFAIK, it depends which pins are used for the USART's, most are 5V tolerant, but not all of them.&#60;/p&#62;
&#60;p&#62;ExodusCSM - I assume the baud rate is correct.&#60;br /&#62;
Is the program receiving approximately the correct number of characters?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ExodusCSM on "Using Maple r5 to control Serial device through SerialUSB"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1550#post-10201</link>
			<pubDate>Fri, 13 Apr 2012 17:33:56 +0000</pubDate>
			<dc:creator>ExodusCSM</dc:creator>
			<guid isPermaLink="false">10201@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;It seems to be receiving data however it is all gibberish. I have even written a short little program that outputs through the Serial3 and I am monitoring on the serial monitor in the IDE. &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;void setup()
{
  Serial3.begin(9600);
}
void loop()
{
  int i = 1;
  waitForButtonPress();
  Serial3.println(&#38;quot;This is the test to see if this is sending. Press again to Start&#38;quot;);
  waitForButtonPress();
  do
  {
    Serial3.print(i);
    i++;
  }
  while (i &#38;gt;= 1 &#38;amp;&#38;amp; i &#38;lt;= 100);
  Serial3.println();
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;This is the result:&#60;br /&#62;
g3vV6[][][][][][][][][][][][][][...etc.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ala42 on "Using Maple r5 to control Serial device through SerialUSB"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1550#post-10197</link>
			<pubDate>Fri, 13 Apr 2012 16:50:01 +0000</pubDate>
			<dc:creator>ala42</dc:creator>
			<guid isPermaLink="false">10197@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The USARTS should be 5V tolerant, check the datasheet of the CPU to be sure.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Using Maple r5 to control Serial device through SerialUSB"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1550#post-10196</link>
			<pubDate>Fri, 13 Apr 2012 16:40:29 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">10196@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;ExodusCSM - There is a low-cost 3.3V/5V level-shifter described at &#60;a href=&#34;http://delphys.net/d.holmes/hardware/levelshift.html&#34; rel=&#34;nofollow&#34;&#62;http://delphys.net/d.holmes/hardware/levelshift.html&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;The original application note is at: &#60;a href=&#34;http://ics.nxp.com/support/documents/interface/pdf/an97055.pdf&#34; rel=&#34;nofollow&#34;&#62;http://ics.nxp.com/support/documents/interface/pdf/an97055.pdf&#60;/a&#62;&#60;br /&#62;
Section 2.3&#60;/p&#62;
&#60;p&#62;Less than 10¢ / signal.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ExodusCSM on "Using Maple r5 to control Serial device through SerialUSB"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1550#post-10193</link>
			<pubDate>Fri, 13 Apr 2012 10:51:59 +0000</pubDate>
			<dc:creator>ExodusCSM</dc:creator>
			<guid isPermaLink="false">10193@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I was able to determine that the scale is using 5V TTL and the defaults for the USART. &#60;/p&#62;
&#60;p&#62;Hopefully, I can get them to talk to each other now. Thanks for the help so far.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Using Maple r5 to control Serial device through SerialUSB"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1550#post-10192</link>
			<pubDate>Fri, 13 Apr 2012 08:04:02 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">10192@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;ExodusCSM - Maple has three serial ports on chip, they are called USARTs.&#60;/p&#62;
&#60;p&#62;This page describes the Serial class which interfaces with them:&#60;br /&#62;
&#60;a href=&#34;http://leaflabs.com/docs/lang/api/serial.html#lang-serial&#34; rel=&#34;nofollow&#34;&#62;http://leaflabs.com/docs/lang/api/serial.html#lang-serial&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;That library lets you set the baud rate, but AFAIK doesn't give access to other settings like parity, stopbits etc. &#60;/p&#62;
&#60;p&#62;The underlying USART hardware can run with most permutations of parity, stop bits, and handshake. So you might need to poke a few bytes into hardware registers, or change the scale device to match the Maple.&#60;/p&#62;
&#60;p&#62;The USARTs are described in the manual for the STM32F103, it's called &#34;RM0008 Reference manual. STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and STM32F107xx advanced ARM-based 32-bit MCUs&#34;.&#60;br /&#62;
You can get it by downloading it from ST Micro:&#60;br /&#62;
&#60;a href=&#34;http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/REFERENCE_MANUAL/CD00171190.pdf&#34; rel=&#34;nofollow&#34;&#62;http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/REFERENCE_MANUAL/CD00171190.pdf&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;The Maple runs at 3.3V. So, depending on the voltages the scale uses, you might need to 'level-shift' the voltages to talk to the device. &#60;/p&#62;
&#60;p&#62;'Real' RS232 is +/-12V, which is what the MAX232 handles. It runs from a 5V supply, and does the step up to +/-12V internally. Some serial devices are 5V TTL, so it is worth checking, as that is even simpler to handle than 'real' RS232.&#60;/p&#62;
&#60;p&#62;(Full disclosure: I am not a member of LeafLabs staff)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ExodusCSM on "Using Maple r5 to control Serial device through SerialUSB"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1550#post-10185</link>
			<pubDate>Thu, 12 Apr 2012 22:50:45 +0000</pubDate>
			<dc:creator>ExodusCSM</dc:creator>
			<guid isPermaLink="false">10185@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Ok, well that rules out using the SerialUSB to control a serial device. What I am trying to do is control a scale that sends and receives through serial. &#60;/p&#62;
&#60;p&#62;Would I need to use a MAX232 to control it in this manner? The scale needs to have the serial data sent under certain parity, stopbits, and handshake; however, this can be changed on the scale if I knew the default parity, stopbits and handshake on the USART on the maple. &#60;/p&#62;
&#60;p&#62;Not sure if this is able to be done.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Using Maple r5 to control Serial device through SerialUSB"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1550#post-10184</link>
			<pubDate>Thu, 12 Apr 2012 20:12:41 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">10184@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;ExodusCSM - I am unclear what you are trying to do.&#60;/p&#62;
&#60;p&#62;AFAIK the PL-2303 is an 'upstream' USB device, i.e. it plugs into a USB host, and then the PL-2303 talks to a serial port.&#60;/p&#62;
&#60;p&#62;The Maple's SerialUSB is &#60;strong&#62;not&#60;/strong&#62; a USB host, it is a USB device.&#60;br /&#62;
So AFAIK Maple can't talk to the USB side of the PL-2303. So you can't use a Maple to talk to the PL-2303 using SerialUSB.&#60;/p&#62;
&#60;p&#62;(Full disclosure: I am not a member of LeafLabs staff)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ExodusCSM on "Using Maple r5 to control Serial device through SerialUSB"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1550#post-10182</link>
			<pubDate>Thu, 12 Apr 2012 18:05:40 +0000</pubDate>
			<dc:creator>ExodusCSM</dc:creator>
			<guid isPermaLink="false">10182@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I'm trying to control a serial device through the SerialUSB with a USB to Serial adapter based on the PL-2303 chipset. &#60;/p&#62;
&#60;p&#62;The problem that I am running into is that I can change the RS232 settings on the device (ie. baud, parity, handshake); however, I don't know where/what the defaults are for SerialUSB or if they are changeable in any way?&#60;/p&#62;
&#60;p&#62;Has anyone controlled a device like this with the maple?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
