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.

CCS/LAUNCHXL-F28379D: F28379D sci_echoback_cpu01 clocking and BAUD issues

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hello!

I am having issues with the sci_echoback_cpu01 example in C2000Ware. As mentioned in this post, the actual baud rate is 4800 as opposed to 9600 as written in the comments section. I understand that I need to change the LSPCLK divider to get the desired baud rate (along with the SCIHBAUD and SCILBAUD). I am unsure about how and where to define the LSPCLK divider select. I tried adding the following lines of code after the GPIO_SetupPinOptions() function in the example (Example_2837xDSci_Echoback.c):

EALLOW;
ClkCfgRegs.LOSPCP.bit.LSPCLKDIV = 3;
EDIS;

However, the deafult value of 0x00000002 does not change when I view the corresponding register value while running the code. It does not seem to matter what value I specify for the LSPCLKDIV, but the default value remains. I speculate that it is being reset to the default value somewhere else in the code, but I do not know where. I want LSPCLK to provide 50 MHz, so I can use SCIHBAUD = 0x00 and SCILBAUD = 0x02, and get a baud rate of 2000000.

My questions:

  1. Where in the project do I specify the LSPCLK divider value?
  2. Are there a limited number of options for the LSPCLK divider select? If yes, what are they?
  3. Is the above code correct for configuring the LSPCLK divider select?
  4. Is there anything else I need to configure? If yes, where and how?
  5. Where can I find more details about the configurations of SCI for this microcontroller (or similar ones)?

Following is a snapshot of my code:

  • hi Srinivas ,

    Are you referring to the latest C2000ware where this has been fixed ?

    Please add "_LAUNCHXL_F28379D" to the predefined symbols under Project -> Properties -> C2000 compiler -> predefined symbols.

    This would enable the correct "device.h" settings needed for the launchpad before compiling.

    So currently the code is set for 

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

    • Where in the project do I specify the LSPCLK divider value?No need to update . use add predefined symbol and compile.

    Are there a limited number of options for the LSPCLK divider select? If yes, what are they?

    • Is the above code correct for configuring the LSPCLK divider select? 

    code is correct . But not needed . default is 0x4 and not 0x2.

    • Is there anything else I need to configure? If yes, where and how?

    Yes . as discussed above add the symbol in project proprieties.

    • Where can I find more details about the configurations of SCI for this microcontroller (or similar ones)?

    The device TRM would gives the details on the configurations 

    Regards.

  • Thanks Meghana.

    It works now, but I think that along with adding _LAUNCHXL_F28379D to the predifined symbols, it is necessary to manually set the LSPCLK divider value. I think so, because by back-calculating the LSPCLK from the observed baud rate of 4800 (and BRR = 651, i.e., 0x028B), we get LSPCLK = 25,036,800 (25 MHz), which means that the divider is 8 (200 MHz / 8 = 25 MHz). I manually set the divider value using the above code to 1, and it works now as expected. It still shows LOSPCP register value as 0x00000002 in the register viewer, but it seems to work when tested with a serial port. So my current configuration is LSPCLKDIV = 1, SCIHBAUD = 0x00, SCILBAUD = 0x02, thus, getting a baud rate of 2000000. Let me know if I am missing something.

    Regards,
    Samvrit

  • hi Samvrit,

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

    In that case if you needed 9600  (and BRR = 651, i.e., 0x028B) , LSPCLK  = 9600 *  ((0x028B+ 1) *8)

    LSPCLK  = 9600 *  ((0x028C) *8) = 50073600 ~= 50Mhz

    Check the table 19-3 in the Technical Reference Manual (Rev. G) for details.

    As far as the LSPCLKDIV  , yes the default value of the register is 0x2 but it translates to a default divider of 4 .( ie .LSPCLK  /4).

    "I manually set the divider value using the above code to 1" . This translates to divider of 2 ( ie.LSPCLK  /2 ). This works when you don't use the predefined symbol.

    There are 2 ways to configure this , either use the prefined symbol ONLY or make the updates to the divider.

    • The section of code in device.h ( after enabling the symbol) which translates to the LSPCLK  uses the system clock as 200Mhz , so a divide by 4 will result in 50 Mhz .
    • Or When by default (before enabling the symbol) which translates to the LSPCLK  uses the system clock as 100Mhz , so a divide by 4 will result in 25 Mhz. This can be corrected by updating divider to /2 instead of /4 which worked for you.

    Regards.

  • Thanks! That makes sense.

    Regards,

    Samvrit