PWM signal on 20737S

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

cross mob
Anonymous
Not applicable

I found there's strength PWM output on 20737S, could someone help to check?

I test again with pwm_tones demo project in SDK2.0, and get the following signal:

The 1st picture is a cycle of PWM signal, and the 2nd picture is a zoom out that shows there is another "big" cycle to generate.

The output tone is periodically "bi", "bi" .... around around 1 sec. period. I think this is not the normal PWM. Then I test following simple code again in Hello project, but get similar strange result.

    aclk_configure(512000, ACLK1, ACLK_FREQ_24_MHZ);
    pwm_start(0, PMU_CLK, 0x2FF, 0x200);
   

    gpio_configurePin(26 >> 4, 26 & 0x0F, GPIO_OUTPUT_ENABLE, 0);

20140801_094427-001.jpg

20140801_094344.jpg

0 Likes
1 Solution
StBa_721356
Level 5
Level 5
50 likes received 25 likes received 10 likes received

You can also use LHL_CLK instead of PMU_CLK to have a PWM output even when the device is in sleep mode.

But be aware that LHL_CLK has a lower frequency than PMU_CLK.

Snippet from include/Drivers/pwm.h:

/// Clock used for PWM. When LHL_CLK is set, 128 KHz is used. When PMU_CLK is set, 1 MHz or 8 MHz. 

typedef enum

{

    LHL_CLK,

    PMU_CLK

} PwmClockType;

View solution in original post

2 Replies
Anonymous
Not applicable

20737S seems to be in sleep mode between tones.

Please try devlpm_registerForLowPowerQueries() and return 0 at the registered function.

StBa_721356
Level 5
Level 5
50 likes received 25 likes received 10 likes received

You can also use LHL_CLK instead of PMU_CLK to have a PWM output even when the device is in sleep mode.

But be aware that LHL_CLK has a lower frequency than PMU_CLK.

Snippet from include/Drivers/pwm.h:

/// Clock used for PWM. When LHL_CLK is set, 128 KHz is used. When PMU_CLK is set, 1 MHz or 8 MHz. 

typedef enum

{

    LHL_CLK,

    PMU_CLK

} PwmClockType;