Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

baudrate for transmitting 3 decimals in 0.5msec

Status
Not open for further replies.

patan.gova

Full Member level 3
Full Member level 3
Joined
Dec 19, 2011
Messages
172
Helped
4
Reputation
8
Reaction score
0
Trophy points
1,296
Visit site
Activity points
2,776
Hello,
I need to transmit 3 decimal numbers that are resulted by converting a 12 bit unsigned binary in 0.5msec thorugh UART and I am working MSP430.Can some explain what should be the baudrate needed to send these numbers to terminal using UART in 0.5msec.
Thanks in Advance.
 

Normally a byte would carry one digit so you would need three bytes. (assuming ascii and not packed BCD)
Normally a byte has 10 bits, eight for the data, one start bit and one stop bit. (assuming standard 8N1)
So you have to transmit 30 bits in 0.5mS so each bit is 0.0005/30 = 0.000016666S long.
The Baud rate is 1/bit period and 1/0.00001666 = 60,000.
So the MINIMUM Baud rate would be 60,000 Bauds. You can use higher if you wish.

Brian.
 

Thanks for the explanation.
I am able to send the 1 ADC sample(unsigned 16 bit int) in 5.6ms as explained below
9600 bits per second
9 bits per character (start+7 data+stop=9)
1066.6 characters per second
0.9375 ms per character
6 ASCII characters per sample (4 ASCII character+CR+LF)
5.625 ms per sample.
But I wish to send 1 sample in<1ms and this will posiible uisng 57600 baudrate but I am confused with

The user's guide 3652.slau259e.pdf(aatched) page 595 is showing the required baudrate selection 57600 for UCBRx=18 if UCOS16 = 0.How to make UCOS16 = 0 so as to select UCBRx=0x18.Is this the right way of selecting the 57600 baudrate with UCA0CTL1 |= UCSSEL_2(for SMCLK) or is anything else is needed to be changed in the below code that use´s baudrate of 9600.

void UART_init(void)
{
PMAPPWD = 0x02D52; // Get write-access to port mapping regs
P1MAP5 = PM_UCA0RXD; // Map UCA0RXD output to P1.5
P1MAP6 = PM_UCA0TXD; // Map UCA0TXD output to P1.6
PMAPPWD = 0; // Lock port mapping registers

P1DIR |= BIT6; // Set P1.6 as TX output
P1SEL |= BIT5 + BIT6; // Select P1.5 & P1.6 to UART function

UCA0CTL1 |= UCSWRST; // **Put state machine in reset**
UCA0CTL1 |= UCSSEL_1; // CLK = ACLK
UCA0BR0 = 0x03; // 32kHz/9600=3.41 (see User's Guide)
UCA0BR1 = 0x00; //
UCA0MCTL = UCBRS_3+UCBRF_0; // Modulation UCBRSx=3, UCBRFx=0
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
UCA0IE |= UCRXIE;
}
thanks.
 

Attachments

  • 3652.slau259e.pdf
    4.5 MB · Views: 70

I'll have to leave that to someone with experience with Texas processors. From what I read from the data sheet, if your baud divisor is 0x03 and you are expecting 57,600 bauds it implies the BRCLOCK is 1MHz and that would give a speed error of up to 4.8%. As rule of thumb, 2% is just about the safe limit.

I've never used one of these processors though and a quick read of your data sheet link isn't really enough to work out what the correct settings may be. Hopefully someone else can confirm.

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top