PWM under windows 10 IOT
I am trying to use PWM off the 40 pin connector under windows IOT.
I have installed the framework and compiled and deployed the UpDemoApp. I can read the Board name, Board Manufacturer and Bios version, but I do not seem to be able to control outputs via the App. I receive good status replies from the calls but the outputs do not change.
The PwmSetValue function call completes without error and I am able to retrieve the values using PwmGetValue, but the output does not pulse. I cannot find documentation describing the parameters for these functions: PWMBaseUnitInt, PWMBaseUnitFrac or PWMDutyCycle.
Advice on getting the GPIO working, particularly the PWM would be greatly appreciated!
James
Comments
-
Has anyone got the framework working under Windows IOT?
-
When I use the flash.ffu from the AAEON downloads I am able to control the PWM output. When I try and build the flash using the "Windows IOT BSP and Guide" document (https://downloads.up-community.org/download/windows-iot-core-bsp-and-guide/) I get an error in the Build Image step -- "Package is missing from \?\C:\Program Files (x86)\Windows Kits\10\MSPackages\Retail\AMD64\fre\Microsoft.IoTUAP.IoTUAPProductSpecificFM~31bf3856ad364e35~AMD64~~.cab"
-
I was able to build the Windows IOT ffu file when I tried on a different computer. This allowed me to access the PWM.
My problem is now the PWMSetValue routine is unable to set the fractional value. The fractional value always reads back as zero using PWMGetValue and the value does not affect the frequency of the PWM output. This means the lowest frequency I can output is 75 KHz, but I need about 1 KHz.
I see that another user was also unable to set the fractional value -- https://forum.up-community.org/discussion/3514/using-the-sdk-setting-the-pwm-frequency .
uint _pwmInt = 1; uint _pwmFrac = 200; uint _pwmDuty = 128; Debug.WriteLine($"Setting PWM Channel 0 _pwmInt={_pwmInt}, _pwmFrac={_pwmFrac}, _pwmDuty={_pwmDuty} "); EAPIStatus_t status = (EAPIStatus_t) upb.PwmSetValue(0, _pwmInt, _pwmFrac, _pwmDuty); if (status == EAPIStatus_t.EAPI_STATUS_SUCCESS) { upb.PwmGetValue(0, out uint tInt, out uint tFrac, out uint dutyCycle); Debug.WriteLine($"Reading PWM channel 0, tint={tInt}, tfrac={tFrac}, dutyCycle={dutyCycle} "); }
---- output
Setting PWM Channel 0 _pwmInt=1, _pwmFrac=200, _pwmDuty=128
Reading PWM channel 0, tint=1, tfrac=0, dutyCycle=128