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.

System clock configuration problem

Other Parts Discussed in Thread: TM4C123GH6PZ

Hi, 

                I am using TM4C123GH6PZ (Tiva C series Micro controller). Here I am using SMBus communication through I2C communication for my application and also I am using CAN communication.

If i use the following clock setting my SMBus communication is working fine and I can able to do write and read operation. its replying proper values. In this clock setting my CAN Bus is not working.

SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);

If i use the following clock setting my CAN bus communication is working and SMBus communication is happening but while reading data from peripheral IC, its giving zero values only. its not giving a proper data. 

SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_OSC | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);

I want to use both communication simultaneously. 

Plz give the solution for this clock issue. 

  • Hello Yuvaraj

    First of all the SYSCTL_SYSDIV_1 is an illegal value when using the PLL. In retrospect the second SysCtlClockSet has the correct setting.

    Secondly if you are using TIVAWare version 2.1.0 then the SysCtlClockGet returns the wrong value (a known issue). To get the correct value what you would need to do is

    ui32SystemClockFreq = SysCtlClockGet();

    to be replaced by

    ui32SystemClockFreq = 80000000;

    And then use the variable ui32SystemClockFreq for all timing parameters. I think the wrong usage of the value is the cause. We have tested I2C and SMBus for 80MHz and it works fine so I don't believe the frequency is the issue but the value that is being used.

    Regards

    Amit

  • Dear Amit,

                    Thanks for reply. while using SYSCTL_SYDIV_1 I am not using PLL that is typing mistake. sorry for that. I am using below mentioned clock setting.

    SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);

     In this clock setting only SMBus Write and read operation is working.

                 Second I am using TivaWare_C_Series-2.0.1.11577. 

                Third in my code i check the SysCtlClockGet(); value in debugging mode I am getting ui32SystemClockFreq = 8 MHz while using the above clock setting.

                 Fourth as per your instruction i change the ui32SystemClockFreq to 80MHz. but my SMBus communication is not working.

  • Hello Yuvaraj

    TivaWare 2.0.1 is OK for getting the correct value of System Clock and it should return 80000000. Can you share the configuration that you are using for I2C when using 80MHz?

    Also as you mentioned that you are not getting the read from peripheral correctly, it would be advisable to see the same on a scope/LA and send the snapshot of the same as well.

    Regards

    Amit

  • Hi Amit,

                         I found the problem and i solved that..

     Problem is I am initializing CAN communication after SMBus communication. After initializing the CAN i am disabling the all the interrupts. due to that My SMBus communication is stopped.

    now i cleared...

    Thanks,

    Yuvaraj N