- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to continuously drive a PWM output (until I choose to turn it off.)
From the part datasheet, the PWM hardware seems capable of continuous output. I just need a way to set it.
pwm_start() seems like the right function to call. But, it only drives the buzzer for a second or so.
(It would be great if I could find the source code for pwm_start(), but that's a different topic.)
I've tried disabling sleep (using advice from the forum,) but to no avail. The buzzer only lasts for a second.
Any advice is appreciated.
My code is a modified hello_sensor. It just enables the buzzer GPIO, initializes ACLK, and starts PWM with something like this:
pwm_start(PWM2, PMU_CLK, 0x2FF, 0x200);
gpio_configurePin((GPIO_PIN_BUZZER) / 16, (GPIO_PIN_BUZZER) % 16, PWM2_OUTPUT_ENABLE_P28, 0);
(I could probably set a timer/interrupt to continuously restart the PWM. But, this seems unnecessarily complex. I'd prefer to just set the PWM hardware to go continuously.)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please study the pwm_tones application that is included within the SDK. This application uses a continuous output and was created to serve as a guide to getting started with the PWM functionality on the 2073XS devices.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello meme,
Have you checked the links like:
Re: How to get all 4 PWMs working at the same time on BCM20736S
Look at: IoT Hackathon Challenge
Lots of entries on the forum for PWM.
Thanks
JT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please study the pwm_tones application that is included within the SDK. This application uses a continuous output and was created to serve as a guide to getting started with the PWM functionality on the 2073XS devices.