Menu

How to use PWM Input to separate two signals

Phil D
2020-09-05
2020-09-05
  • Phil D

    Phil D - 2020-09-05

    Hi guys,

    I love using GCB and have been using GCB for a few months now with PIC's - You guys do a great job! I have decided to jump into the world of PWM, which I have very little knowledge of other than a basic understanding of what it is and the basics of how it works.

    I am working on a small (and probably simple) little project where I want to read two LED PWM inputs through a single pin and separate them to two separate LED output pins. The problem is I don't know which GCB command syntax to use to read the PWM input or the best way to separate the inputs. I am using a PIC16F1823.

    Any guideance would be very much appreciated!

     
  • stan cartwright

    stan cartwright - 2020-09-05

    a pwm signal is just a pin going on then off at a given frequency and you can set the on time and so the off time from 1% to 99%.
    you can "read" the pwm by using the values you have given it.
    there is no read pwm command

     
    • Anobium

      Anobium - 2020-09-05

      Agree with Stan there is no formal readpwm.

      So, let me assume you have two square waves arriving at the same input pin.... how would you determine which signal is which signal?

      |¨¨||¨¨||¨¨||¨¨|__|¨¨| = signal one

      |¨¨¨¨||¨¨¨¨||¨¨¨¨||¨¨¨¨|_ = signal two .. a different freqency?

      The two signals combined would look like ____|¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨|_

      So, what am I missing? :-)

       

      Last edit: Anobium 2020-09-06
  • stan cartwright

    stan cartwright - 2020-09-05

    As Anobium says. If you have set up pins for pwm output then you have set the frequency and the % ie mark space ratio of % on and these can be absolute values ie a number or the frequency and % could be variables. You know what the pwm values are because you configured them so no need to "read" them.
    as Anobium mentioned what am I missing?

     

    Last edit: stan cartwright 2020-09-05

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.