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.

TM4C123BH6ZRB: TM4C123BH6ZRB

Part Number: TM4C123BH6ZRB

Hi I want to use RS485 at 10 MBPs. I have configured the UART at 10 MBPs but I'm getting framing errors on bus. When I try at 115200 baud rate, all works fine. BTW I set my system clock to 80 MHz. Kindly could yo please guide me on this. See my code snippet below. Thanks

Regards,

Moh

//
// Enable UART5 so that we can configure the clock.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART5);

//
// Enable GPIO port E which is used for UART5 pins.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);

//
// Configure the pin muxing for UART5 functions on port E4 and E5.
//
ROM_GPIOPinConfigure(GPIO_PE4_U5RX);
ROM_GPIOPinConfigure(GPIO_PE5_U5TX);

//
// Select the alternate (UART) function for these pins.
//
ROM_GPIOPinTypeUART(GPIO_PORTE_BASE, GPIO_PIN_4);
ROM_GPIOPinTypeUART(GPIO_PORTE_BASE, GPIO_PIN_5);

//
// Initialize the UART for console I/O.
//
ROM_UARTConfigSetExpClk(UART5_BASE, ROM_SysCtlClockGet(), 10000000L,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));

//

// Only enable RX and TX interrupts

//
ROM_UARTIntEnable(UART5_BASE, UART_INT_RX | UART_INT_RT);
ROM_UARTEnable(UART5_BASE);
ROM_UARTFIFODisable(UART5_BASE);

  • Mohsin Mahmud said:
    ...  UART5  - when configured at 10 MBPs  - w/ RS485  - yields framing errors   ...  at 115200 baud rate, all works fine.

    Silent here - yet surely helpful - would be "reporting of your results" -  as you,  "Methodically progress beyond  "115Kbaud" - is that not true?     

    It is expected that your issue could lie w/in:

    • the frequency accuracy of your MCU
    • the frequency accuracy of your  "remote"  device(s)
    • limitations imposed by your  RS485 transceivers - at either (or both) ends
    • the quality, length & "applicability" of your  "interconnect cabling"
    • while "less likely" - the presence of  RF sources and/or  Noise sources - which impact "either end" (after the benefits of the differential signal transfer are lessened)

    I cannot find your code which,  "Sets the System Clock."      Use of the "MCU's internal "PIOSC" clock source"  is "unlikely" to provide the timing accuracy required.

    As to "frequency deviation" - look especially for,  "One side "fast" - the other  "slow!"    This magnifies "timing error" - and proves more noticeable as your data rate increases.

    You must realize that such issues are best diagnosed w/the benefit of a "scope" - placed at  "each signal end."    (and with the signal traversing the "full" cable length.)

    Note too that your Post's Title:  "MCUxyz:  MCUxyz" - presents no insight  - nor provokes reader interest  - at all!    

    Such (usually) discourages readers - due to the "emptiness" of  such  ill considered, "headline!"     (all posters here "compete for attention" - the purpose of  your post's Title is to,  "DRAW READER EYES!")    Blind part number "repetition" - fails miserably - in this regard!       (and has past been noted & advised!)

  • Hi cb1,
    Thank you. You provide all the guidance and suggestions that I will do the same.