<html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>AVRUARTSetup</title> <style type="text/css" media="all"> @import url("scilab_code.css"); @import url("xml_code.css"); @import url("c_code.css"); @import url("style.css"); </style> </head> <body> <div class="manualnavbar"> <table width="100%"><tr> <td width="30%"> <span class="previous"><a href="AVRUARTReceive.html"><< AVRUARTReceive</a></span> </td> <td width="40%" class="center"> <span class="top"><a href="section_35ee3b19a97c75b084122c05ac0777c6.html">Scilab 2 C Converter</a></span> </td> <td width="30%" class="next"> <span class="next"><a href="AVRUARTTransmit.html">AVRUARTTransmit >></a></span> </td> </tr></table> <hr /> </div> <span class="path"><a href="index.html">Scilab 2 C Converter</a> >> <a href="section_35ee3b19a97c75b084122c05ac0777c6.html">Scilab 2 C Converter</a> > AVRUARTSetup</span> <br /><br /> <div class="refnamediv"><h1 class="refname">AVRUARTSetup</h1> <p class="refpurpose">Function to Setup Serial Communication i.e UART or USART in ATmega16.</p></div> <div class="refsection"><h3 class="title">Parameters</h3> <dl><dt><span class="term">mode :</span> <dd><p class="para">integer, from 0 to 2</p></dd></dt> <dt><span class="term">baudrate :</span> <dd><p class="para">Enter one of the following available baudrates (2400 , 4800 , 9600 , 14400 , 19200 , 28800 , 38400 , 57600 , 768000 , 115200 , 230400 , 250000 , 1000000)</p></dd></dt> <dt><span class="term">stopbits :</span> <dd><p class="para">integer, (0 for one stopbit) or (1 for two stopbits)</p></dd></dt> <dt><span class="term">parity :</span> <dd><p class="para">integer, from 0 to 2</p></dd></dt></dl></div> <div class="refsection"><h3 class="title">Description</h3> <p class="para">This function Setup the UART or USART for Serial Communicaion between ATmega16 and different micro controllers or between ATmega16 and Computer.</p> <p class="para">mode can take values: <ul class="itemizedlist"><li><p class="para">0 for Asynchronous Normal mode</p></li> <li><p class="para">1 for Asynchronous Double Speed mode</p></li> <li><p class="para">2 for Synchronous mode</p></li></ul></p> <p class="para">parity can take values: <ul class="itemizedlist"><li><p class="para">0 for parity disabled</p></li> <li><p class="para">1 for even parity</p></li> <li><p class="para">2 for odd parity</p></li></ul></p> <p class="para">This is curretly dummy function. It provides no functionality but is required for providing support for generating C code for AVR.</p> <p class="para"></p></div> <div class="refsection"><h3 class="title">Examples</h3> <div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabid">AVRUARTSetup</span><span class="scilabopenclose">(</span><span class="scilabnumber">0</span><span class="scilabdefault">,</span><span class="scilabnumber">9600</span><span class="scilabdefault">,</span><span class="scilabnumber">0</span><span class="scilabdefault">,</span><span class="scilabnumber">0</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span> <span class="scilabcomment">//This function will enable UART Communication for ATmega16</span> <span class="scilabid">with</span> <span class="scilabnumber">9600</span> <span class="scilabid">as</span> <span class="scilabid">baudrate</span><span class="scilabdefault">,</span><span class="scilabid">one</span> <span class="scilabid">stop</span> <span class="scilabid">bit</span> <a class="scilabcommand" href="scilab://and">and</a> <span class="scilabstring">parity</span> <span class="scilabstring">disabled</span></pre></td><td valign="top"><a href="scilab://scilab.execexample/"><img src="ScilabExecute.png" border="0"/></a></td><td valign="top"><a href="scilab://scilab.editexample/"><img src="ScilabEdit.png" border="0"/></a></td><td></td></tr></table></div></div> <div class="refsection"><h3 class="title">See also</h3> <ul class="itemizedlist"><li class="member"><a href="AVRUARTTransmit.html" class="link">AVRUARTTransmit</a></li> <li class="member"><a href="AVRUARTReceive.html" class="link">AVRUARTReceive</a></li></ul></div> <div class="refsection"><h3 class="title">Authors</h3> <ul class="itemizedlist"><li class="member">Ashish Kamble</li></ul></div> <br /> <div class="manualnavbar"> <table width="100%"> <tr><td colspan="3" class="next"><a href="http://bugzilla.scilab.org/enter_bug.cgi?product=Scilab%20software&component=Documentation%20pages" class="ulink">Report an issue</a></td></tr> <tr> <td width="30%"> <span class="previous"><a href="AVRUARTReceive.html"><< AVRUARTReceive</a></span> </td> <td width="40%" class="center"> <span class="top"><a href="section_35ee3b19a97c75b084122c05ac0777c6.html">Scilab 2 C Converter</a></span> </td> <td width="30%" class="next"> <span class="next"><a href="AVRUARTTransmit.html">AVRUARTTransmit >></a></span> </td> </tr></table> <hr /> </div> </body> </html>