EmbeddedRelated.com
Forums

What is the max baud rate of the UART?

Started by marquishk October 17, 2004

Dear all,

    I have question about the UART. What is the max baud rate of the
USART in MSP430? By the way, I have to communicate with a 16C550 UART
(by TI). Is it possible to have a baud rate higher than 115200?


Thanks,
Marquis







Beginning Microcontrollers with the MSP430

I've run the MSP UART at 230K though there was not much time 
for anything else.

Regards
-Bill Knight
R O SoftWare


On Sun, 17 Oct 2004 06:22:26 -0000, marquishk wrote:




>Dear all,

>    I have question about the UART. What is the max
baud rate of the
>USART in MSP430? By the way, I have to communicate with a 16C550 UART
>(by TI). Is it possible to have a baud rate higher than 115200?


>Thanks,
>Marquis









>.

> 
>Yahoo! Groups Links



> 







I've run the UART at 1.536 MBps. (async)
That was with a 6.144 MHz XT2 Xtal.
The Max. you can run the UART is 1/3 of the chosen clock !!
This was done in IAR C, and there was time to service other INTs
and misc stuff.
You have to be careful how you set up your ISR if you use C.
(check the clocks used for ISR with SIM)
For example, back then with IAR C using global static variables inside
the ISR was much more efficient than using static locals to the ISR etc.

-- Kris

----- Original Message -----
From: "marquishk" <marquix@marq...>
To: <msp430@msp4...>
Sent: Sunday, October 17, 2004 4:22 PM
Subject: [msp430] What is the max baud rate of the UART?


>
>
> Dear all,
>
>     I have question about the UART. What is the max baud rate of the
> USART in MSP430? By the way, I have to communicate with a 16C550 UART
> (by TI). Is it possible to have a baud rate higher than 115200?
>
>
> Thanks,
> Marquis
>
>
>
>
>
>
>
>
> .
>
>
>
>
>       
>
>
>
>
>
> --
------
> .
>
>


Hi,
I use 250kbaud for DMX line (UART mode) in moving lights (moving heads, scans,
spots,...) and I have no problem. I'm using 8MHz XTAL and interrupt for
receiving/transmitting.

Jarda
  --------------
  Dear all,

      I have question about the UART. What is the max baud rate of the
  USART in MSP430? By the way, I have to communicate with a 16C550 UART
  (by TI). Is it possible to have a baud rate higher than 115200?


  Thanks,
  Marquis







Hi,
if i remember correctly, there was a practical limit to receive fast 
incoming data streams by the MSP430 of about 230 kBaud, which means 1 
character in about 40 usec. Above that, in an interrupt-driven serial 
package characters were lost, when the MSP430 was running at 6 MHz.

This was true unless all other interrupts were suppressed. You can also 
increase speed by polling the UART, but this means the MSP430 will be 
dead for anything else for the duration of a packet. Example: Receiving 
256 bytes at 1 MBaud will take about 2560 usec. If that deadtime is 
acceptable...

For transmitting data from the MSP430 similar limits apply. Using 
interrupts you will hardly reach full bandwidth beyond 230 kBaud. Using 
higher baud rates, you just insert more stop bits.

You can choose a MSP430 device with DMA hardware. That could help 
achieve better results. And if it is true that we can run them at 16 
MHz, we could get data streams of 500 kBytes per second, which compares 
to USB 1.1 or 10 MHz ethernet.

Regards
D. Teuchert

microbit wrote:

>I've run the UART at 1.536 MBps. (async)
>That was with a 6.144 MHz XT2 Xtal.
>The Max. you can run the UART is 1/3 of the chosen clock !!
>This was done in IAR C, and there was time to service other INTs
>and misc stuff.
>You have to be careful how you set up your ISR if you use C.
>(check the clocks used for ISR with SIM)
>For example, back then with IAR C using global static variables inside
>the ISR was much more efficient than using static locals to the ISR etc.
>
>-- Kris
>
>----- Original Message -----
>From: "marquishk" <marquix@marq...>
>To: <msp430@msp4...>
>Sent: Sunday, October 17, 2004 4:22 PM
>Subject: [msp430] What is the max baud rate of the UART?
>
>
>  
>
>>Dear all,
>>
>>    I have question about the UART. What is the max baud rate of the
>>USART in MSP430? By the way, I have to communicate with a 16C550 UART
>>(by TI). Is it possible to have a baud rate higher than 115200?
>>
>>
>>Thanks,
>>Marquis
>>
>>
>>
>>
>>
>>
>>
>>
>>.
>>
>>
>>
>>
>>      
>>
>>
>>
>>
>>
>>--
>>    
>>
>------
>  
>
>>.
>>
>>
>>    
>>
>
>
>
>
>.
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>
>
>  
>

