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.

problems opening peripheral examples in tm4c1294EK

Other Parts Discussed in Thread: EK-TM4C1294XL

Hello,

I am doing my final degree thesis which consists on a full bridge DC/DC power converter. To do so i am using the TM4C1294EK microcontroller as the control of my power converter. And therefore i need 4 PWM with dead bands and phase delays.

I have been trying to open, build and run the pwm peripheral example which is available in the tivaware library of my microcontroller. But I have been trying for 2 days and i havent even been able to build the projects, all kind of errors have appear:

- Library doesnt exist

-GPIOPinConfigure(GPIO_PA0_U0RX) is undifined, as well as many other erros similar to this one.

I assume as this is an example prepared, that it should run automatically without any problem.

Therefore here is my question: How do I do to import this project, or open the file correctly so it doesnt give me any error??

Thank you so much in advance,

Carlos Salto

  • Hello Carlos,

    First, the files located in the peripherals directory are not complete projects. They are simple peripheral code examples. Part of the reason you are getting the errors you are seeing is because of the include paths to the TivaWare Library of functions which would need to be setup in the project. It is possible to start from scratch but I would recommend starting from an existing project such as the 'hello world' project in the board example (..\..\examples\boards\ek-tm4c1294xl\ )directory. Once you have it up and running, you canintegrate the peripheral files into the project and development and learning the specific functions of interest. The 'hello world' project would also give you an implementation of the UART to use for debug/status messages in a serial com window using putty or telnet if you so choose.

    I am not certain how much you have used Tiva in the past but most of the code is based on the TivaWare library and there are many driver functions included int he device in ROM so that you don't have to use Flash code space for basic driver functions. The links below are to two important documents that might be helpful as guides in developing your code.

    1.) TivaWare™ Peripheral Driver Library for C Series User's Guide (Rev. A) - www.ti.com/.../spmu298
    2.) Tiva C Series TM4C129x ROM User's Guide (Rev. A) - www.ti.com/.../spmu363

    there is also an extensive list of other documentation such as application notes, user gudies, white papers located on the product page for the device located at this link www.ti.com/.../spmu363.
  • Thank you very much Chuck,

    It worked perfectly what you told me.

    However now i am facing another problem, and i would really appreciate if you or someone else could help me. I need to change the value of one register, which is the following:

    PWMn Generator A Control (PWMnGENA)
    PWM0 base: 0x4002.8000
    Offset 0x060

    I need to change the following bits:

    11:10 ACTCMPBD RW 0x0

    Value Description
    0x0 Do nothing.
    0x1 Invert pwmA.
    0x2 Drive pwmA Low.
    0x3 Drive pwmA High.

    to 0x1. I have tried the following:

    HWREG(0x40028000 + 0x0A0)|=0x00000400;
    HWREG(0x40028000 + 0x0A0)=HWREG(0x40028000 + 0x0A0)&0xfffff7ff;

    However it is not working. Are there any functions to change the value of a register? Or how would you do it?

    Thank you very much for your support, it was of great help.

    Carlos Salto
  • Hello Carlos,

    The HWREG macro is intended for this purpose. The format is HWREG( reg_addr ) = reg_value; or you can do HWREG( reg_addr) |= mask_value; to only update the specific field you are interested in. I know that you tried this, and don't have an answer as to why you didn't see the changes take effect. Perhaps the PWM was already active? or some other reason that escapes me at the moment.

    However, direct register manipulation is typically frowned on with the TM4C ans is the reason why TivaWare exists. There is an API designed to configure the PWM as you want it to be configured. Have a look in the driverlib document I linked to in my earlier post and look for the function
    PWMGenConfigure(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Config) description. This function should be able to do what you want to do.