28x1 and max7219 trying to fade an led effect

xtech007

Senior Member
Hi all!
I was playing around with an max7219 connected to a row of led's on an breadboard controlled by a 28X1.
nothing fancy, colum1 on- different segments On, Off and so forth.
Tried to generate an Fade effect with following code but no luck. :(

To my Understanding the max7219 can generate this effect by software using the Intensity register, and only the whole digit(column) not the segments.

Have anyone accomplished any fade effect with the max7219?
Feel free to modify my code!
Thanks!
 

Attachments

BeanieBots

Moderator
The MAX7219 can certainly make the LEDs bright or dim but they do not have full range like you can get using PWM between 0% and 100%
What I've done before is to use the MAX7219 only for decoding and modulate buffers with PWM for full range control.
 

xtech007

Senior Member
Thanks for the reply!

Beaneabots thx for the reply!
Would you share the code used to fade the led's?

Humm.. Buffers.. Have no idea what they do or are.
How many led's where used?
 

xtech007

Senior Member
Anyone??

Hummm..
I'm starting to think not many have or like the max7219 to drive Led's independent from 8x8 array or 7 segment lcds.

Ok, maybe this is the question I should be to asking!

What can be use to drive and control many RGB Leds with a picaxe 28X1?

I do know that with the use of nothing but the 28X1 can drive top 2 RGB's.
But need to drive more then 15 or more.

Thanks!
 

MartinM57

Moderator
So they're RGB LEDs now - not just single colour? MAX7219 would be a bit contrived for RGB LEDs...

You say "Tried to generate an Fade effect with following code but no luck..." but your code does nothing regarding changing intensity :(

Main:

'test leds brightness

maxReg = $01 'set dig0 or Colum1 ON
maxData = $001 'set segment H ON
pause 500
gosub SendTo_Max7219

maxReg = intensity 'set brightnes
for maxData = $01 to $09
[SHOULDN'T YOU DO SOMETHING HERE LIKE "gosub SendTo_Max7219"???]
next
pause 5000
gosub Clear_MAX7219
pause 500
goto main

..and IIRC the intensity setting can be $01 to $0F, so try with...

for maxData = $01 to $0F
gosub SendTo_Max7219
next
 

xtech007

Senior Member
I will give it a try!!

Martin Thanks for your reply, I have learned lots from your post regards the Max7219 .

I mention an Led at the beginning of the post to start simple!
But eventually reach to RGB control.
I'm still at the LED level & can not control!!!!!!! (Brightness)

You are right!!
If i never add the sendto the max will never receive the data!!
I understand a little better now.

Ps: the senior tag on my profile just stands for how long I've been here reading mainly! My programng skills are just a little better then the average beginner.

Neil, I will read up code.
Thanks for the reply!
 

westaust55

Moderator
Ok, maybe this is the question I should be to asking!

What can be use to drive and control many RGB Leds with a picaxe 28X1?
Have you considered the World Semi WS2803 chip?
These have 18 channels each independently with 256 levels.
One chip can drive 18 single colour LED or six RGB LEDs.
Daisychain 2 for 12 RGB LED's or daisychain 3 for 18 RGB LED's, etc.

I posted a getting started tutorial for the WS2801 - a 3 channel version and others have threads for the WS2803 - try a forum search for more information.
Alsos ee here: http://www.world-semi.com/uploads/soft/120502/1-120502110159.rar (download and unzip the datasheet).

From the PICAXE forum, here is my thread:
http://www.picaxeforum.co.uk/showthread.php?22713-Getting-Started-with-the-WS2801-3-Channel-RGB-LED-Driver-with-PWM-output
and here is a couple for the WS2803:
http://www.picaxeforum.co.uk/showthread.php?25366-Help-using-SHIFTOUT-with-14m2-(to-drive-a-WS2803-chip)
http://www.picaxeforum.co.uk/showthread.php?23145-WS2803&highlight=Ws2803
 

xtech007

Senior Member
video result..

Sorry for the delay, had double shift!
Tried the modified code.
And no luck, added the sendto and same result.
Here is a video:
http://youtu.be/scSSt9LUVLM

No fade yet!
 

MartinM57

Moderator
aha - fatal flaw in your code :)

try...

for maxData = $01 to $0F
gosub SendTo_Max7219
pause 500
next

...and delete the "pause 5000" after the "next"

You are (hopefully) currently going around the intensity loop really really fast and just seeing the final result - i.e. max intensity - for 5 seconds. With a 0.5 second delay INSIDE the loop you should see the brightness step through the different intensities
 
Top