<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="country-region"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.E-postmall17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=SV link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hi.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>I am managing some old uart code and find that the
data sent was incorrect because of that the character size was not set (UBRRC)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>But while checking the code I found this note in the
uart init file:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:11.0pt;font-family:"Courier New";color:black'>          </span></font><font
size=2 color=green face="Courier New"><span lang=EN-GB style='font-size:11.0pt;
font-family:"Courier New";color:green'>// Set to 8 bit frame length. (This is
done automaticly for compatibility but is showed her for clarity</span></font><font
size=2 color=black face="Courier New"><span lang=EN-GB style='font-size:11.0pt;
font-family:"Courier New";color:black'><br>
          </span></font><font size=2 color=green face="Courier New"><span
lang=EN-GB style='font-size:11.0pt;font-family:"Courier New";color:green'>//
SetBitMask(UART_UCSRC,(BIT(URSEL)|BIT(UCSZ1));         // Bit 7 is used to
direct the write operation to UCSRC</span></font><font size=2 color=black
face="Courier New"><span lang=EN-GB style='font-size:11.0pt;font-family:"Courier New";
color:black'><br>
<br>
<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=black face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:black'>Does anyone know if the
note about setting frame length to 8 bit automatically is correct for some AVR&#8217;s?
 It certainly is not for mega32. Also the commented line is incorrect as it
will set the frame length to 7 bits and not 8 as intended. This code have been
working for a long time just because that the actual data sent was (until now)
never using bit 8.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=black face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:black'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=black face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:black'>Best regards,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=black face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:black'>Bengt<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>________________________________________________________________<o:p></o:p></span></font></p>

<p style='margin:0cm;margin-bottom:.0001pt'><st1:PersonName
ProductID="Bengt Ragnemalm" w:st="on"><font size=3 face="Times New Roman"><span
 lang=EN-GB style='font-size:12.0pt'>Bengt Ragnemalm</span></font></st1:PersonName>                        <span
lang=EN-GB>Tel +46 13 22 24 97<o:p></o:p></span></p>

<p style='margin:0cm;margin-bottom:.0001pt'><font size=2 face="Times New Roman"><span
lang=EN-GB style='font-size:10.0pt'>Research engineer                                       FAX:
+46 13 10 19 02<o:p></o:p></span></font></p>

<p style='margin:0cm;margin-bottom:.0001pt'><font size=2 face="Times New Roman"><span
style='font-size:10.0pt'>Linköpings Universitet                                </span></font><font
size=2><span lang=EN-GB style='font-size:10.0pt'><a
href="mailto:bengt.ragnemalm@imt.liu.se"><font size=3><span lang=SV
style='font-size:12.0pt'>mailto:bengt.ragnemalm@imt.liu.se</span></font></a></span></font><font
size=2><span style='font-size:10.0pt'><o:p></o:p></span></font></p>

<p style='margin:0cm;margin-bottom:.0001pt'><font size=2 face="Times New Roman"><span
style='font-size:10.0pt'>Inst. för Medicinsk Teknik Internet:        </span></font><font
size=2><span lang=EN-GB style='font-size:10.0pt'><a
href="http://www.imt.liu.se/"><font size=3 color=purple><span lang=SV
style='font-size:12.0pt;color:purple'>http://www.imt.liu.se</span></font></a></span></font><font
size=2><span style='font-size:10.0pt'><o:p></o:p></span></font></p>

<p style='margin:0cm;margin-bottom:.0001pt'><font size=2 face="Times New Roman"><span
lang=EN-GB style='font-size:10.0pt'>S-581 85 Linköping <st1:country-region
w:st="on"><st1:place w:st="on">SWEDEN</st1:place></st1:country-region><o:p></o:p></span></font></p>

<p style='margin:0cm;margin-bottom:.0001pt'><font size=3 face="Times New Roman"><span
lang=EN-GB style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>