Go Down

Topic: limit rows on MAX7219 for matrix display ? (Read 1 time) previous topic - next topic

Boffin1

I am finally onto a project that displays two 8 character names on a display.

I have made single character pcbs  with 7 x 5 leds each with a MAX7219 mux / driver

I will be storing the characters in flash memory ( as per Nick Gammons forum ).

If I were to use the 7 seg  decoding function of the MAX, I could limit the number of columns to 5, and get a 20% duty cycle for greater brightness than the full matrix 12.5%.

There are 2 problems though,  firstly this function doesn't seem to be available for driving a matrix, and secondly I have connected my digits to the rows, and the segments to the columns, so limiting the digits to 5 would chop off the top of my display .

Is there a way to limit the rows to 5 ?
With my mobile phone I can call people and talk to them -  how smart can you get ?

Paul__B

Your question is puzzling.  The 7 segment decoding function relates only to 7-segment displays and limits the actual patterns to digits 0 to 9, "-" and the characters "H", "E", "P", "L"; 16 patterns including blank.

But you are not simply producing 7-segment displays?

For matrices, you can limit the number of columns displayed to five with the Scan Limit register, but this means that the columns are common cathode and you have to code the data bytes to each column rather than row.  It is your choice as to how you wire it.

CrossRoads

Digits can be limited down to 1; if <3 tho, the Rset resistor may need adjusting:

The scan-limit register sets how many digits are displayed,
from 1 to 8. They are displayed in a multiplexed
manner with a typical display scan rate of 800Hz with 8
digits displayed. If fewer digits are displayed, the scan
rate is 8fOSC/N, where N is the number of digits
scanned. Since the number of scanned digits affects
the display brightness, the scan-limit register should
not be used to blank portions of the display (such as
leading zero suppression). Table 8 lists the scan-limit
register format.
If the scan-limit register is set for three digits or less,
individual digit drivers will dissipate excessive amounts
of power. Consequently, the value of the RSET resistor
must be adjusted according to the number of digits displayed,
to limit individual digit driver power dissipation.
Table 9 lists the number of digits displayed and the
corresponding maximum recommended segment current
when the digit drivers are used.

I don't see anything in the datasheet that says this is not available when using No-Decode mode.

John,
You seem to have shot yourself in the foot by using the digits as rows instead of columns.
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.

Boffin1

#3
Dec 13, 2013, 05:12 pm Last Edit: Dec 13, 2013, 05:14 pm by Boffin1 Reason: 1
Thanks guys,

( slap on very tired forehead ! )

I can mount the LEDs the other way round ( a to k )   ?

I am just assembling a second pcb.
With my mobile phone I can call people and talk to them -  how smart can you get ?

CrossRoads

#4
Dec 13, 2013, 07:27 pm Last Edit: Dec 13, 2013, 07:38 pm by CrossRoads Reason: 1
Sure, set up the anodes to go horizontally, and the cathodes vertically.
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.

CrossRoads

Might have to do some playing to figure out which corner lights up when you send this to the registers:
01-> 1
02 -> 0
03 -> 0
04 -> 0
05 -> 0
06 -> 0
07 -> 0

8x8
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000001

or 7wide x 5high, send 7 byte
0000000
0000000
0000000
0000000
0000001

or 5wide x 7 high, send 5 bytes
00000
00000
00000
00000
00000
00000
00001

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.

marco_c

Try using the MD_MAX72XX library (link in the repository below). My Parola modules are probably wired the same way as your matrix and you may find that the scan limit works the way you expect.
Arduino libraries http://arduinocode.codeplex.com<br />Parola for Arduino http://parola.codeplex.com

CrossRoads

He wanted to limit the segments tho for 5x7 displays that were flipped 90 degrees - isn't Parola set up for 8x8 displays with cathode columns?
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.

marco_c

5x8 would come from the scan limit, 5x7 comes from not wiring one of the bits.

