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.

RTOS/TM4C1294NCPDT: how to enable divsclk in ti-rtos

Part Number: TM4C1294NCPDT

Tool/software: TI-RTOS

Hi:

    I'm new to tiva C, I'm trying to enable DIVSCLK in ti-rtos.

    I learnt that  I'll need drivers from tivaware to configure GPIO to enable DIVSCLK , I found   and copied the code into my program, but I don't know from where I can find which header files are needed to build the program successfully, could you please give me a hint where I can find such information ?

Thank you very much for your kindly help.

Best regards!   

  • Hi,
    Have you tried:

    GPIOPinConfigure(GPIO_PQ4_DIVSCLK);
    GPIODirModeSet(GPIO_PORTQ_BASE, GPIO_PIN_4, GPIO_DIR_MODE_HW);
    GPIOPadConfigSet(GPIO_PORTQ_BASE, GPIO_PIN_4, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
    SysCtlClockOutConfig(SYSCTL_CLKOUT_EN | SYSCTL_CLKOUT_SYSCLK, 10);

    You need the gpio.h and pin_map.h from the TivaWare library.
  • Hi Charles:

         Thanks very much for your suggestion.

          I tried your code, when I compile, there are still error message like "Description Resource Path Location Type  #20 identifier "GPIO_PORTQ_BASE" is undefined empty.c /new_lab line 110 C/C++ Problem", I used F3 and found it is defined in hw_memmap.h, so I have to include it.

          Then I got "Description Resource Path Location Type#20 identifier "SYSCTL_CLKOUT_SYSCLK" is undefined empty.c /new_lab line 112 C/C++ Problem", and I have to include sysctl.h.

           Finally I got the divsclk working, but the process is a bit confusing, normally we don't write code in such a sequence, could you please tell where I can find related information about what kind of headers are needed for a specific function ?

           Thanks again.

            yifan 

  • Hi Yifan,

      Glad your problem is solved. It was my bad that I didn't mention the sysctrl.h and memmap.h. I don't think the TI-RTOS is able to support DIVSCLK. Hence you will need to rely on the native TivaWare library for which the TI-RTOS encapsulates to configure the DIVSCLK. I think the easiest way is to try out some of the TivaWare (these are non TI-RTOS) examples such as the blinky.c and you will see all the needed header files that are referenced to build the project. 

  • Hi Charles:

          Thank  you very much for your kindly help.

          I just followed the lab about ti-rtos, but not the tivaware example, now I know where to find the information.

          Another question, one advantage of ti-rtos driver compare to tivaware is they are thread-safe, does it mean if I don't access the same peripheral in different tasks, there is no dangerous to use native tivaware driver in ti-rtos environment ?

          Best regards!

          yifan