Difference between revisions of "StellaLight"

From Ethersex_Wiki
Jump to: navigation, search
(udp control)
Line 8: Line 8:
|DEPENDS=[[DMX Storage]] (optional), udpStella (optional)
|DEPENDS=[[DMX Storage]] (optional), udpStella (optional)
|CODE=[https://github.com/ethersex/ethersex/tree/master/services/stella https://github.com/ethersex/ethersex/tree/master/services/stella]
|CODE=[https://github.com/ethersex/ethersex/tree/master/services/stella https://github.com/ethersex/ethersex/tree/master/services/stella]

Latest revision as of 21:21, 2 April 2013

menuconfig Applications->StellaLight: Multichannel pwm
Pinning yes
Ecmd yes
Uses Timer Timer 2
Depends on DMX Storage (optional), udpStella (optional)
Code https://github.com/ethersex/ethersex/tree/master/services/stella

StellaLight produces PWM signals on up to 16 independent pins for driving LEDs or servo motors.


Stella uses an 8-bit Timer of your choice for producing the PWM signals. Since the overflow interrupts need to be very consistent, StellaLight will not work flawlessy when other modules are active that disable the interrupts for a short amount of time.

This is a list of module where you can expect some problems with: Onewire, RFM12 (please add more if you find some).

Moreover StellaLight does not support Gamma Correction since that would require at least 10-12 bit PWM.


In Menuconfig you can select the prescaler. The higher the frequency, the more often the StellaLight PWM functions will be executed, leading to an higher overall load of the device. So if you run into problems, try decreasing the frequency, ergo increase the prescaler.

Option Prescaler
Very slow 1024
Slow 256
Normal 128
Fast 64

You can calculate the resulting frequency by using this formula:

F_CPU: The clockspeed of your AVR (like 8Mhz, 16Mhz etc.)


So given a setting of "Normal" on a 16Mhz device will result in 244Hz which is pretty good for most setups. So more than enough for the human eye (10 times more)

If you have enabled DMX Storage in Menuconfig, you also can set the universe and start channel of StellaLight, so you can control StellaLight via Artnet or DMX FXSlot.


STELLA_PORT1_RANGE(PXI,PXJ) sets the range (I to J) of StellaLight controlled pins on PORTX
STELLA_PORT2_RANGE(PX2I,PX2J) sets the range (I to J) of StellaLight controlled pins on PORTX2
STELLA_USE_TIMER(I) programs TimerI for StellaLight

Two examples:

1. 3 LEDs (e.g. RGB) on PORTA, Pins: 0,1,2

ifdef(`conf_STELLA', `dnl

2. 15 LEDs (e.g. 5x RGB) on PORTA, Pins: 0,1,2,3,4,5,6,7 on PORTD, Pins: 0,1,2,3,4,5,6

ifdef(`conf_STELLA', `dnl

udp control

We recommend to use the DMX Storage. But for easy set ups it is possible to use a simple udp protocol to control stella channels. Activate protocols->udpStella and configure the port. A datagram for stella has three bytes:

Byte # Semantic Valid values
1 Command Byte
2 Channel 0-15
3 Value 0-255

You will get back an UDP datagram if you send the STELLA_GETALL command. It consists of an identifier ["STELLA"]+[Amount of channels]+[channel#1]+..+[channel#n]


Have a look at Starburst for an improved and more resource-conserving solution.