Pages: [1] 2 3   Go Down
Author Topic: Scrolling message 8X8 LED array - Max7221?  (Read 7566 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay, I have built this project ( http://arduino.cc/playground/Main/DirectDriveLEDMatrix ) several times to display characters using direct drive fro the Arduino board.  Although I've tried this several times with my R/G LED array, I simply cannot get it to work properly.  I only receive some very rapid flashing of all the LEDs in various brightness.  With that said, I do believe that it may be drawing too much current for a proper build anyhow....

So, I bought a couple of Max7221 ICs as they seem to be the choice for this type of project, however I cannot locate my original site for building/programming that O bought the 7221 for.....

Would anyone out there be able to point me in the direction of some good instructions where I could create a scrolling message on my Arduino (with or w/o the max7221). One color is fine as I know the pin arrangement of the bi-color 8x8 LED array.  here is a YouTube that makes it look simple.... ( )  For  some reason i cannot get this direct drive method to work!

Any help/code/instructions would be helpful.  smiley
« Last Edit: July 23, 2012, 01:35:43 pm by danielNC » Logged

Show Your Work
Offline Offline
Edison Member
*
Karma: 14
Posts: 1098
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If no one has posted a better example, I will post something I did with a 7219 (pin compatible with 7221) that scrolls a message later today in about six hours if I can figure out how to post a video to YouTube.
« Last Edit: July 23, 2012, 02:28:43 pm by JoeN » Logged

I have only come here seeking knowledge. Things they would not teach me of in college.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 535
Posts: 27046
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I wrote some code a while back, I will see if I can find it, the message to be scrolled was stored on an array, 8 x 80 or whatever.
During setup, some initial 8 bytes was sent to the MAX7221 via 8 SPI commands in no-decode mode.
Then every 200mS, or whatever scroll speed you wanted, the location pointer into the array would be incremented by 1 and the 8 bytes from there on would be sent to the MAX7221. 200mS later, the pointer would again be moved over 1 and the data sent out again.
If the pointer was at the end, then bytes from the beginning would be used to wrap the message around. (example 97,98,99,0,1,2,3,4).
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would love to see what you have already done.  Kind of new to the Arduino and learning a lot as I go along.

I have been searching for about a week and cannot find anything else out there.

Can you either post or send to my email....  arduino@alich.com

Cheers, and thank you in advance!
Dan
Logged

0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This was my first arduino project:

Logged

Show Your Work
Offline Offline
Edison Member
*
Karma: 14
Posts: 1098
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, here is my text scroller, no schematic but basically it is simple:  Hook up the first MAX7219 to the pins indicated in the software, daisy chain them, despike them, give them a reasonable value resistor, hook them up to the Matrices after you determine the correct matrix pins via their datasheet.  The resistors chosen are 33K.  The scrolling is a little choppy, but readable.  Not really sure why.  Code is attached.





* ArduinoPlus6MAX7219s.ino.txt (10.36 KB - downloaded 351 times.)
« Last Edit: September 22, 2012, 11:24:54 pm by JoeN » Logged

I have only come here seeking knowledge. Things they would not teach me of in college.

Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Very nice, I'll have to play with this.  Not sure on the build, but I'll do some research.

Dan
Logged

Norfolk UK
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2544
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Attached is code I used to test scrolling messages on a pair of MAX7219 chips wired as a 16x8 matrix.

* ScrollTest2.ino (13.32 KB - downloaded 199 times.)
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 535
Posts: 27046
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice work Riva.

Code:
const int DIN = 12;            //DataIn pin (18)
const int CLK = 11;            //Clock pin (17)
const int LOAD = 10;           //Load pin (16)

Why not use SPI for these transfers?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you Riva.  Looks great.  I do some research on how to hook up the array to the chip and see what happens.

I have a 7221 and from what I've been reading, they are very similar in function and seem to be nearly interchangeable.

I think this is the code I was looking for.  Thanks again!

    Crossroads....  SPI?  I guess you just went over this newbies head again.  smiley  So much to learn!
Logged

Norfolk UK
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2544
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice work Riva.

Code:
const int DIN = 12;            //DataIn pin (18)
const int CLK = 11;            //Clock pin (17)
const int LOAD = 10;           //Load pin (16)

Why not use SPI for these transfers?
The MAX7219 library (based on LedControl libray but butchered to reduce size) was written to allow the defining of the pins and bitbangs so I just left it at that. The project originally ran on an ATMega8 and only had 68 bytes program memory free so probably would not have taken the SPI library. I have since de-soldered the 8 and replaced with a 328 to give more memory to add more functions but did not bother to change it.
Logged

Show Your Work
Offline Offline
Edison Member
*
Karma: 14
Posts: 1098
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is a dup of another post because my crap code is on this thread too.

The flaw in the design where there is some jitter in the display is a software problem on my side, not the LED library or hardware.  What this software does is scan each row by advancing the current bit being displayed on the current character in the string until it gets to the end of that character (by length lookup) and then advancing to the next character.  After each row it restores the position and advances the row until it gets to row 8.  At the end of writing the rows, the software restores the position and advances by one bit (column) to achieve the scrolling effect.  It has to know the correct current character to look up the current character length.  Even though the software it restores the start bit position and character in string position it does not restore the current character correctly for length lookup, it uses whatever character was displayed (or partially displayed) last.  This causes the counter not to advance a lot of the time and the jitter.  If you are using my software for scrolling purposes, fix it with this change.  Add the one line indicated.

Code:
   curcharix = curcharixsave2;
    curcharbit = curcharbitsave2;
  
    // advance the current character bit of current character

to

Code:
   curcharix = curcharixsave2;
    curcharbit = curcharbitsave2;
  
    curchar = msg[curcharix];
  
    // advance the current character bit of current character

Sorry for anyone that was inconvenienced by this bug.  I actually totally rewrote the part of the code that writes to the MAX7219s and eliminated the LEDLibrary and this bug persisted which led me to the obvious conclusion that my code sucked somewhere.   At least now I know how the MAX7219 works on a register level, though.  The new version can scroll the display so fast it is not readable without a decent delay.

Attached code has been updated.
« Last Edit: September 22, 2012, 11:25:57 pm by JoeN » Logged

I have only come here seeking knowledge. Things they would not teach me of in college.

Canberra Australia
Offline Offline
God Member
*****
Karma: 11
Posts: 518
Hardcore Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi  JoeN,  

I have been playing around with some Max 7219's and scrolling text code and would like to try out your code posted here.I love the AC / DC lyrics as the message…Angus would be proud of you   smiley-cool Just a questions if I may:

So to scroll text across more than one 8 x 8 matrix just daisy chain the 7219'S with each 7219 connected to it's own matrix

Thanks for sharing this and keep Rockin' brother   smiley-cool

Pedro.
« Last Edit: September 25, 2012, 02:02:22 am by Pedro147 » Logged


Show Your Work
Offline Offline
Edison Member
*
Karma: 14
Posts: 1098
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi  JoeN,  

I have been playing around with some Max 7219's and scrolling text code and would like to try out your code posted here.I love the AC / DC lyrics as the message…Angus would be proud of you   smiley-cool Just a questions if I may:

So to scroll text across more than one 8 x 8 matrix just daisy chain the 7219'S with each 7219 connected to it's own matrix

Thanks for sharing this and keep Rockin' brother   smiley-cool

Pedro.

So sorry, I never got this question.  I am going to have to use the 'replies' feature more.

Yes, that is exactly what you do.  The 7219's are just shift registers to the microcontroller.  The library is just shifting in data.  Any "extra" data just falls off the "left" end.   I am using 6 displays and 6 7219 driver chips.  Providing more data than displays/7219 driver chips doesn't hurt anything, it is just not efficient.  When you have more than six displays you will have to modify the following line to make it work:

Code:
for (i=5;i>=0;i--) // Loop through our 8 displays

Note I say 8 displays, it is actually 6, I think I intended it to be 8 in the beginning.

Logged

I have only come here seeking knowledge. Things they would not teach me of in college.

Canberra Australia
Offline Offline
God Member
*****
Karma: 11
Posts: 518
Hardcore Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for getting back to me JoeN. Yes I used your code to scroll across two matrices... very nice thanks. I do prefer scrolling code like yours, where you just type in the text you wish to scroll and it is accessed from a font file within the code rather than entering an array into the actual loop for every char (tiresome  smiley-cool )

Thanks again and happy soldering / coding Pedro.
Logged


Pages: [1] 2 3   Go Up
Jump to: