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.

MSP432P401R: Problem with PWM and TIMER

Part Number: MSP432P401R

Hi,

My project is using PWMtimer  and TIMER from TI DRIVER. When I am using PWM task alone is working ok, when I am using timer alone is working ok, but when I am using together my project is lock. (frozen). Any idea?

I am using the last versión of MSP432 SDK (2.10).

Regards,

  • "Any idea?"

    it definitely has nothing to do with your code. You should focus on something else instead.
  • I am sorry I don't understand too good.

    Maybe it is because PWM driver is using under the hood timers (maybe I need to do some change in configuration files).

    I using "timerled" example to test my project and avoid mistakes (without sucess), I using PWM driver in other task and I have 2 more task. Everything it is working fine till I add the timerled task.

    Regards.

     *  ======== timerled.c ========
     */
    
    #include <stddef.h>
    
    /* Driver Header files */
    #include <ti/drivers/GPIO.h>
    #include <ti/drivers/Timer.h>
    #include <Queues/queuedebug.h>
    
    /* Board Header file */
    #include "Board.h"
    
    #include "timer.h"
    
    /* Callback used for toggling the LED. */
    void mytimerCallback(Timer_Handle myHandle);
    
    /*
     *  ======== mainThread ========
     */
    void *myTimer(void *arg0)
    {
        /* Period and duty in microseconds */
        Timer_Handle timer0;
        Timer_Params params;
    
        Timer_init();
        /* Setting up the timer in continuous callback mode that calls the callback
         * function every 1,000,000 microseconds, or 1 second.
         */
        Timer_Params_init(&params);
        params.period = 1000000;
        params.periodUnits = Timer_PERIOD_US;
        params.timerMode = Timer_CONTINUOUS_CALLBACK;
        params.timerCallback = mytimerCallback;
    
        timer0 = Timer_open(Board_TIMER4, &params);
    
        if (timer0 == NULL) {
            /* Failed to initialized timer */
            while (1);
        }
    
        if (Timer_start(timer0) == Timer_STATUS_ERROR) {
            /* Failed to start timer */
            while (1);
        }
    
        while(1){
            vTaskDelay(pdMS_TO_TICKS( 100 ));
    
        }
    
    }
    
    /*
     * This callback is called every 1,000,000 microseconds, or 1 second. Because
     * the LED is toggled each time this function is called, the LED will blink at
     * a rate of once every 2 seconds.
     * */
    void mytimerCallback(Timer_Handle myHandle)
    {
        queueDebugSend("[TIMER] Call back function");
    
    }

  • I 've read documentation (simplelink_msp432p4_sdk_2_10_00_14). Timer driver is using Timer_A and Timer32 and PWM driver is using Timer_A. Can be it related to my issue? Is there any trick to use timer driver and pwm together in the same project?

    Regads,
  • After I reviewed my code three o four times. I got it and now it is working. So my code was faulty.


    Thanks!!!!

**Attention** This is a public forum