-- 
Dipl.-Phys. Dieter Teuchert
Software und Systeme
Postanschrift:



Telefon:
Telefax:
EMail Firma:
EMail perslich:
Internet:
	Rommelstr. 6
D-76571 Gaggenau
Germany

+49 7225 989253
+49 7225 989254
info@info...
dieter@diet...
_http://www.cadt.de_






  ----- Dieter Teuchert wrote: ----- 
  Hi,
  if i remember correctly, there was a practical limit to receive fast 
  incoming data streams by the MSP430 of about 230 kBaud, which means 1 
  character in about 40 usec. Above that, in an interrupt-driven serial 
  package characters were lost, when the MSP430 was running at 6 MHz.

----------
Well, you are right that between characters is "only" 40 usec, but
realize it means about 240 cycles with MSP runing at 6MHz and interrupt may take
about 30 cycles (I count: interrupt 6, PUSH reg 3, load address to reg 3,
transfer RXBUF to dest 3, increment dest address 5, POP reg 2 and RETI 5 =
27cycles; output is similar, but transfer from dest to TXBUF take 5cycles =>
all is 29cycles long), that means for full duplex you need cca 25% of CPU power
and 75% you can still use for data processing! In assembler you can reserve some
register for addressing and you spare more time.

Jarda




I used this setup for a medical product.
The MSP430 central unit was performing TDMA on 12 Nodes
(acquiring EEG,ECG,EMG etc) with a hopping rate close to Bluetooth's
(IIRC ~ 650 uS timeslots) in bursts on a ML2722 TRX at 1.536 MBps.
A Coolrunner CPLD handled all framing, clock sync, Manchester etc.
All channels' collected data was CONTINUOUSLY transferred to a PC 
at 115.2 kBps on the other UART at the Central unit.
The Slave nodes sent a burst of 512 bytes every 1/16 Sec in their TDMA slot.
while the F149 continuously sampled at a 80 Hz rate or so for the electrodes.
The firmware was abonimally complex, the network was extremely reliable,
goes to show that you CAN squeeze every drop out of an F149 writing in C..,
(I used IAR back then, now faithful CrossWorks user)
The slaves' average current was a mere 1.2 mA !!!! (MSP430 + RF + Analog
frontend)
:-)
So basically, yes it wasn't a cont stream, but I did have INTs for the
timer running.
I spent a great deal of time though cheking the feasibility of timing thru INTs
in my system design.
The main reason this was possible is because of MSP430's extremely flexible
ADC (ie. 16 samples buffered before an INT is needed amongst others)
NO OTHER low power MCU could have even remotely pulled off this job !

