Within the SDK, take a look at the PWM_Tones application in the /apps directory.
In addition, this thread is very informative: Re: Different Frequencies for PWM
There are many other threads on PWM usage as well.
That still doesn't help with my first question.
Is there a way to call an interrupt every time the PWM wraps up.
The SDK doesn't show a way to register interrupts with Timers or PWM.
The only Timer I can find is the fine timer.Is there any other timer available with better precision?
I am looking in the 3.1.1 SDK and not finding the PWM_Tones application.
I don't think that the SDK has anything finer than 1ms resolution.
v3.1.1 is current for WICED Wi-Fi
This question was posted to the WICED Smart forum, so you'd need to look at SDK v2.1.1 specific to WICED Smart.
sorry... I am new to the group. I will download that SDK so I can follow along. Will this conflict with my WICED WiFi SDK?
No apologies needed. Welcome aboard!
1 of 1 people found this helpful
There is no 32KHz timer/crystal in the WICED Sense module. The highest resolution (soft) application timer is the 12.5mS fine timer.
> I am looking in the 3.1.1 SDK and not finding the PWM_Tones application.
Did you mean WICED Smart SDK 2.1.1?
I see a header hw_timer.h.Can I use the callbacks from this to interrupt every 30microseconds?
It seems like it might work.Will that affect the workings of the bluetooth stack?
> I see a header hw_timer.h.Can I use the callbacks from this
Yes, you can. But remember that this callback will be invoked in interrupt context and you are expected to return in under 100uS or you risk serious performance issues with the BLE connection.
> to interrupt every 30microseconds? Will that affect the workings of the bluetooth stack?
This will most likely trip the watchdog. Bluetooth tasks are the highest priority tasks in the system and any application activity under about every 3.5mS will interfere with BT activity.
The PWM itself generates pulses. Do you need to change the pulse rate (width/frequency) every 30uS?
Yes I need to change the pulse rate every 30 uS or so .