Setting the PWM frequency using the SDK
In the SDK there appears to be only two commands in relation to the PWM, Set and get.
The "EApiPwmSetValue" uses 4 input values. But none of these values change the frequency of the PWM.
At present the minimum frequency at 17Mhz when the command is initialised with the following:
EApiPwmSetValue(0,1,0,1)
with the first variable being the PWM ID number,
Second is the Base Unit Integer
the third is the Base Unit fraction - which cannot be set to anything but 0 for some reason
the forth is the duty.
So the question is. How do you set the Upboard PWM frequency to its minimum of 293Hz?
Comments
-
Hi rhulme77,
The minimum speed of PWM is 75kHz, so you can't set the PWM freq. to 293Hz. And the speed of signal frequency is changed from 75kHz ~ 10 MHz ~ 75kHz, is equal to 0x01 ~ 0xFF from Base Unit.
e.g. if set the Base Unit to 0x7F, the output frequency will be 10MHz, as shown in the picture below
<-- by logic analyzer -
so why does the wiki state the following?
2 PWM ports, supporting frequencies between 293 Hz and 75 kHz with 8-bit duty-cycle resolution, are provided on the I/O header.
-
Please note, the PWM frequency of 293Hz should work on Linux for UP, but not for Windwos SDK
Categories
- All Categories
- 63 Announcements & News
- 139 Product News - New Product/Product Change Notice/ End-of-life
- 112 Welcome Developers!
- 60 Unboxing & Project Sharing
- 114 Tech Updates
- 3.6K UP Products
- 119 UP 7000
- 25 UP Squared i12
- 24 UP Xtreme i12
- 14 UP Squared Pro 7000
- 1 UP Element i12 Edge
- 24 UP Squared V2
- 65 UP 4000
- 23 UP Xtreme i11
- 34 UP Squared 6000
- 59 UP Squared Pro
- 135 UP Xtreme
- 820 UP Squared
- 1.4K UP Board
- 74 UP Core Plus
- 217 UP Core
- 3 UP Xtreme Lite
- 40 UP AI Edge
- 265 Starter Kits & Peripheral