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.

LAUNCHXL-F28P65X: After adding Device Support Module and excluding device.c, PWMs won't come alive

Part Number: LAUNCHXL-F28P65X
Other Parts Discussed in Thread: SYSCONFIG,

I created a small project using sysconfig to run two EPWMs with dead time at 1 MHz. I can build my project successfully and run it in debug and see the PWM waveforms on my scope. 

However, I wanted to edit the clock tree to set the EPWMCLKDIV to 1 (default is 2) to give me greater resolution on my dead time control. The tool instructed me to include the Device Support module, so I added it and (as I've seen on the forums, here) excluded my device\device.c file from the build. 

When I now build the project and run it in debug, no waveforms at all show up on the scope. I do not get any errors, the LEDs are turned on on the board, but there are no outputs from the EPWMs. I've tried the project both with and without the "Use Standard Code Start Branch" option (excluding the f28p65x_codestartbranch.asm file when using it), but I still get the same results. image.png

If I remove the Device Support module, re-enable the device.c file, and rebuild/rerun the project, my waveforms come back. What am I doing wrong?

My project setup is as follows:

image.png

  • Hi Mark,

    You can either add device support in syscfg or device folder to your project. Now you have your device.h uncommented and it makes an issue. Since you want to use ClockTree then keep device support in Suscfg and completely remove/uncomment DEVICE folder in your project workspace.

  • I excluded the full "device" directory, but still nothing comes up. I can still build the project with no errors, but when I debug-run it, the EPWMs do not activate.

    As before, if I remove the Device Support module and re-include the device directory, the EPWM outputs come back. 

    Snapshot of the configuration with the device directory excluded, in case I messed something else up:

  • A few other things I've tried: 

    • Building with the CPU1_LAUNCHXL_RAM configuration versus the CPU1_RAM configuration, both work normally without Device Support but no outputs appear when Device Support is enabled. 
    • Making sure that clocktree.h is selected in sysconfig -- it is.

    I also added some basic code into the empty_driverlib_main.c to blink an LED on the board just to show that it was communicating and running the main.c file. The LED does blink when Device Support is loaded, even when the EPWMs are silent. So I'm not having an issue communicating with the part nor running the code, but for some reason the PWMs I define in sysconfig are not coming up. 

  • Hello Mark,

    Are you using internal oscillator or external crystal? Whatever is used on hardware needs to be matched in firmware settings. Please check you clocktree and what is clock source set to.

  • From what I can tell from the LaunchXL-F28P65X schematic, there is a 25 MHz clock buffered and fed in on X1. And the Sysconfig clock tree that I've been using does seem to be correctly configured to use that clock:



    Zoom:

  • Hello, are you using crystal or int oscillator? As it is now you have selected X1_XTAL option in above mux, but X1 in below mux which produces mismatch.

  • Please correct me if I am mistaken, but I believe that the OSCCLKSRCSEL mux is supposed to select from an external clock source (X1_XTAL setting) versus an internal clock source (INTOSC1/2). The X1_XTAL input is supposed to be used for either X1 or XTAL external clock inputs. 

    According to the Launchpad schematic, an external single ended buffered 25 MHz clock is fed in on the X1 pin, so that is what I have selected on the XTAL_OR_X1 multiplexer in order to send the 25 MHz clock to the OSCCLKSRCSEL mux:

  • HI Mark,

    Stevan is out of office until next Monday. Please expect a response by Tuesday once he is back in office.

    Thanks

    Srikanth

  • Mark,

    Could you try stepping over the Device_init() function, please? If code does not reach Device_initGPIO(), then clock is not configured correctly.