This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
Dear TI Support Team,
I want to communicate with MSP430F5529 through the UART with baud rate 921600.
Is it possible? if yes, what is the correct configuration?
If not, what's the maximum baudrate ?
regards,
Haithem.
BTW, 5529 has USB hardware module, and (CDC / bulk) transfer can go up to 1 Mbyte/s.
Depend on MCLK and UCA source clock, UART can go up to 6 Mbps.
http://forum.43oh.com/topic/3413-msp430-uart-benchmark/
There are many online BR calculators for msp, here is mine for offline setup...
As shown in the datasheet, the maximum baud rate is 1 MHz.
The UART's clock source must be at least three times the baud rate (or at least sixteen times in oversampling mode). However, the USCI baud-rate generator tends to work best when it can divide the clock source by a large divisor, so you should make the clock source as fast as possible. How to calculate the resulting errors is shown in section 36.3.9 of the User's Guide; or just use the USCI UART Calculator. After playing with some valuest, it appears that 24 MHz is a good clock source.
Please note that the DCO is not very accurate and introduces jitter; you need to take the clock source directly from a 24 MHz crystal (oscillator).
Dear Clemens,
Thank you for your reactivity!
Could you please help me to correctly configure UART registers and connect the BRsclk source clock directly to the external crystal source?
Note that in my board I have to crystal one 24MHZ ( ABM3B-24.000MHZ-10-1-U-T ) the second is 32.768KHZ,I need to communicate with an external peripheric(not a host) through high-speed UART
Regards,
Haithem.
I have just tested my board with configuration as below, but I haven't received a good/correct data !
with 115200 : test OK / for baudrate (230400, 460800,921600 ) test NOK missed and wrong data.
Test condition : My board connected to PC through EZ-FET with UART conexions ( MCU(MSP430 <--> EZ-FET UART Bridge <---> PC)
UART Configuration :
Any suggestion or advice, please?!
Here is setup for 1 Mbps, with 24 MHz XT2 MCLK as UART clock source. 24 / 18h = 24 / 24 = 1 Mbps (no error).
I guess that eZ-FET Lite USB / UART bridge is limited to some fixed baudrate values, like MSP-FET.
There is no problem with 2xx/5xx device UART on higher rates. Here you can see my dual bridge with 2xx device in action on 4 Mbps.
mov.w #WDTPW + WDTHOLD, &WDTCTL
mov.b &CALBC1_16MHZ, &BCSCTL1
mov.b &CALDCO_16MHZ, &DCOCTL
bis.b #UCSWRST, &UCA0CTL1
bis.b #(BIT5 + BIT4), &P3SEL ; P3.4/P3.5 = TXD/RXD
bis.b #UCSSEL_2, &UCA0CTL1 ; SMCLK
; 16000000 Hz 4000000 bps
mov.b #004h, &UCA0BR0
mov.b #000h, &UCA0BR1
bis.b #(UCBRS_0 + UCBRF_0), &UCA0MCTL
bic.b #UCSWRST, &UCA0CTL1
mov.w #70, R14
mov.b #32, R15
Loop bit.b #UCA0TXIFG, &IFG2
jnc Loop
mov.b R15, &UCA0TXBUF
add.b #1, R15
cmp.b #127, R15
jne Loop
mov.b #32, R15
sub.w #1, R14
jnz Loop
When the CPU runs at 24 MHz, and the baud rate is about 1 MHz, you have 24 cycles to handle a byte.
That code can be optimized. Read RXBUF only once and put it into a local variable. Don't try to do all error checking in the interrupt handler; when you get a START_DATA_HEADER, just read seven bytes into the buffer, and check in the main loop.
It might be a better idea to use DMA to read a block of bytes from the UART.
Haithem Rahmouni said:Could you please tell me what type of problem we can appear in fast mode ?
You can do it without DMA. My dual bridge code receiving at 4 Mbps from 2 ports, and it is done without DMA. From my experience, DMA in this case make things more complicated, not faster.
Just store received bytes in circular buffer inside ISR. Other processing (analyzing circular buffer contest) can be done outside ISR.
**Attention** This is a public forum