Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

PWM First draft #2

Merged
merged 1 commit into from Dec 31, 2017
Merged

PWM First draft #2

merged 1 commit into from Dec 31, 2017

Conversation

ghost
Copy link

@ghost ghost commented Dec 31, 2017

Description

This PR adds support for PWM output on Quail, Netduino3, STM32F429i-Disco and STM32F411 boards.

It is still missing :

  • sanity checks
  • support for the other reference boards
  • support of Polarity.Low

How Has This Been Tested?

Tested on Quail and F429i-Disco. Netduino3 has same MCU as Quail so it should work as well.
Not tested on IngenuityMicro Electron board (F411)

Screenshots

nice try
20 KHz PWM output on Quail, yellow trace on socket #2 polarity high 20% duty-cycle, blue trace on socket #3 polarity low 80% duty-cycle.

PwmController PWM = PwmController.FromId("TIM4");
PWM.SetDesiredFrequency(20000);

pwm2 = PWM.OpenPin(3*16+15);        // Quail PD15-PWM2
pwm2.SetActiveDutyCyclePercentage(0.2);
pwm2.Start();

pwm3 = PWM.OpenPin(3 * 16 + 13);    // Quail PD13/PWM3
pwm3.SetActiveDutyCyclePercentage(0.8);
pwm3.Start();

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Initial commit for PWM

Signed-off-by: Christophe Gerbier <christophe@mikrobusnet.org>
@nfbot
Copy link
Member

nfbot commented Dec 31, 2017

Hi @MikroBusNet,

I'm nanoFramework bot.
Thank you for your contribution!

A human will be reviewing it shortly. 😉

@CLAassistant
Copy link

CLAassistant commented Dec 31, 2017

CLA assistant check
All committers have signed the CLA.

@piwi1263 piwi1263 merged commit 061596e into nanoframework:wip-Windows.Devices.Pwm Dec 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants