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.

baud rate help F28377D SCI-B

im having a bit of trouble understanding how to change the baud rate on the SCI port (specifically SCI-B).

i have it on the 9600 baud mode and everything is working, but ready to move it up to a faster speed now. 

im sure you can tell me how to get it to 115200, which i appreciate, but i would also like to understand how to get it there also.. We are able to go even faster then 115200 as we are using RS485 port... But the code for the 115200 would help with current issue, and a better understanding on controlling the speed would be great..

(both is needed though) :)

//-----------------current code for baudrate------(used from echoback example but updated for SciB )

    // SCIA at 9600 baud .  (<--want to reach 115200 baud)

    // @LSPCLK = 50 MHz (200 MHz SYSCLK) HBAUD = 0x02 and LBAUD = 0x8B.

    // @LSPCLK = 30 MHz (120 MHz SYSCLK) HBAUD = 0x01 and LBAUD = 0x86.

    ScibRegs.SCIHBAUD.all = 0x0002;

    ScibRegs.SCILBAUD.all = 0x008B;

//--------------

thanks

chuck

  • Hi Chuck,

    Here's the extract from one of my lab sessions for F28027 based C2000 launchpad:

    Please check the LSPCLK value for your device and calculate accordingly.

    Regards,

    Gautam

  • I see your answer, and understand it, yet it doesn't add up. The code I displayed is part of a example for my card and works at 9600 baud. But when I run the formula I do not get the same values as entered inthe baud rate field.

    At 200mhz (LSPCLk =50mhz) so:

    50000000/(9600*8)-1 = 650 (0x028A)
    This is not what is entered in my code yet works. Please advise where I have gone wrong. The CODE I Showed, shows the LSPClK INFO ALSO.

    Thanks

    Chuck
  • Chuck, how much is the deviation from the calculated value?
  • This is the code I originally posted.
    _------------
    //-----------------current code for baudrate------(used from echoback example but updated for SciB )

    // SCIA at 9600 baud . (<--want to reach 115200 baud)

    // @LSPCLK = 50 MHz (200 MHz SYSCLK) HBAUD = 0x02 and LBAUD = 0x8B.

    // @LSPCLK = 30 MHz (120 MHz SYSCLK) HBAUD = 0x01 and LBAUD = 0x86.

    ScibRegs.SCIHBAUD.all = 0x0002;

    ScibRegs.SCILBAUD.all = 0x008B;

    //--------------


    And this is the answer I posted last reply I did.
    --_---------------
    At 200mhz (LSPCLk =50mhz) so:

    50000000/(9600*8)-1 = 650 (0x028A)
    This is not what is entered in my code yet works. Please advise where I have gone wrong. The CODE I Showed, shows the LSPClK INFO ALSO.

    -------------------
    So this is what the example code uses:


    // @LSPCLK = 50 MHz (200 MHz SYSCLK) HBAUD = 0x02 and LBAUD = 0x8B

    And this is what I get:

    50000000/(9600*8)-1 = 650 (0x028A)

    ,Note: I am out of time also... I need the numbers to input to reach 115200 speed today. Understanding how to get isn't as important as getting the code to work by this afternoon.

    Thanks

    Chuck

  • Chuck,

    Were you able to resolve your questions on your own? The section that Gautam quoted is the correct calculation. The SCI Baud rates are reasonably tolerant to clock rates that are not exact. This is because there are different sampling points within the module to allow for some jitter of the bit lengths. Refer to the TRM for more information on this.

    -Mark