tinyRGB

The easiest way to control a RGB Led.

avrRGB1
tinyRGB uses an ATMEL Attiny15L (8pin uC) to control a standard RGB Led.

R1 is a pullup Resistor for Reset generation (should be about 10k).
R3 to R5 depend on the LED you are using. You can calculate the resistor as followed:

Rx = (Vcc-Vf)/Im

[Vcc: Volatge of power supply, Vf: Vorward Voltage of the Diode, Im: Max current of LED or AVR pin (20mA)]

If you want to control power LED’s read here: powerRGB.

The software is written in Assembler (avra under Linux, should be compatible to AVR Studio). Timer0 is used to generate interrupts at about 30kHz. This interrupts are used to build a 8bit PWM. Timer1 is used to change the color pattern.

avrRGB2

Downloads:

Tags: , , ,

13 Responses to “tinyRGB”

  1. Robert Ibener AUSTRIA Says:

    Hello Tobi,
    your code just fit my needs for my application.
    The Program works fine , color-change is smooth, except for one small (but disturbing) side-effect:
    When one of the LED (either R,B or G) dimms up (gets brighter) there is a short “blackout” during the dimm-up-process.With “blackout” i mean, that the LED which gets brighter will switched off for a very short (but visible) time, then continues with dimming.This “blackout” shows up randomly, sometimes at the beginning of the dimming-process,sometimes in the middle or near the end or even when the LED is fully on.The “blackout” is only in the dimming-up-phase visible.Dimming-down is smooth and o.k. I have simulated your program in AVR-Studio4 for hours to detect this “blackout”, but with no success.In AVR-Studio all seems to be fine, no reason for a “blackout” found.I have also tried several Tiny15´s but no change at all.
    My Question:Do you know about this problem and (if available) can offer a patch to eliminate this “blackout” ??
    Best regards and thank you for this great code
    Robert Ibener/Vienna

  2. theFloe AUSTRIA Says:

    Someone reported this “blackout” earlier. I had a short look at the code then but couldn’t find the source. When I have some time I’ll have a look at it again.

    Tobias

  3. theFloe AUSTRIA Says:

    so here’s the new version of the code. The fading has been improved and I couldn’t see any “blockouts” or “glitches” using an 1W RGB Led.

  4. Robert Ibener AUSTRIA Says:

    Hello Tobi,

    thank you for your new version.It works as expected now, even i am missing some features built in in the previous version (for example:
    adjustable dimming steps,adjustable time of color-change,e.t.c).
    I will try to implement above features into the new version.If you are interrested, i will send you the code, but it will need some time!

    Best regards
    Robert Ibener

  5. theFloe AUSTRIA Says:

    I’m working on it. Do you need it faster or slower?

  6. Robert Ibener AUSTRIA Says:

    Hello Tobi,

    it´s hard to say that i need it faster/slower.It depends on my applications (Moodlight-Stuff).
    For shure i need some adjustment-points in the code to control dimmtime/color-change-time.With only changing the Timer0/1-Prescaler my problem is not solved.

    But dont get nervous about this.It is not soooooo urgent and (i think) it´s only my personal wish for my PERFECT application.

    In the meantime i have adapted your code for a Tiny45.

    Best regards
    Robert Ibener

  7. powerRGB at Tobi’s Corner GERMANY Says:

    [...] The software for the AVR is the same as for tinyRGB. [...]

  8. Andreas GERMANY Says:

    Hello Tobi, hello Robert,

    at first a happy new year and I´ll hope that you can understand my bad english.
    I think that I´m the “Someone” who reports earlier from this “blackout”.
    Now I have test allso the new code for the Tiny 15 and I can say:
    “It works fine and now there are no “blackouts” to see. Great work.”
    Sometimes I´m also think that it wood be fine, when there are some adjustment-points in the code to control dimmtime/color-change-time.
    Please let me know, if you Tobi or you Robert implement this features into an other new version. I´m also interested on the adapted code for the Tiny45. Robert, can you send me this code or where can i find the code in the www ?

    Best regards
    Andreas

  9. Robert Ibener AUSTRIA Says:

    Hello Andreas,

    sorry for my looooong delay to answer your question about the ATTiny45 code.As i have no Homepage for downloading, i ask Floe for help:
    Which is the best way to transfer my modified Code to Andreas??? (May be, Floe is also interested to check the Code?)

    Best regards from Vienna
    Robert

  10. theFloe AUSTRIA Says:

    Send me an email with your code and I will publish it here.

  11. Simon NEW ZEALAND Says:

    How do you download code to it?

  12. theFloe AUSTRIA Says:

    The programming part is not shown here in the circuit. But you can program it like all other AVR connecting MISO (PB1), MOSI (PB0), SCK (PB2) and RESET (PB5) to an ISP Programmer.

  13. Simon NEW ZEALAND Says:

    ok, thanks

Leave a Reply