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.

C6747 CLOCK, PINMUX & UART Configuration Questions

Other Parts Discussed in Thread: CCSTUDIO

Hi,

I have the C6747 starter kit with CCS v3.3 and BIO 5.33.05.  My application is an extension of the ti\pspiom\examples\evm6747\audio.  I have a the following questions:

1. From the CCS v3.3 IDE, I think the clock is configured in the DSP/BIOS Config->System->Global Settings Properties->General->DSP Speed in MHz (CLKOUT) 300.  I benchmarked my algorithm calculation at 300MHz and it took ~6 seconds.  I changed the DSP speed to 100MHz and ran the same algorithm. I expected the application take longer time but it took the same ~6 seconds.  Looks like by changing the DSP speed from the global setting did not make any different.  Why and what do we need to change the DSP speed?  One of my older projects, I set the PLL control registers manually.  Is this how I should get it done?  I thought the IDE helps us not to set the register manually.

2. The provided audio example shows no setting for PINMUX.  Do I have to setup these registers manually before the PLL setting?

3. I opened UART2 with baud rate 115200 with EVMC6747_UART_open from TI provided EVMC6747_UART.C.  Looks like at leastone of the control register value is not correct.  EVMC6747_UART.C PWREMU_MGMT has the value of 0xE001.  According to UART document SPRUFM6B 6/2010, this value should be 0x6001 since bit 15 is reserved.  I attempted to perform simple transmission with EVMC6747_UART_putChar() from the starter kit.  The host PC received the correct bytes (I think).  However, the data is all 0xFF.  I changed the FCR and IER control registers but it did not make any different.  I am afraid that there are more configuration that I am missing.  What is missing?

4. Is there a better single example code that you have that including UART, I2C, SPI, mcasp that I can use?

Thanks,

