Factors deciding baud rate

Status
Not open for further replies.

Richa Verma

Newbie level 5
Joined
Jun 9, 2014
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
72
could anybody explain me the factors that decide the baud rate on which a communication device works?

Thanks in advance!
 

not sure about your question
are you looking for an explaination why a particular application would reqired a particular baud rate or what determines for baud rate when configuring a UART in a microcontroller?
 

As a general guidance, the higher baud rates implies on a length reduction of the transmission cable.
 

Hi horace1
I want to know about your 2nd option. "what determines for baud rate when configuring a UART in a microcontroller".
 

Hi,

The lower limit is: how many bits you want to transmit per time.
Then you have to multiply it by 1.25 (because of startbit and stopbit).
Then you need some headroom.
Also protocol may need some extra time..may be you need to transmit lost packages again.
Handshaking, full duplex, half duplex...

The upper limit depends on hardware (RS232, RS485), interface signaling, cable type, cable length...
Communication bridges in the signal lines (modem, bluetooth...)

Klaus
 

Hi Klaus

Thanks fo rthe explaination.

I am not getting why lower limit is multiplied with 1.25! How does multiplication factor 1.25 depends upon startbit and stopbit?


Richa
 

Communication devices have a digital and analog interface at each end for both transmit and receive.

The analog interface is more variable subject of speed with signal quality and bit error rate (BER)/ THe digital interface may be asynchronous and thus may be faster than the analog side. Synchronous channels tend to run at the same speed. ALthough UARTS can run at same speed as

Serial ports, running at the same speed as the RS-232 are still asynchronous but generally run 2x or more baud rate on the serial port than the RS-232 interface baud rate. You could call both digital but RS-232 is more exposed to noise, so we consider the Analog nature as a signal with certain impedance and bipolar voltage but is received like TTL at a 1.3V threshold.


Since reducing Analog bandwidth in broadcast or long cables saves costs or increases savings by sharing, baud rates can be reduced by many options of compressing bits per baud including N levels of phase, amplitude, or frequency, channels & paths and digital compression. ( e.g. 16 bits per baud symbol is common but 128 or more is possible, where modulation and protocols have great effects selected for different conditions , costs in bandwidth, frequency and faster baud rates require better signal/noise ratio or SNR.

There are many general factors such as ;
1. cost,
2. performance and
3. reliability.

Cost may increase with bit rate or bytes transferred or lower latency or distance of remote location and thus infrastructure costs or remote device costs or much higher cost/MB transferred ( e.g. satellite)

Performance may be affected by broadcast latency of audio-video so speed is not simply bandwidth required but latency or lag of channel be broadcast, shared, merged or combined with may sources.

Reliability can be auto-controlled with auto-baud rate where packet error rate is counted and after some threshold, baud rate is dropped by steps until error free for some period then increased by some step size. eg WiFi <1 to 54Mbps on 802.11g. This also affects performance.

- - - Updated - - -

Richa< I didn't know you were just talking about serial ports with modems.

You can run the serial COM port even slower than baud rate if you wanted, it just slows the byte rate.

But you are running fast byte rates and risk buffer overflow in hardware/software for any reason with/without flow control, a faster COM port will clear the buffer faster, allowing for more time to process the data, and less risk of buffer overflow. There are rules of thumb but each implementation has specific tradeoff, depending on interrupt stack size, CPU speed, DMA flow rates, hand-shaking latency and noise interference results, etc.

Ignoring any of these may cause errors in long haul transport.
 

Hi horace1
I want to know about your 2nd option. "what determines for baud rate when configuring a UART in a microcontroller".
you need to configure
1. the processor peripheral clock which is a function of the clock crystal and the oscillator configuration such as clock divisors, prescalers and postscalers, e.g. for a PIC24FJ256GB110 the configuration could look like (this supports clocking for a USB interface)
Code:
       _CONFIG1( JTAGEN_OFF & GCP_OFF & GWRP_OFF & FWDTEN_OFF & ICS_PGx2)
        _CONFIG2( PLL_96MHZ_ON & IESO_OFF & FCKSM_CSDCMD & OSCIOFNC_ON & POSCMOD_HS & FNOSC_PRIPLL & PLLDIV_DIV2 & IOL1WAY_ON)
2. the uart baud rate counter and divisor, e.g. for a dsPIC33EP256MU806 the UART initialisation could be
Code:
//  initialize UART
//   Input: baud rate
//   Output: 1 for OK, 0 if baud rate error > 3%
int UART2Init(const unsigned long int BAUDRATE)
{
     unsigned long int BAUDRATEREG = (((SYSCLK/2)+(8ul*BAUDRATE))/BRG_DIV2/BAUDRATE-1);
     unsigned long int BAUD_ACTUAL  = ((SYSCLK/2)/BRG_DIV2/(BAUDRATEREG+1));
     unsigned long int BAUD_ERROR   = ((BAUD_ACTUAL > BAUDRATE) ? BAUD_ACTUAL-BAUDRATE : BAUDRATE-BAUD_ACTUAL);
     unsigned long int BAUD_ERROR_PRECENT = ((BAUD_ERROR*100+BAUDRATE/2)/BAUDRATE);
// reconfigure the I/O pins if required
    iPPSInput (IN_FN_PPS_U2RX, IN_PIN_PPS_RPI119);       // dsPIC board pin 5
    iPPSOutput(OUT_PIN_PPS_RP120, OUT_FN_PPS_U2TX);      // pin 6
    U2BRG = BAUDRATEREG;		// set up baudrate
    U2MODE = 0;					// clear mode register
    U2MODEbits.BRGH = BRGH2;  		//divider is 16
    U2STA = 0;					// clear status
    _U2RXIF = 0;		// clear interrupt flag
    U2MODEbits.UARTEN = 1;		// enable UART
    U2STAbits.UTXEN = 1;		// enable reansmit
    if (BAUD_ERROR_PRECENT > 2) 
       { printf("UART2baud rate %lu error %lu%%\n", BAUDRATE, BAUD_ERROR_PRECENT);  return -1; }
    printf("UART2 baud rate %lu set up\n", BAUDRATE);
    return 0;
}

if you are looking at very high baud rates you need a clock crystal which will divide very accuratly such as a 7.3728MHz
e.g. 921600baud to a Lantronix XPORT Ethernet device
https://www.lantronix.com/device-networking/embedded-device-servers/xport.html
 

Hi,


I am not getting why lower limit is multiplied with 1.25! How does multiplication factor 1.25 depends upon startbit and stopbit?

If you want to transmit 1 byte = 8 bits of data then you need one extra stopbit and one extra start bit.
Making 10bits in total

10 transmit, 8 data = 10/8 = 1.25



Klaus
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…