PWM control in BLE SDK

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
LiCh_2157216
Level 1
Level 1

We use pwm_transitionToSubstituteValues() to control PWM, but it failed even the return value is true.

Is there any other PWM function?

The sample code we use is proximity_plus() in SDK 1.0.1

add the code in bleprox_mod_Create

gpio_configurePin(1,12,GPIO_OUTPUT_ENABLE, 0); // P28

// Configure ACLK as the reference clock of the PWM

aclk_configure(256000, ACLK1, ACLK_FREQ_24_MHZ);

ass the following function in the callback function bleprox_mod_appFineTimerCb()

pwm_start(PWM2,PMU_CLK,toggle_val,init_value);

Regards.

Licter

0 Likes
1 Solution

Did you disable output on the GPIO when you reset the PWM (and you can insert an internal pull-down/pull-up)? Do you have anything connected to the GPIO? If yes, then can you try disconnecting it and then see if the PWM goes low when you reset it?

        case 6:
           // Disable channel.
           pwm_setReset(PWM0, 1);
           gpio_configurePin(26/16, 26%16, GPIO_OUTPUT_DISABLE | GPIO_PULL_DOWN, 0);
           break;

View solution in original post

0 Likes
22 Replies