Jamie Dixon
Jamie Dixon

Reputation: 4302

Raspberry Pi2 running Windows 10: No PWM

I have a Raspberry Pi2 running Windows 10. I want to control a servo using PWM (porting some netduino code). There does not appear to be a PWM pin at all on the Pi-> with the possible exception of 12 (GPIO 18). Can someone confirm this?

Thanks

Upvotes: 4

Views: 1220

Answers (2)

Anurag Vasanwala
Anurag Vasanwala

Reputation: 486

Hardware PWM and ADC are not supported right now on RPi2 (Windows IoT). You need some extra circuitry which can generate PWM or record ADC on demand. There some project works available for that.

How you can achieve PWM & ADC on RPi2 + Windows IoT?
RPi2 will be connected to a gateway device via I2C/SPI Bus. A gateway device is nothing more than a microcontroller like Arduino. We need to program gateway to respond RPi2. Gateway device will act as I2C/SPI slave. Whenever RPi2 requests to write specific PWM pin, Gateway will generate PWM for that pin on demand.

Something you might like:
PWM Servo Control (RPi2 + Windows IoT):
https://www.hackster.io/AnuragVasanwala/windows-10-iot-core-ultrasonic-distance-mapper-d94d63

PWM Motor Speed Control & Retrieve ADC (RPi2 + Windows IoT):
https://www.hackster.io/AnuragVasanwala/windows-10-iot-core-hydroflyer-f83190

Upvotes: 2

vidalsasoon
vidalsasoon

Reputation: 4401

Yes and I doubt it will ever be added to Windows. Windows isn't a "Real Time" OS so it can't make the precise microsecond pulses required for PWM hardware.

Apparently there are breakout boards that could do this (ex: https://www.adafruit.com/products/815)

I haven't tried any yet though.

Upvotes: 2

Related Questions