EmbeddedRelated.com
Forums

uart tx fails at 115200 speed.

Started by t_aaltio March 27, 2005

I'v a strange problem when using UART in msp430f149.
At lower speeds UART works ok, but at at 115200 speed it sends
duplicate characters. Below is a test (after initializing), which
should result msp430 sending character "*". insted it sends
"**". 
    dint();
    TXBUF0 = '*';
    while(1);
According to debugger (gdb) code executes as inteded.
Have ever seen this kind on duplicate characters? 








Beginning Microcontrollers with the MSP430

How are you testing it? Make sure this is NOT an artifact of your 
receiver, or test. set up. I would capture the signal with a storage scope.

Al

t_aaltio wrote:

>
>I'v a strange problem when using UART in msp430f149.
>At lower speeds UART works ok, but at at 115200 speed it sends
>duplicate characters. Below is a test (after initializing), which
>should result msp430 sending character "*". insted it sends
"**". 
>    dint();
>    TXBUF0 = '*';
>    while(1);
>According to debugger (gdb) code executes as inteded.
>Have ever seen this kind on duplicate characters? 
>
>
>
>
>
>
>
>
>
>.
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>
>
>
>  
>


Have you got 'local echo' turned on in HyperTerminal?


----- Original Message ----- 
From: "Onestone" <onestone@ones...>
To: <msp430@msp4...>
Sent: Wednesday, March 30, 2005 10:10 AM
Subject: Re: [msp430] uart tx fails at 115200 speed.


>
> How are you testing it? Make sure this is NOT an artifact of your
> receiver, or test. set up. I would capture the signal with a storage 
> scope.
>
> Al
>
> t_aaltio wrote:
>
>>
>>I'v a strange problem when using UART in msp430f149.
>>At lower speeds UART works ok, but at at 115200 speed it sends
>>duplicate characters. Below is a test (after initializing), which
>>should result msp430 sending character "*". insted it sends
"**".
>>    dint();
>>    TXBUF0 = '*';
>>    while(1);
>>According to debugger (gdb) code executes as inteded.
>>Have ever seen this kind on duplicate characters?
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>.
>>
>>
>>Yahoo! Groups Links
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
> .
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
> =======================================================================>
Spam and Virus filtering by Mail Security      www.mailsecurity.net.au
> Forward undetected SPAM to:                   spam@spam...
> =======================================================================>
> 



======================================================================= Spam and
Virus filtering by Mail Security      www.mailsecurity.net.au
 Forward undetected SPAM to:                   spam@spam...
=======================================================================

If you are using IAR's C-SPY (I'm not sure if it does happens
with other
tools) you will se MSP running for some time just after programming the chip
and before C-SPY stop waiting user's commands.
In this case you can have your code running twice and sending two *s.
-Augusto



-----Original Message-----
From: David Lions [mailto:dlions@dlio...] 
Sent: Tuesday, March 29, 2005 9:47 PM
To: msp430@msp4...
Subject: Re: [msp430] uart tx fails at 115200 speed.



Have you got 'local echo' turned on in HyperTerminal?


----- Original Message ----- 
From: "Onestone" <onestone@ones...>
To: <msp430@msp4...>
Sent: Wednesday, March 30, 2005 10:10 AM
Subject: Re: [msp430] uart tx fails at 115200 speed.


>
> How are you testing it? Make sure this is NOT an artifact of your 
> receiver, or test. set up. I would capture the signal with a storage 
> scope.
>
> Al
>
> t_aaltio wrote:
>
>>
>>I'v a strange problem when using UART in msp430f149.
>>At lower speeds UART works ok, but at at 115200 speed it sends 
>>duplicate characters. Below is a test (after initializing), which 
>>should result msp430 sending character "*". insted it sends
"**".
>>    dint();
>>    TXBUF0 = '*';
>>    while(1);
>>According to debugger (gdb) code executes as inteded.
>>Have ever seen this kind on duplicate characters?
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>.
>>
>>
>>Yahoo! Groups Links
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
> .
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
> =======================================================================>
Spam and Virus filtering by Mail Security      www.mailsecurity.net.au
> Forward undetected SPAM to:                   spam@spam...
> =====================================================================>
=>
> 



======================================================================= Spam and
Virus filtering by Mail Security      www.mailsecurity.net.au
 Forward undetected SPAM to:                   spam@spam...
=======================================================================


.

 
Yahoo! Groups Links



 




-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.5 - Release Date: 29/3/2005
 


When I build the same project with uart speed set to 57kbs, It works
normally. With 115kbs, MSP430 sends duplicated characters always when
it's sending something. I mean it's not related to cpu reset. I'm
using TeraTerm on pc as terminal program. Local echo is off. 




Hi

Maybe the speed of the micro doesn't match the
frequency divider of the UART clock generator. Another
fact is the maximum speed of the 232 conversor. In a
MAX232, the max speed is 120 kbs.

Good luck.


--- t_aaltio <tuomas.aaltio@tuom...> wrote:
> 
> 
> When I build the same project with uart speed set to
> 57kbs, It works
> normally. With 115kbs, MSP430 sends duplicated
> characters always when
> it's sending something. I mean it's not related to
> cpu reset. I'm
> using TeraTerm on pc as terminal program. Local echo
> is off. 
> 
> 
> 
> 
> 
> .
> 
>  
> Yahoo! Groups Links
> 
> 
>     msp430-unsubscribe@msp4...
> 
>  
> 
> 
> 
> 


	
	
		
______________________________________________ 
Renovamos el Correo Yahoo!: 250 MB GRATIS! 
Nuevos servicios, m seguridad 
http://correo.yahoo.es

Just troubleshooting, this is what I'd do:

Throw it on a scope, to make sure the duplicate character is coming from the 
MSP. Looking at the tx line should make this pretty obvious. 

If it's indeed coming from the msp, change the code so that you can see
what's 
happening, for example, I'd just quickly add somehting that made an unused
io 
pin toggle high at the start of the tx interrupt (if you're using one) and 
low at the end, then scope that, to see if the interrupt is being kicked 
twice. If you're not using the interrupt, do it for whatever code section 
you're using for tx. 

I'd also try toggling the io ping at code start. Just to verify it's
not a 
reset issue. 

If it's not doubling the reset pin, or the tx pin, then you know it's
in your 
tx code, if it is doubling the tx pin, then your transmit code is being 
called twice from somewhere else. You can continue this process to whittle 
down where the doubling is occuring. 

-Micah 



On Sunday 03 April 2005 06:12 am, t_aaltio wrote:
>  When I build the same project with uart speed set to 57kbs, It works
>  normally. With 115kbs, MSP430 sends duplicated characters always when
>  it's sending something. I mean it's not related to cpu reset.
I'm
>  using TeraTerm on pc as terminal program. Local echo is off.
>
>
>
>
>
>  .
>
>
>
>
>
> .