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/EK-TM4C1294XL: Is there a pwmled example program using PWMTiva.c and PWMTiva.h library files?

Part Number: EK-TM4C1294XL

Tool/software: Code Composer Studio

Dear Sirs,

We are working on EK-TM4C1294XL evoluation board.

Our question is about the "pwmled.c" example program. It is running without problems.

But we are trying to change its properties and build a new program in order to use it for our purpose.

Our pwmled example program is using peripheral libbrary files pwm.c and pwm.h

As far as we understand, PWMTiva.c and PWMTiva.h files are more comprehensive programs. They can be used instead of PWM.c and PWM.h.

Is there a pwmled example program using PWMTiva.c and PWMTiva.h library files?

There are six library files:

  • ti/drivers/pwm/PWMTiva.h
  • ti/drivers/pwm/PWMTiva.c
  • ti/drivers/PWM.h                   (Example program includes only this library file.)
  • ti/drivers/PWM.c                   
  • driverlib/pwm.h
  • driverlib/pwm.c

The last three library files are being called and used indirectly by the example program pwmled. But first two files are never used. 

Best regards,

Emin

  • Hi Emin,

    If you are just using the TivaWare driverlib, use the driverlib/pwm.* files. These APIs are pretty low-level.

    If you are using TI-RTOS, we recommend you use the ti/drivers/PWM APIs. Internally these APIs will call into the ti/drivers/pwm/PWMTiva APIs. We have a two-tier calling sequence to allow the same interface for different low level drivers. For example, you could have both DMA and non-DMA based UART drivers at the same time.

    Note: you have to use the PWMTiva.h file for the driver configuration in the "Board.c" (e.g. EK_TM4C1294XL.c). You may have to use the PWMTiva module also if there is a feature not exposed in the top level ti/drivers/PWM module, but this is not common. Also you need the driverlib/PWM module in the driver configuration file.

    Note: the ti/drivers/pwm/PWMTiva module uses the low-level driverlib APIs internally. 

    Todd

  • Hi Todd,

    Thank you for your quick reply.

    As we understand from your answer, there is no ready made example program version that using PWMTiva.c peripheral library file. Than we will try to write our codes using PWMTiva.c system, simularly as in the example, but instead of using PWM.c comands and functions. We will use PWMTiva.c comands and functions.

    Obviously, there will be some differences between PWMTiva.c and PWM.c. But we will try to go this way.

    We will carefully read the descriptions between the codes for avoiding make mistakes, but we wish to obtain a ready made example of using PWMTiva.c files in pwmled example.

    It is very suprising that there is no applicaiton example for PWMTiva.c, altough there is so many different specialties and calculations contained in the PWMTiva.c compared with PWM.c. 

    Best regards,

    Emin