PS : This will stir up things again I guess, but my conviction is that in C
the trick is not to know C as much as knowing your ACTUAL compiler, and its
quircks, albeit how to get best performance - and that indeed you can get what
you
can get in ASM, given the right thought and project.
Written in ASM I would have gotten a marginal improvement hardly worth the all
extra effort.
(I'm sorry Al and Jon :-)

-- Kris


Hi,
if i remember correctly, there was a practical limit to receive fast 
incoming data streams by the MSP430 of about 230 kBaud, which means 1 
character in about 40 usec. Above that, in an interrupt-driven serial 
package characters were lost, when the MSP430 was running at 6 MHz.

This was true unless all other interrupts were suppressed. You can also 
increase speed by polling the UART, but this means the MSP430 will be 
dead for anything else for the duration of a packet. Example: Receiving 
256 bytes at 1 MBaud will take about 2560 usec. If that deadtime is 
acceptable...

For transmitting data from the MSP430 similar limits apply. Using 
interrupts you will hardly reach full bandwidth beyond 230 kBaud. Using 
higher baud rates, you just insert more stop bits.

You can choose a MSP430 device with DMA hardware. That could help 
achieve better results. And if it is true that we can run them at 16 
MHz, we could get data streams of 500 kBytes per second, which compares 
to USB 1.1 or 10 MHz ethernet.

Regards
D. Teuchert

microbit wrote:

>I've run the UART at 1.536 MBps. (async)
>That was with a 6.144 MHz XT2 Xtal.
>The Max. you can run the UART is 1/3 of the chosen clock !!
>This was done in IAR C, and there was time to service other INTs
>and misc stuff.
>You have to be careful how you set up your ISR if you use C.
>(check the clocks used for ISR with SIM)
>For example, back then with IAR C using global static variables inside
>the ISR was much more efficient than using static locals to the ISR etc.
>
>-- Kris
>
>----- Original Message -----
>From: "marquishk" <marquix@marq...>
>To: <msp430@msp4...>
>Sent: Sunday, October 17, 2004 4:22 PM
>Subject: [msp430] What is the max baud rate of the UART?
>
>
>  
>
>>Dear all,
>>
>>    I have question about the UART. What is the max baud rate of the
>>USART in MSP430? By the way, I have to communicate with a 16C550 UART
>>(by TI). Is it possible to have a baud rate higher than 115200?
>>
>>
>>Thanks,
>>Marquis
>>
>>
>>
>>
>>
>>
>>
>>
>>.
>>
>>
>>
>>
>>      
>>
>>
>>
>>
>>
>>--
>>    
>>
>------
>  
>
>>.
>>
>>
>>    
>>
>
>
>
>
>.
>
> 
>. 






Hi Jaromir,
in my designs i have serial drivers with circular buffers, that require 
a little more cycles per character. And in general for my data streams i 
want some kind of protocol, e.g. recognize "event characters" like a
LF 
or CR/LF.

Other interrupts may very well block for some 20 to 40 usec, unless you 
reenable interrupts in other interrupt service routines. But then you 
end up with a timing scheme very similar to polling.

The idea i'd like to promote: Unless you have DMA, the effective 
bandwidth limit is largely determined by your software environment. 
Writing a RTOS with well balanced drivers requires experience and tuning.

Regards
Dieter Teuchert

Jaromir Subcik wrote:

>  ----- Dieter Teuchert wrote: ----- 
>  Hi,
>  if i remember correctly, there was a practical limit to receive fast 
>  incoming data streams by the MSP430 of about 230 kBaud, which means 1 
>  character in about 40 usec. Above that, in an interrupt-driven serial 
>  package characters were lost, when the MSP430 was running at 6 MHz.
>
>----------
>Well, you are right that between characters is "only" 40 usec, but
realize it means about 240 cycles with MSP runing at 6MHz and interrupt may take
about 30 cycles (I count: interrupt 6, PUSH reg 3, load address to reg 3,
transfer RXBUF to dest 3, increment dest address 5, POP reg 2 and RETI 5 =
27cycles; output is similar, but transfer from dest to TXBUF take 5cycles =>
all is 29cycles long), that means for full duplex you need cca 25% of CPU power
and 75% you can still use for data processing! In assembler you can reserve some
register for addressing and you spare more time.
>
>Jarda
>
>
>
>
>
>
>.
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>
>
>  
>

-- 
Dipl.-Phys. Dieter Teuchert
Software und Systeme
Postanschrift:



Telefon:
Telefax:
EMail Firma:
EMail perslich:
Internet:
	Rommelstr. 6
D-76571 Gaggenau
Germany

+49 7225 989253
+49 7225 989254
info@info...
dieter@diet...
_http://www.cadt.de_






Hi Dieter,

> in my designs i have serial drivers with circular
buffers, that require 
> a little more cycles per character. And in general for my data streams i 
> want some kind of protocol, e.g. recognize "event characters"
like a LF 
> or CR/LF.

There's the missing link...
I used a Coolrunner to handle all packet stuff, eg. recognising a 32 bit
Frame Check Sequence, and state machine to "call" the MSP430 when
there's a valid packet rolling in etc.
The MSP430 still did handle CRC16, packet DLL length calc etc. on the fly
though.

PS : My fondest memory of the name Dieter was seeing the Dieter Dirks
Mobile studios at work at an Accept (German Heavy metal band) concert :-)
I even played Stefan Kaufmann's "super-drums" after their
soundcheck !!
Well, he didn't know about it , heh.
(I used to play drums in a Belgian HM band )

-- Kris