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.

PWM and Timer A or B



Hi!

At the moment, I'm working with LM4f231H5QR for a project based in Real Time processes (FreeRTOS). My problem is about the default timer scheduler from the FreeRTOS Kernel (Timer A), used to control all the real time tasks, and the timer used in PWM CCS API.

I've configured the PWM peripheral as the referenced example in the CCS documentation, but with three synchronized generators.

PWMGenConfigure(PWM1_BASE, (PWM_GEN_1), PWM_GEN_MODE_UP_DOWN | PWM_GEN_MODE_GEN_SYNC_LOCAL | PWM_GEN_MODE_DB_SYNC_LOCAL |
PWM_GEN_MODE_DBG_RUN);
PWMGenConfigure(PWM1_BASE, (PWM_GEN_2), PWM_GEN_MODE_UP_DOWN | PWM_GEN_MODE_GEN_SYNC_LOCAL | PWM_GEN_MODE_DB_SYNC_LOCAL |
PWM_GEN_MODE_DBG_RUN);
PWMGenConfigure(PWM1_BASE, (PWM_GEN_3), PWM_GEN_MODE_UP_DOWN | PWM_GEN_MODE_GEN_SYNC_LOCAL | PWM_GEN_MODE_DB_SYNC_LOCAL |
PWM_GEN_MODE_DBG_RUN);

When I start the task scheduler of the freeRTOS (vTaskStartScheduler()), I think that the they used the same Timer (Timer A) and it produces a conflict with the PWM:

here an image sample with conflict:

http://img202.imageshack.us/img202/4896/08112012132638.png

PWM without conflict works at 18kHz ~ 10% duty cycle.

Thanks!

  • Have used both the simpler Timer-generated PWM and full-fledged PWM-Generator Modules - did not suspect that an independent MCU Timer was sacrificed in the PWM-Generator instance.  Willing to revisit our LX4F (64 pin) MCU datasheet - in the attempt to aid.  To this end - can you detail how you came by this "suspect"  PWM-Timer "relationship?"

    Know that the PWM-Generators have their own Set-Up and Clocking Control Registers - with great flexibility.  Belief was that they are directly clocked by System Clock - perhaps divided by 2 and then further divided - as/if so programmed.  But we remain "unaware" of any direct linkage to a specific, MCU Timer.

    Might you be able to shift the RTOS to yet another Timer?   Perhaps that will  "escape" this issue.