Parola library sits over the top of the 'hardware' library MD_MAX72xx. This library has recently been upgraded to allow use with the more generic hardware available on eBay and other sources (which is basically 'flipped' 90 degrees). One or other modes may suit, depends on the actual details of the wiring. I figure for the cost of a download and a compile of the test program (which exercises the scan limit) it is worth a try. If it does not work no-one is worse off :-)
Arduino libraries http://arduinocode.codeplex.com<br />Parola for Arduino http://parola.codeplex.com

Boffin1

I have spent a lot of time on this today, I thought it would be time for me to move from v22 to V1.0.4,  which I have quickly tried to do over the last year or so, many times.

I got over the first hurdles, and actually got blink to work !!!

but now if I try to run a sketch with LedControl on V1.0.4  I get error message below

( the convoluted address was me extracting the arduino to a whole new fresh directory )

I havnt even got one row lighting steadily yet !  even in v22 ..

Code: [Select]


In file included from sketch_dec14a.pde:1:
C:\a NEW SCOREBAUDS folder\dec13arduino1 4\arduino-1.0.4\libraries\LedControl/LedControl.h:54: error: 'byte' does not name a type
C:\a NEW SCOREBAUDS folder\dec13arduino1 4\arduino-1.0.4\libraries\LedControl/LedControl.h:56: error: 'byte' does not name a type
C:\a NEW SCOREBAUDS folder\dec13arduino1 4\arduino-1.0.4\libraries\LedControl/LedControl.h:66: error: 'byte' has not been declared
C:\a NEW SCOREBAUDS folder\dec13arduino1 4\arduino-1.0.4\libraries\LedControl/LedControl.h:66: error: 'byte' has not been declared
C:\a NEW SCOREBAUDS folder\dec13arduino1 4\arduino-1.0.4\libraries\LedControl/LedControl.h:133: error: 'boolean' has not been declared
C:\a NEW SCOREBAUDS folder\dec13arduino1 4\arduino-1.0.4\libraries\LedControl/LedControl.h:144: error: 'byte' has not been declared
C:\a NEW SCOREBAUDS folder\dec13arduino1 4\arduino-1.0.4\libraries\LedControl/LedControl.h:155: error: 'byte' has not been declared
C:\a NEW SCOREBAUDS folder\dec13arduino1 4\arduino-1.0.4\libraries\LedControl/LedControl.h:166: error: 'byte' has not been declared
C:\a NEW SCOREBAUDS folder\dec13arduino1 4\arduino-1.0.4\libraries\LedControl/LedControl.h:166: error: 'boolean' has not been declared
C:\a NEW SCOREBAUDS folder\dec13arduino1 4\arduino-1.0.4\libraries\LedControl/LedControl.h:181: error: 'boolean' has not been declared
With my mobile phone I can call people and talk to them -  how smart can you get ?

Boffin1

The other confusing thing is that most of the examples have  the arduino  pin11 for clock, 12 for data , and 10 for LOAD ( notCS )

I thought that SPI pins were set at 11 for data, and 13 for clock ?  with a choice of not CS  ?
With my mobile phone I can call people and talk to them -  how smart can you get ?

CrossRoads

Yes, that's the part that gets me - got this great SPI hardware, and the LED library bit-bangs the control signals. I don't use it. Instead, SPI.transfer with 13 = clock, 11 = dataout, and 10 for CS.
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.

Boffin1

Its got me so confused,  but also one of the many examples today said that beware using lots of wire or breadboards as the SPI signals can get corrupt.

I am tempted to use my favourite shiftout at a nice slow pace that I send around to 20 chips over several square meters with no problem.

I guess I would have to just send out the extra register byte before each byte of bitmap data .
With my mobile phone I can call people and talk to them -  how smart can you get ?

CrossRoads

What, and people can't figure out how to slow down SPI?
Do what you gotta do I guess.
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.

Boffin1

"What, and people can't figure out how to slow down SPI?"     LOL

I aint got there yet :-)
With my mobile phone I can call people and talk to them -  how smart can you get ?

Go Up