<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6560322381835327374</id><updated>2024-11-05T19:07:15.354-08:00</updated><category term="SoftwareSerial"/><category term="arduino"/><category term="atmega318"/><category term="avr"/><category term="libraries"/><category term="microcontrolers"/><category term="serial communication"/><title type='text'>A little bit about software</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://software-bits.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6560322381835327374/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://software-bits.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Otto</name><uri>http://www.blogger.com/profile/07343664395963305385</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6560322381835327374.post-2782156003270742834</id><published>2011-10-08T19:29:00.000-07:00</published><updated>2011-10-08T19:38:10.327-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="arduino"/><category scheme="http://www.blogger.com/atom/ns#" term="atmega318"/><category scheme="http://www.blogger.com/atom/ns#" term="avr"/><category scheme="http://www.blogger.com/atom/ns#" term="libraries"/><category scheme="http://www.blogger.com/atom/ns#" term="microcontrolers"/><category scheme="http://www.blogger.com/atom/ns#" term="serial communication"/><category scheme="http://www.blogger.com/atom/ns#" term="SoftwareSerial"/><title type='text'>Using SoftwareSerial library - Arduino</title><content type='html'>A few days ago I was playing around with an &lt;a href=&quot;http://www.sparkfun.com/products/9395&quot;&gt;LCD&lt;/a&gt; bought on &lt;a href=&quot;http://www.sparkfun.com/&quot;&gt;Sparkfun&lt;/a&gt;&amp;nbsp;and decided to use the SoftwareSerial library, so I could have a dedicated connection with the LCD and also be able to use the default serial port for other purposes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;a href=&quot;http://www.arduino.cc/en/Reference/SoftwareSerial&quot;&gt;SoftwareSerial&lt;/a&gt;&amp;nbsp;is a library included with the Arduino IDE that lets you configure extra serial ports on any two digital pins available on the Arduino board.&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
I was able to make the library work using the little example from the library, but I started to have some weird characters in the screen at the moment of boot up. At the beginning I thought that there was noise in the line.... and I tried lots of things:&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;I started to get complicated solutions. The first thing I thought was to make low pass filter, which would reject all the high frequency noise that I was suspecting. But then I thought that would not work since serial communication signals are not periodic, it will always depend on what you are sending.&lt;/li&gt;
&lt;li&gt;Then I thought&amp;nbsp;of something else! I made a twisted pair cable to connect the LCD with the arduino board, believing that it would filter any noise present in the line... It didn&#39;t work&lt;/li&gt;
&lt;/ul&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;i&gt;The solution...&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
So after wrong conclusions, I went back to the basics.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://courses.cit.cornell.edu/eceprojectsland/STUDENTPROJ/2004to2005/homeNet/HomeNetWebpage/Communication_files/image004.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;183&quot; src=&quot;http://courses.cit.cornell.edu/eceprojectsland/STUDENTPROJ/2004to2005/homeNet/HomeNetWebpage/Communication_files/image004.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;What was the problem? The problem was that when the arduino chip was booting up I got very weird characters that messed up the splash screen. And it was interesting that when I tried the screen with the default serial port, nothing strange happened, no &quot;noise&quot;. So the problem might be in the process of assigning this pin to the serial port, when the pin (TX the only one used by the screen) is configured as output.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;First thing, what the serial communication signal looks like?&lt;/li&gt;
&lt;li&gt;So there it was... in order to avoid the initial characters sent to the screen during the arduino boot up, I needed to avoid that line getting low: a low state would make the screen think that it was a start bit and made it ready to receive.&lt;/li&gt;
&lt;li&gt;The solution was simple, I added a pull up resistor (between +5V and the TX line of the arduino) so that while the arduino was booting up, the pin will always be high and no erroneous characters would be sent.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
After that, I did not have any trouble with the screen and everything was sent perfect!&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://software-bits.blogspot.com/feeds/2782156003270742834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-bits.blogspot.com/2011/10/using-softwareserial-library-arduino.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6560322381835327374/posts/default/2782156003270742834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6560322381835327374/posts/default/2782156003270742834'/><link rel='alternate' type='text/html' href='http://software-bits.blogspot.com/2011/10/using-softwareserial-library-arduino.html' title='Using SoftwareSerial library - Arduino'/><author><name>Otto</name><uri>http://www.blogger.com/profile/07343664395963305385</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>