Ethernet based RGB LED strip controller, diagram and asm source released under the GPL license

Ethernet based RGB LED strip controller, released an other 11848 lines of asm under the GPL. makes 14476 bytes of program memory, 16k almost full...

formatting link

This one uses some power MOSFETS, so it should be able to drive many meters of RGB LED strings.

One would almost think I did not know about C... hehe asm is cool.

Reply to
Jan Panteltje
Loading thread data ...

under the GPL.

RGB LED strings.

nice project but one question- If you're using PWM, why is the frequency use to drive the LEDs changing?

Reply to
Cydrome Leader

On a sunny day (Tue, 1 Jun 2010 15:47:35 +0000 (UTC)) it happened Cydrome Leader wrote in :

under the GPL.

of RGB LED strings.

The reference values are in the 8 bit registers red, green, and blue. The registers red_sum, green_sum, and blue_sum are also 8 bits wide. The reference value is added each loop iteration to the sum value, when overflow a carry results, and the LED is set 'on', if no carry the LED is set 'off'. If you add a little bit (say low value for red) then it takes longer (more iterations) for the sum to overflow. If you add a lot, then the sum overflows more often, you get more ON states per number of loop iterations, so per time.

This is executed in main in a loop:

; do the PWM thing do_rgb: do_red: bcf STATUS, C movfw red addwf red_sum btfsc STATUS, C goto red_on ; red off bcf RED_PWM goto do_green red_on: bsf RED_PWM nop

do_green: bcf STATUS, C movfw green addwf green_sum btfsc STATUS, C goto green_on ; green off bcf GREEN_PWM goto do_blue green_on: bsf GREEN_PWM nop

do_blue: bcf STATUS, C movfw blue addwf blue_sum btfsc STATUS, C goto blue_on ; blue off bcf BLUE_PWM goto col_done blue_on: bsf BLUE_PWM nop col_done: ; do other things

goto do_rgb

Reply to
Jan Panteltje

under the GPL.

RGB LED strings.

Not to put any one in a trans ?

Reply to
Jamie

asm under the GPL.

of RGB LED strings.

set 'off'.

iterations) for the sum to overflow.

per number of loop iterations, so per time.

Is it correct to say you're really changing the duty cycle of on and off, but not at fixed rates as in true PWM, and this rate is based off how fast you overflow?

[I can't read assembler so I'm truncating the code]
Reply to
Cydrome Leader

On a sunny day (Tue, 1 Jun 2010 21:49:56 +0000 (UTC)) it happened Cydrome Leader wrote in :

is set 'off'.

iterations) for the sum to overflow.

per number of loop iterations, so per time.

It depends how you look at it. Of course I change the duty cycle, but like this:

-- -- -- | |__________________________| |__________________________| |__ dimmer

-- -- -- | |__________________| |__________________ | |________________ brighter

See, now the frequency is higher, and the off time versus on time has decreased, the LED is brighter.

Reply to
Jan Panteltje

On a sunny day (Tue, 01 Jun 2010 14:51:25 -0400) it happened Jamie wrote in :

of RGB LED strings.

Those who suffer from epileptic seasures should stay away from stroboscopes and maybe PWMed LEDS?

I do not think this one goes low enough in frequency for that though.

Reply to
Jan Panteltje

Cydrome

:

the LED is set 'off'.

(more iterations) for the sum to overflow.

states per number of loop iterations, so per time.

off,=20

dimmer

brighter

decreased, the LED is brighter.

So it's PFM really. Small matter, it gets the job done.

Reply to
JosephKK

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.