Ethernet based RGB LED strip controller, diagram and asm source released under the GPL license
Jun 01, 2010 7 Replies
J
Jan Panteltje
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.
Didn't find your answer? Ask the community — no account required.
C
Cydrome Leader
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?
J
Jan Panteltje
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
J
Jamie
under the GPL.
RGB LED strings.
Not to put any one in a trans ?
C
Cydrome Leader
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]
J
Jan Panteltje
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: