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.

TMS320F28379D: SCI baud rate outputting half of expected value

Part Number: TMS320F28379D

Hello everyone, 

I've been trying to get output signals at 1200 baud rate on my SCI transmit line. For some reason, I keep on an output that is exactly half of what I would expect. 

I am using the following formula (page 2284 of the F28379D technical manual):

SCI Asynchronous Baud = LSPCLK / ((BRR + 1)*8)

I've set up the LSPCLK to 50 MHz. The F28379D has a system clock of 200 MHz if I'm not mistaken. I've set the low speed clock prescaler to 1/4, so LSPCLK should be 50MHz.

Using the formula above, for a baud rate of 1200 Bd, I get the value of  0x1457 to put in my baud rate registers (SCIHBAUD and SCILBAUD).

I've set up my SCI signal as follows: 1 stop bit, no parity, 8 character bits and idle line protocol. Adding the start, data and stop bits, altogether I have 10 bits in each message. I'm dividing the time it takes for these 10 bits to send by the time it takes to get my actual baud rate.

I'm not sure why, but I'm always getting a value that is half the intended baud rate (in this case, I'm seeing a baud rate of 600 Bd instead of 1200 Bd)

I was wondering why this might be the case?

Best wishes,
Eric 

  • Hi Eric,

    Thank you for your question, our SCI expert will get back to you as soon as possible.

  • Hi Eric,

    Are you using the F28379D launchpad? If so, you will need the '_LAUNCHXL_F28379D' predefine within your project to setup the clocks correctly.

    If not, what is your clock source? (Ex. External crystal of 10 or 20MHz?)

    Best Regards,

    Marlyn

  • Hello Marlyn,

    Hope you are doing well. Thank you for your reply. This resolved my issue - thank you very much.

    I was just wondering what file I could find these defines in, just to improve my understanding?

    Best wishes,

    Eric

  • Hi Eric,

    Glad that fixed your issue! 

    Within the 'Device_init();' function call that should be within your .c file, the clocks are being setup. If you open the declaration of this function (which lives in device.c) you'll see 'SysCtl_setClock' getting called. This function takes in 'DEVICE_SETCLOCK_CFG' as an input. Looking at how 'DEVICE_SETCLOCK_CFG' is being defined (within device.h), you'll see that this value is dependent on if you are using a 10Mhz or 20Mhz input clock (launchpad uses 10Mhz and a controlCARD uses 20Mhz).

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    //*****************************************************************************
    //
    // Launchpad Configuration
    //
    #ifdef _LAUNCHXL_F28379D
    //
    // 10MHz XTAL on LaunchPad. For use with SysCtl_getClock().
    //
    #define DEVICE_OSCSRC_FREQ 10000000U
    //
    // Define to pass to SysCtl_setClock(). Will configure the clock as follows:
    // PLLSYSCLK = 10MHz (XTAL_OSC) * 40 (IMULT) * 1 (FMULT) / 2 (PLLCLK_BY_2)
    //
    #define DEVICE_SETCLOCK_CFG (SYSCTL_OSCSRC_XTAL | SYSCTL_IMULT(40) | \
    SYSCTL_FMULT_NONE | SYSCTL_SYSDIV(2) | \
    SYSCTL_PLL_ENABLE)
    //
    // 200MHz SYSCLK frequency based on the above DEVICE_SETCLOCK_CFG. Update the
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Hope this helps! Please let me know if you have any other questions. 

    Best Regards,

    Marlyn