- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Labels:
-
PWM
- Tags:
- application
- assist
- aware
- bcm20732s
- capability
- checking
- code
- components-peripheral
- control
- defined
- development
- docapiindex.html
- drivers-pwm
- enumerations
- functions
- marcos
- point
- provide
- sample
- team
- understanding
- utilizing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any update about the PWM function?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The post from the 24th with the three methods used to disable the PWM function, including function descriptions seems to have gotten cut off.
Can you repost the names of the three functions you would like more information on?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
function “pwm_setReset(DWORD mask, BOOLEAN resetEnable);” to disable pwm, it does not work.
It only stops pwm signal but not pull the level to low.
I use this function with below methods but all are failed.
==============================
#define AIO_PWM1 26
#define AIO_PWM_BASE 26
pwm_ setReset (1 << (AIO_PWM1- AIO_PWM_BASE), 1);
//pwm_ setReset ((AIO_PWM1- AIO_PWM_BASE), 1);
//pwm_ setReset (AIO_PWM1, 1);
==============================
But, if I use this function “pwm_disableChannel(DWORD mask);”, it merely sometimes pull the PWM GPIO down failed.
====================
pwm_disableChannel(1 << (gpio - AIO_PWM_BASE));
====================
If we also set the PWM GPIO to be a BUZZER one, we could use the function “bleprofile_BUZBeep(bleprofile_p_cfg->buz_on_ms);” to control the pin.
But this pin will become low automatically after the time “buz_on_ms”.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Any luck getting this to work Licter?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot.
We tested it and it works well.
Licter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the feedback. We are thinking about adding a PWM section to the existing Hardware Interfaces Guide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
i think, it'll be nice if you are adding a PWM section into Hardware Interfaces Guide.
Because i'm a little bit confused about it.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The best way to get familiar with the PWM function is to play with the PWM_Tones sample application within SDK 2.0.1
*
* PWM Tones Sample
*
* This application provides the sample code that uses the
* on-chip PWM and the buzzer on the TAG board to cycle
* through different tones when the button connected to P0
* is pressed. It also uses two other channels to generate
* random width pulses. Tones are generated with a 50% duty
* cycle and the other two channels have some randomness.
*
* Features demonstrated
* - Use of the PWM driver interface
* - Use of the on-chip HW random number generator.
*
* To demonstrate the app, work through the following steps.
* 1. Plug the WICED eval board into your computer
* 2. Build and download the application (to the WICED board)
* 3. Once the application is running, push SW1 and every
* time the button is pressed, the tone generated by the buzzer
* will cycle through a set of frequencies.
* 4. Attach an oscilloscope to P26 and P27 to see random width
* signals.
*/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
do you have tips for me, if i'll change the PWM duty cycle?
Example: PWM0 should run in 13% Duty Cycle; PWM1 => 90% Duty Cycle; PWM2 => 28% duty cycle. All PWMs should run with 1kHz.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This thread does an excellent job of explaining how to change the frequency of the PWM: Re: Different Frequencies for PWM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks. i'll try it.