This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

PWM generation with 89c2051

Hello, I am using 89c2051 ic for RGB dimming light .
As there is no PWM pin on IC I wnat to know how can I genrate my PWM for dimming effect of LEDs.how canI use two times for generation of three pulses. I will be higly obliged for any suggestion

Parents
  • Perhaps you should ask yourself a few questions?

    What do I need to do?
    How do I get there?

    The first is the most important. Define your problem. A properly defined problem will answer the second question or lead you to answering the second question.

    So... how fast do you need to PWM them? (rate)
    What are your minimum and maximum allowable pulse durations?

    After you answer what PWM scheme you need for your application you should THEN begin to define ... what processor to use and how to use it.

    On rate consider FLICKER (IE do you wish to see any visible flicker). How many PWM steps is enough? These are questions you should know the answer too before you start even deciding what processor to use.

    So .. define your problem.

    Stephen

Reply
  • Perhaps you should ask yourself a few questions?

    What do I need to do?
    How do I get there?

    The first is the most important. Define your problem. A properly defined problem will answer the second question or lead you to answering the second question.

    So... how fast do you need to PWM them? (rate)
    What are your minimum and maximum allowable pulse durations?

    After you answer what PWM scheme you need for your application you should THEN begin to define ... what processor to use and how to use it.

    On rate consider FLICKER (IE do you wish to see any visible flicker). How many PWM steps is enough? These are questions you should know the answer too before you start even deciding what processor to use.

    So .. define your problem.

    Stephen

Children
  • Thanks Stephen, Actually you are right for your suggestion.
    I need colour mixing of RGB lights . so rate would be 100HZ.maximum and minimum pulse duration is from FF to 00. Actually i have no choice for my controller as I want to use available one with me i.e 89c2051 and as I am comfirtable with C programming I want to program it in C.

  • I need colour mixing of RGB lights . so rate would be 100HZ.maximum
    NOOO, it would be 120Hz MINIMUM or the most sensitive person will see flicker.

    Actually i have no choice for my controller as I want to use available one with me i.e 89c2051
    you are at a loss, without a PCA you will not be able to control 3 PWMs (RGB) concurrently for more than a very few LEDs.

    and as I am comfirtable with C programming I want to program it in C.
    in C you will not be able to do it for more than a very few LEDs.

    anyhow, the method is:
    for 1/2ms unblank the appropiate colors
    for 1ms unblank the appropiate colors
    for 2ms unblank the appropiate colors
    for 4ms unblank the appropiate colors

    the above requires very fast code, for more than a few LEDs I have always had to resort to assembler

    this gives you a resolution of 4 bits per color

    How many LEDs do you want to contol.

    Erik