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.

CC26XX-REQUEST: PWM setup

Part Number: CC26XX-REQUEST
Other Parts Discussed in Thread: SYSCONFIG, LP-CC2651R3SIPA

Running CC2651R2SIPA under cc23x1 cc26x1 sdk 7.10.0.98.  Set up 3 PWM using sysconfig.

PWM: CONFIG_PWM_0, CONFIG_PWM_1, & CONFIG_PWM_2.

GPIO: CONFIG_GPIO_PWM_0, CONFIG_GPIO_PWM_1, CONFIG_GPIO_PWM_2.

Note I tried both PWM callout with and without "GPIO and get the same results - locked in waiting.

In MAIN.c : see attachment A.         In sperate file(PWMLedAlarm - separate Task file).: attachment B.

Program assemble and runs until it get to line 63 (attachment B. and never get out of the first while(1) or any if of the 3 PWM (if I comment out the prior ones) .  If I skip the the complete PWM test of the 3 and never ask for a PWM, all the rest of the program work reading 10 sensor and calculated valve on time based sensor readings, etc.

Do I need to update the CC23x1 CC26x1 SDK or just use some different definitions in the PWM setups in main or the separate Task file? Thoughts?

MAIN

A..jpg

TASK file

B..jpg

Jim

  • Hello Jim,

    The number of the lines are a little cutoff but I assume you are talking about CONFIG_PWN_0 failing to open, in this case we could try to check if the resource is already allocated or if there is some isssue with our setup. 

    Could you see if you start with the PWMLED2 example and then add a third PWM instance the project still builds and runs on your side? Then we could try to modify the settings of PWMLED2 to match your above case. 

    Also is this test being run on a custom board or the LaunchPad? 

    Thanks,
    Alex F

  • Alex,

    I'm running on a LP-CC2651R3SIPA with a custom program with added I2c sensors auxillary ledsand switches but started with the on-board software.  I also slightly modified the pwmled2.c to add 3rd PWM; 2 LED's and a passive buzzer.  l inserted the modified pwmled2.c in main.c before the BIOS_start() and now it doesn't get caught in the "while (1)" in any of the 3 PWM_open's and all my sensor/switches work.

    I'm assuming duty cycle for brightness and period for flashing.  Lowering duty cycle does dim it, but lowering period Value 100 brightens it.  I never see blinking or flashing.

    Should pwmled2.c be installed after the BIOS_start?  I tried that and it gets hung up in the PWM_open in the while (1) {}.

    I used sysconfig to define the system.

    Jim

  • Hello Jim,

    Looking at the example (PWMLED2) the mainthread which contains the PWM is created before BIOS_start. 

    Lowering duty cycle does dim it, but lowering period Value 100 brightens it

    We might have to play around a little with the numbers, can you tell me the final intent here (like blink at x times per x time?) 

    Thanks,
    Alex F