Dennis

  • Thank you for posting your questions. I will start with an answer to your first question and some suggestions for the others until you get the final answers.

    Dennis Nguyen said:
    1. DSP/BIOS Config->System->Global Settings Properties->General->DSP Speed in MHz (CLKOUT) 300

    You supply this parameter to DSP/BIOS so it can calculate the timer period for the CLK Clock Manager. This number must be supplied by you based on the setting that you know will be used in your design. The actual PLL settings must be configured elsewhere, either in the GEL files during CCS debug or during the secondary bootloader or initialization process for your application. DSP/BIOS does not directly support writing to the PLL registers.

    Dennis Nguyen said:
    2. The provided audio example shows no setting for PINMUX.  Do I have to setup these registers manually before the PLL setting?

    Both the PINMUX and PLL settings are usually handled during the boot and initialization process, and before reaching your application code.

    Dennis Nguyen said:
    3. EVMC6747_UART_open from EVMC6747_UART.C. 

    EVMC6747_UART.C PWREMU_MGMT has the value of 0xE001.  According to UART document SPRUFM6B 6/2010, this value should be 0x6001 since bit 15 is reserved.

    For your initial testing, I recommend getting the TI supplied example code working first, as is. Did you change the register value to the expected 0x6001 or did you leave it at 0xE001 for your testing? We need to get a correction in either the documentation or the code, but the code should be working correctly as it is supplied.

    Dennis Nguyen said:
    The host PC received the correct bytes (I think).  However, the data is all 0xFF.

    Do you mean that the C6747 UART transmitted to the host PC correctly but the C6747 UART only received 0xFF data? Does it ever receive data other than 0xFF? Can you observe the RXD signal to confirm that it looks like valid serial data?

    Dennis Nguyen said:
    4. Is there a better single example code that you have that including UART, I2C, SPI, mcasp that I can use?

    We offer example code for most peripherals separately unless an example requires multiple peripherals to operate in a related fashion. Have you found examples for each of the peripherals that you need to use?

  • Hi Dennis

    Please note that the platform specific files (including PINMUX settings) can be found in

    \ti\pspiom\platforms\evm6747 directory  (e.g. audio_evmInit.c has the Pinmux settings for McASP and I2C etc).

     

  • "You supply this parameter to DSP/BIOS so it can calculate the timer period for the CLK Clock Manager. This number must be supplied by you based on the setting that you know will be used in your design. The actual PLL settings must be configured elsewhere, either in the GEL files during CCS debug or during the secondary bootloader or initialization process for your application. DSP/BIOS does not directly support writing to the PLL registers."

    [Dennis] What is the DSP speed in the sample code from ti\pspiom\examples\evm6747\audio?  Since this sample code does not set any PLL register, I would like to know what the DSP speed is that we ran the benchmark with.

  • Taking a closer look at your questions, and adding on top of what Randy already mentioned

    Dennis Nguyen said:
    I opened UART2 with baud rate 115200 with EVMC6747_UART_open from TI provided EVMC6747_UART.C.  Looks like at leastone of the control register value is not correct.  EVMC6747_UART.C PWREMU_MGMT has the value of 0xE001.  According to UART document SPRUFM6B 6/2010, this value should be 0x6001 since bit 15 is reserved.  I attempted to perform simple transmission with EVMC6747_UART_putChar() from the starter kit.  The host PC received the correct bytes (I think).  However, the data is all 0xFF.  I changed the FCR and IER control registers but it did not make any different.  I am afraid that there are more configuration that I am missing.  What is missing?

    Hi Dennis

    The value that should be written to PWREMU_MGMT should be 0x6001 and not 0xE001. The function of bit 15 has been pulled out of the documentation and bit 15 is correctly marked as Reserved. We may update the UG to reflect that bit 15 may read 1 in some cases, but it should always be written as 0. I don't think that is causing the issues that you are facing.

    Do you have answers for the other questions on #3 that RandyP asked in his response post? This will help understand your issue at hand better.

    Dennis Nguyen said:
    Is there a better single example code that you have that including UART, I2C, SPI, mcasp that I can use?

    The individual peripheral examples in the PSP are what TI delivers for the C6747. If you run into problems using multiple peripherals at the same time, please post a new question about that to this forum and we will be happy to help.

    Regards

    Mukul

  • Dennis Nguyen said:
    [Dennis] What is the DSP speed in the sample code from ti\pspiom\examples\evm6747\audio?  Since this sample code does not set any PLL register, I would like to know what the DSP speed is that we ran the benchmark with.

    The PSP examples do not configure the PLLs. Typically you rely on the GEL files to configure the device at speed e.g at 300 MHz.

    The gel files etc can be downloaded from the Spectrum Digital website

    http://support.spectrumdigital.com/boards/evmomapl137/revf/

    Assuming you did not use the gel file etc, then it is likely that the device is in its power on default state. In this state PLL0 is in bypass/powered down mode. So with a 24 MHz input clock, DSP is likely at 12 MHz (as POSTDIV will default to 2 , dividing the 24 MHz clock by 2 to give 12 MHz @  SYSCLK1).

    Details on Device Clocking and PLL registers can be found in the system guide (Chapter 6, 7). You can also verify the PLL register settings by looking through the PLL registers (values in PLLCTL will tell you if the PLL is in bypass state or enabled and latching in the multplier value in PLLM).

    NOTE: I wonder if that is causing your UART example to not work reliably?


    Hope this helps.
    Regards

    Mukul

     

  • . First, I had PWREMU_MGMT with 0xE001 as the provided code and it did not work for me.  Then I looked te documentation to see why it did not work.  Then I found out the discrepancies betwwen the code and the documentation.  I have been in SW for 25 years and I neither trust the example code nor the documentation.

    . I changed to 0x6001 per the documentation and it still does not work.  I think the baud rate configuration/calculation is not correct and I will look further.

  • Hi Mukul,

    I looked at my seeting closer and I actually used emvc6747_dsp.gel.  Based on the IDE Profile->Clock->View information, we are running at 300MHz.  However, our algorithm ran much slower than expected.  At 300MHz, the algorithm took about 60% of the CPU.  We are hoping that we can run the same algorithm at 100MHz with 50% CPU utilization.  We will need to do more optimation on the algorithm.  Thanks for the informationon the PLL.

    I will work on the UART issue next.

    Dennis

  • I did a loop back Tx->Rx on the external DB9 connector of the EVM and I received the correct data.  This tells me that it is the baud rate problem.  I will let you know more.  Thanks.

  • Hi,

    I found the problem.  As I stated previously, "I do not trust the example code nor the documentation".  Here is why:

    1. The starter kit IDE default with the DSP running at 300MHz.

    2.  SYSCLK2 is the UART clock frequency which is DSP speed / 2 = 150MHz.

    3. The provided example EVMC6747_UART.C  EVMC6747_UART_open (line 30)  from C:\CCStudio_v3.3\boards\evmc6747_v1\dsp\lib\bsl set the UART clock frequency at 24MHz.

    4. I changed to 150MHz and the problem went away.

    It could be TI intention is to teach us undersdtanding about the DSP clock configurtation how to troubleshoot the bad example.

    Thanks,

    Dennis

  • For your initial testing, I recommend getting the TI supplied example code working first, as is. Did you change the register value to the expected 0x6001 or did you leave it at 0xE001 for your testing? We need to get a correction in either the documentation or the code, but the code should be working correctly as it is supplied.

    [Dennis] FYI.  The code does NOT work correctly as it is supplied.  Please update the example code.

  • Hi Dennis

    Glad to hear  that you are up and running.

    The UART example that you are citing is from the from the board support library package supplied by Spectrum Digital (I didn't catch that when you mentioned the .c file name in your earlier posts, as there were references to other examples from TI PSP releases also).

    The BSL  tests are in there to ensure that the device/ peripherals (on device and on board) can be quickly tested to ensure they are functioning as expected. I expect/hope that for code development and production software you would also be looking at drivers/examples provided by TI (BIOS/PSP releases).

    I will let Spectrum Digital know your feedback on the UART BSL example. Beyond that, all I can say that here to help wherever we can to make sure you have a good user experience with TI collateral and developing using TI processors.

    Regards

    Mukul

  • Thanks Dennis..Your post has solved my problem too...

    Regards,

    Mini