question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hardware PWM issue

See original GitHub issue

Hi,

I have problem with hardware PWM, cannot run it from .net core application - LED connected to GPIO12. PWM is enabled in /boot/config.txt file (dtoverlay=pwm-2chan) Sample python script works ok.

What I’m missing?

Here is the code sample:

using System;
using System.Device.Pwm;

namespace Sample
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            var pwm = PwmChannel.Create(0, 0, 100, 1);
            pwm.Start();
            Console.ReadKey();
        }
    }
}

I’m using Raspberry PI 4 with 2GB of ram.

Best regards Fabian

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
pgrawehrcommented, Jul 6, 2020

Please try again against the latest dev nuget. This should solve the access violation problem at least.

1reaction
SavaNDragoscommented, Aug 25, 2020

Run over this issue, so I updated to: <PackageReference Include="System.Device.Gpio" Version="1.1.0-prerelease.20276.1" /> That “System.IO.IOException: Permission denied” bug is fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem in Pi4 of pwm hardware generation
Hello everyone. I can't get a pwm out of the Pi 4 via hardware. I used this reference to enable the hardware: https://github.com/dotnet/iot/blob/main ......
Read more >
Hardware PMW function not working on Pi4B revision 1.4
All I plan to do is extract the hardware PWM code into a small test program and start playing with numbers. Identify the...
Read more >
PWM issues with pigpio and RPi.GPIO
RPi.GPIO currently has no support for hardware PWM. If you have a problem with pigpio and Python a listing showing the problem will...
Read more >
Hardware PWM Setup Issue - Programming Questions
Hi, I'm trying to set up a fast PWM signal using timer 3 on my Mega2560. I have set up the hardware registers...
Read more >
rpi-hardware-pwm
Control Hardware PWM on the Raspberry Pi. ... Access the hardware PWM of a Raspberry Pi with Python. More lightweight than alternatives.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found