MAX7219 7 segment LED Module with Edison board

Hi,

I'm very new to all of this so please be gentle! :slight_smile:

The ultimate project is a Instructable SousVide cooker but it's baby steps to get there. There are lots of instructables but I chose this one as its Arduino based and seems to have well thought out control code.

The only deviation from the instructable is that I got my hands on an Edison rather than an Arduino to make it work. I got the board loaded up and flashed and I got blink and the basics up and running OK.

Next I wanted to check out the 7 segment and MAX7219 worked OK on it. I got the same part as in the instructable:- http://www.banggood.com/MAX7219-Red-8-Bit-Digital-Tube-LED-Display-Module-For-Arduino-MCU-p-907849.html

I loaded the ledcontrol.h library and loaded up the LCDemo7segment which is at which point I got no further. I stuck with the default code and wired up the exact same pins in the example sketch. The display is either blank or shows all segments lit.

Is there something that I have missed in the default example code that I should have modified. It's only a single module and pins 10,11,12 connected.

Does the fact I am using Edison have any bearing - do I need to do something different there?

TIA.

Did you download the Aurdiuno code from here?

Did you follow these instructions?
pin 12 is connected to the DataIn
pin 11 is connected to the CLK
pin 10 is connected to LOAD

An idea ...
Can you connect a single LED with a resistor to one IO Pin at a time
and then BLINK that IO Pin On/Off to prove that your Sketch
can actually control that I/O Pin?

Next ...
The Edison has a set of Jumper (J-11 Swizzler) that control the PWM pins: 3, 5, 6, 9, 10, 11
Maybe these jumpers are not set properly for you to use D10 and D11.

So, could you try moving:
a) the wire on pin 10 to pin 7
b) the wire on pin 11 to pin 8

Then in the Sketch change this line of code

from ...
LedControl lc=LedControl(12,11,10,1);

to ..
LedControl lc=LedControl(12,8,7,1);

then recompile

Pins 12, 8 and 7 are not PWM pins

Now test your 8 Digit 7 Segment LED board.

mrsummitville:
The Edison has a set of Jumper (J-11 Swizzler) that control the PWM pins: 3, 5, 6, 9, 10, 11

. . .

Pins 12, 8 and 7 are not PWM pins

If the issue isn't the PWM settings, another thing to think about is how fast the I/O pins communicating with the MAX7219 are toggling. Since the Edison is so much faster than an Arduino, it's possible the controller is toggling the I/O pins too fast for the MAX7219 chip to keep up (especially since a lot of "MAX7219" chips are cheap clones).

If you're looking for something else to try, you could try slowing down the pluses sent to the MAX7219. (I have no idea how to do this on an Edison.)

DuaneDegn:
If the issue isn't the PWM settings, another thing to think about is how fast the I/O pins communicating with the MAX7219 are toggling. Since the Edison is so much faster than an Arduino, it's possible the controller is toggling the I/O pins too fast for the MAX7219 chip to keep up (especially since a lot of "MAX7219" chips are cheap clones).

If you're looking for something else to try, you could try slowing down the pluses sent to the MAX7219. (I have no idea how to do this on an Edison.)

After much ( too much ) research ...
Yes, the MAX 7219 is limited to only 10Mhz transfer rate.
Not an issue on a 16Mhz Arduino.
And I too have no idea have fast the Edison is actually executing Digital IO instructions.
I would think a hack in ShiftOut() is needed ...
Add a guaranteed 1 microsecond minimum delay between "Clock High" and "Clock Low".
This 1 microsecond delay would quickly determine if CPU speed was indeed the problem.

The Edison only "emulates" an Arduino.

mrsummitville:
I would think a hack in ShiftOut() is needed ...
Add a guaranteed 1 microsecond minimum delay between "Clock High" and "Clock Low".
This 1 microsecond delay would quickly determine if CPU speed was indeed the problem.

There are also minimum times between setting the CS line and changes in other lines. I think the same is true for the data line. I think it would be a good idea to add a delay between all parts of code which change pin states.

I use MAX7219 with SPI.transfer() at default 4 MHz clock speed (for Uno, 1284, Mega), the chip works just fine.
Chip is rated for 10 MHz clock speed.

CrossRoads:
I use MAX7219 with SPI.transfer() at default 4 MHz clock speed (for Uno, 1284, Mega), the chip works just fine.
Chip is rated for 10 MHz clock speed.

I think the question is what's the SPI clock speed of the Edison?

I think it could easily be faster than 10MHz.

I'm not sure if 10 MHz can be really trusted because I've seen some pretty suspicious looking MAX7219 chips which I suspect were really clones. I'm not sure if the cloned chips support 10MHz or not. Some of these suspicious looking MAX7219 chips have been on 7-segment displays like those purchased by the OP.

The suspicious MAX7219 chips appeared to work fine but I was using a pretty slow SPI clock (it was a bit banged driver written in the interpreted language Spin for the Propeller). I never tested these chips at 10MHz.

So does the SPI clock divisor command work on an Edison the same as on a 328/1284/2560 chip?
I've used the MAX7219 chips from taydaelectronics at 4 MHz, which are not real chips based on picture comparisons and a reply from MAXIM that tayda is not an authorized reseller, with no issues.