<?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: NewSoftSerial</title>
	<atom:link href="http://arduiniana.org/libraries/newsoftserial/feed/" rel="self" type="application/rss+xml" />
	<link>http://arduiniana.org</link>
	<description>Arduino software jewellery and wisdom by Mikal Hart</description>
	<lastBuildDate>Fri, 03 Sep 2010 07:40:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mikal</title>
		<link>http://arduiniana.org/libraries/newsoftserial/comment-page-3/#comment-4326</link>
		<dc:creator>Mikal</dc:creator>
		<pubDate>Mon, 30 Aug 2010 05:06:50 +0000</pubDate>
		<guid isPermaLink="false">http://sundial.org/arduino/?page_id=61#comment-4326</guid>
		<description>Hmm...  Can you post some samples of the &quot;garbled&quot; text.  Logically this seems ok.  Are all devices grounded?  All operating at the correct voltage?  There isn&#039;t any RS-232 anywhere, is there?

Mikal</description>
		<content:encoded><![CDATA[<p>Hmm&#8230;  Can you post some samples of the &#8220;garbled&#8221; text.  Logically this seems ok.  Are all devices grounded?  All operating at the correct voltage?  There isn&#8217;t any RS-232 anywhere, is there?</p>
<p>Mikal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: g</title>
		<link>http://arduiniana.org/libraries/newsoftserial/comment-page-3/#comment-4300</link>
		<dc:creator>g</dc:creator>
		<pubDate>Sun, 29 Aug 2010 10:26:41 +0000</pubDate>
		<guid isPermaLink="false">http://sundial.org/arduino/?page_id=61#comment-4300</guid>
		<description>Having a bit of a problem with what i think is down to a writing baud rate issue..

I have the PC connected to the Duemilanove via USB, then pin 3 of the arduino (Tx) connected to the serial connection on a Milford Instruments LCD display screen. Data sheet - http://www.milinst.co.uk/shop/LCDs/pdf/6_201.pdf which accepts baud rates of 9600 or 2400 depending on the baud jumper, is 8bit, no parity and one stop bit.

Basically the Duemilanove should be acting as a USB to serial converter. The sketch is as follows:

#include 

NewSoftSerial lcd(2, 3);

void setup()
{
  pinMode(13, OUTPUT);
  digitalWrite(13, HIGH);
  Serial.begin(9600);
  lcd.begin(9600);
}

void loop()
{
  if(Serial.available())
  {
    char c = Serial.read();
    lcd.print(c);
    Serial.print(c);
    Serial.print((bool) lcd.overflow());
  }
}

Should be reading from Serial (1 char at a time) then printing to the LCD display via pin 3 (additional Serial prints for debugging)..

At the PC side I have a python script to send the commands (clear the LCD display, reset the cursor position and send some &#039;test&#039; text).

At 9600 baud either side of the Arduino, data is getting through to the display screen but about 50% of the time at least 1 of the 4 characters that make up the initial string is garbled. However the messages that come back through the USB serial port to the PC are always correct and there&#039;s no overflow.

Connecting the LCD display directly to the PC with a serial cable and with a USB to serial converter (PL2303) it works 100% of the time fine. I&#039;m assuming it&#039;s got to be related to the NSS write function..?</description>
		<content:encoded><![CDATA[<p>Having a bit of a problem with what i think is down to a writing baud rate issue..</p>
<p>I have the PC connected to the Duemilanove via USB, then pin 3 of the arduino (Tx) connected to the serial connection on a Milford Instruments LCD display screen. Data sheet &#8211; <a href="http://www.milinst.co.uk/shop/LCDs/pdf/6_201.pdf" rel="nofollow">http://www.milinst.co.uk/shop/LCDs/pdf/6_201.pdf</a> which accepts baud rates of 9600 or 2400 depending on the baud jumper, is 8bit, no parity and one stop bit.</p>
<p>Basically the Duemilanove should be acting as a USB to serial converter. The sketch is as follows:</p>
<p>#include </p>
<p>NewSoftSerial lcd(2, 3);</p>
<p>void setup()<br />
{<br />
  pinMode(13, OUTPUT);<br />
  digitalWrite(13, HIGH);<br />
  Serial.begin(9600);<br />
  lcd.begin(9600);<br />
}</p>
<p>void loop()<br />
{<br />
  if(Serial.available())<br />
  {<br />
    char c = Serial.read();<br />
    lcd.print(c);<br />
    Serial.print(c);<br />
    Serial.print((bool) lcd.overflow());<br />
  }<br />
}</p>
<p>Should be reading from Serial (1 char at a time) then printing to the LCD display via pin 3 (additional Serial prints for debugging)..</p>
<p>At the PC side I have a python script to send the commands (clear the LCD display, reset the cursor position and send some &#8216;test&#8217; text).</p>
<p>At 9600 baud either side of the Arduino, data is getting through to the display screen but about 50% of the time at least 1 of the 4 characters that make up the initial string is garbled. However the messages that come back through the USB serial port to the PC are always correct and there&#8217;s no overflow.</p>
<p>Connecting the LCD display directly to the PC with a serial cable and with a USB to serial converter (PL2303) it works 100% of the time fine. I&#8217;m assuming it&#8217;s got to be related to the NSS write function..?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikal</title>
		<link>http://arduiniana.org/libraries/newsoftserial/comment-page-3/#comment-4280</link>
		<dc:creator>Mikal</dc:creator>
		<pubDate>Sat, 28 Aug 2010 22:11:24 +0000</pubDate>
		<guid isPermaLink="false">http://sundial.org/arduino/?page_id=61#comment-4280</guid>
		<description>Do any readers have time to port NewSoftSerial to Mega for Mike and the others?

Mikal</description>
		<content:encoded><![CDATA[<p>Do any readers have time to port NewSoftSerial to Mega for Mike and the others?</p>
<p>Mikal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://arduiniana.org/libraries/newsoftserial/comment-page-3/#comment-4212</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Thu, 26 Aug 2010 20:21:19 +0000</pubDate>
		<guid isPermaLink="false">http://sundial.org/arduino/?page_id=61#comment-4212</guid>
		<description>Any word on when NewSoftSerial will be available for the Mega?  I can send ok but can&#039;t receive, using my Mega with the TSS.  Primarily, I wish to use NewSoftSerial between these two devices.</description>
		<content:encoded><![CDATA[<p>Any word on when NewSoftSerial will be available for the Mega?  I can send ok but can&#8217;t receive, using my Mega with the TSS.  Primarily, I wish to use NewSoftSerial between these two devices.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikal</title>
		<link>http://arduiniana.org/libraries/newsoftserial/comment-page-3/#comment-4074</link>
		<dc:creator>Mikal</dc:creator>
		<pubDate>Sat, 21 Aug 2010 16:48:28 +0000</pubDate>
		<guid isPermaLink="false">http://sundial.org/arduino/?page_id=61#comment-4074</guid>
		<description>Mike, your code looks reasonable, but if I were you I&#039;d try communicating with the console at a higher speed.  Can you ratchet that up to, say, 115200?

Mikal</description>
		<content:encoded><![CDATA[<p>Mike, your code looks reasonable, but if I were you I&#8217;d try communicating with the console at a higher speed.  Can you ratchet that up to, say, 115200?</p>
<p>Mikal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://arduiniana.org/libraries/newsoftserial/comment-page-3/#comment-4065</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Sat, 21 Aug 2010 09:06:36 +0000</pubDate>
		<guid isPermaLink="false">http://sundial.org/arduino/?page_id=61#comment-4065</guid>
		<description>Hi,

Thanks for the library. I’m having a little trouble getting it to read data from a GPS. I’m using a very basic sketch (attached), but I just get strings of garbage on the screen

I can read the GPS data using hyperterminal without problems, it auto-detects the connections settings as 4800 baud, 8 bit, no parity. The data displayed by hyperterminal is fine, so I know the GPS is working.

Any suggestions appreciated.

Regards

Mike

#include 

NewSoftSerial mySerial =  NewSoftSerial(2, 3);

#define BUFFSIZ 90 // plenty big
char buffer[BUFFSIZ];
char buffidx;

void setup() 
{ 
  Serial.begin(4800);
  mySerial.begin(4800);
  Serial.println(&quot;\n\rNewSoftSerial + GPS test&quot;); 
} 
 
void loop() 
{ 
  Serial.print(&quot;\n\rread: &quot;);
  readline();
}

void readline(void) {
  char c;
  buffidx = 0; // start at begninning
  while (1) {
      c=mySerial.read();
      if (c == -1)
        continue;
      Serial.print(c);
      if (c == &#039;\n&#039;)
        continue;
      if ((buffidx == BUFFSIZ-1) &#124;&#124; (c == &#039;\r&#039;)) {
        return;
      }
      buffidx++;
  }
}</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thanks for the library. I’m having a little trouble getting it to read data from a GPS. I’m using a very basic sketch (attached), but I just get strings of garbage on the screen</p>
<p>I can read the GPS data using hyperterminal without problems, it auto-detects the connections settings as 4800 baud, 8 bit, no parity. The data displayed by hyperterminal is fine, so I know the GPS is working.</p>
<p>Any suggestions appreciated.</p>
<p>Regards</p>
<p>Mike</p>
<p>#include </p>
<p>NewSoftSerial mySerial =  NewSoftSerial(2, 3);</p>
<p>#define BUFFSIZ 90 // plenty big<br />
char buffer[BUFFSIZ];<br />
char buffidx;</p>
<p>void setup()<br />
{<br />
  Serial.begin(4800);<br />
  mySerial.begin(4800);<br />
  Serial.println(&#8220;\n\rNewSoftSerial + GPS test&#8221;);<br />
} </p>
<p>void loop()<br />
{<br />
  Serial.print(&#8220;\n\rread: &#8220;);<br />
  readline();<br />
}</p>
<p>void readline(void) {<br />
  char c;<br />
  buffidx = 0; // start at begninning<br />
  while (1) {<br />
      c=mySerial.read();<br />
      if (c == -1)<br />
        continue;<br />
      Serial.print(c);<br />
      if (c == &#8216;\n&#8217;)<br />
        continue;<br />
      if ((buffidx == BUFFSIZ-1) || (c == &#8216;\r&#8217;)) {<br />
        return;<br />
      }<br />
      buffidx++;<br />
  }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikal</title>
		<link>http://arduiniana.org/libraries/newsoftserial/comment-page-3/#comment-3943</link>
		<dc:creator>Mikal</dc:creator>
		<pubDate>Sat, 14 Aug 2010 23:46:15 +0000</pubDate>
		<guid isPermaLink="false">http://sundial.org/arduino/?page_id=61#comment-3943</guid>
		<description>Frits,

Yes, that is possible.  Someday when I get time I may modify the library to allow that.  Meanwhile, if you&#039;d like to take a shot at it, you can look at the section in recv() labeled &quot;// skip the stop bit&quot;.  Similarly, in the &quot;write&quot; routine, look at the stop bit delay at the very end of the routine.

Thanks for the note.

Mikal</description>
		<content:encoded><![CDATA[<p>Frits,</p>
<p>Yes, that is possible.  Someday when I get time I may modify the library to allow that.  Meanwhile, if you&#8217;d like to take a shot at it, you can look at the section in recv() labeled &#8220;// skip the stop bit&#8221;.  Similarly, in the &#8220;write&#8221; routine, look at the stop bit delay at the very end of the routine.</p>
<p>Thanks for the note.</p>
<p>Mikal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikal</title>
		<link>http://arduiniana.org/libraries/newsoftserial/comment-page-3/#comment-3942</link>
		<dc:creator>Mikal</dc:creator>
		<pubDate>Sat, 14 Aug 2010 23:41:36 +0000</pubDate>
		<guid isPermaLink="false">http://sundial.org/arduino/?page_id=61#comment-3942</guid>
		<description>Rolo,

It is important to wait for the byte to arrive, but rather than waiting an arbitrary number of milliseconds, why not just wait until NewSoftSerial tells you that the data arrived?

while (nsSerial.available == 0)
    ;


Mikal</description>
		<content:encoded><![CDATA[<p>Rolo,</p>
<p>It is important to wait for the byte to arrive, but rather than waiting an arbitrary number of milliseconds, why not just wait until NewSoftSerial tells you that the data arrived?</p>
<p>while (nsSerial.available == 0)<br />
    ;</p>
<p>Mikal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 433 MHz receiver and NewSoftSerial at mitat.tuu.fi</title>
		<link>http://arduiniana.org/libraries/newsoftserial/comment-page-3/#comment-3883</link>
		<dc:creator>433 MHz receiver and NewSoftSerial at mitat.tuu.fi</dc:creator>
		<pubDate>Tue, 10 Aug 2010 17:25:13 +0000</pubDate>
		<guid isPermaLink="false">http://sundial.org/arduino/?page_id=61#comment-3883</guid>
		<description>[...] http://arduiniana.org/libraries/newsoftserial/ http://www.sparkfun.com/commerce/product_info.php?products_id=8950 [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://arduiniana.org/libraries/newsoftserial/" rel="nofollow">http://arduiniana.org/libraries/newsoftserial/</a> <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8950" rel="nofollow">http://www.sparkfun.com/commerce/product_info.php?products_id=8950</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frits</title>
		<link>http://arduiniana.org/libraries/newsoftserial/comment-page-3/#comment-3879</link>
		<dc:creator>Frits</dc:creator>
		<pubDate>Tue, 10 Aug 2010 11:06:48 +0000</pubDate>
		<guid isPermaLink="false">http://sundial.org/arduino/?page_id=61#comment-3879</guid>
		<description>Hi Mikal

I want to use this library to communicate with a distance sensor (SRF485). The problem is this sensor uses 2 stop bits for both RX and TX. Is it possible to modify the library for 2 stop bits instead of 1 for both printing and reading? If so, can you please advise?

Thanks
Frits</description>
		<content:encoded><![CDATA[<p>Hi Mikal</p>
<p>I want to use this library to communicate with a distance sensor (SRF485). The problem is this sensor uses 2 stop bits for both RX and TX. Is it possible to modify the library for 2 stop bits instead of 1 for both printing and reading? If so, can you please advise?</p>
<p>Thanks<br />
Frits</p>
]]></content:encoded>
	</item>
</channel>
</rss>
