MAX7219 and 2-Digit Display

First post on this forum, largely because I've had trouble finding help anywhere else on the internets. I fully admit that I have no idea what I'm doing with this; please help.

I have an Uno, a MAX7219 chip and an 18-pin, 2-digit 7-segment display:

I've got the datasheet for both the chip and the LED display. I have some simple code which should display a digit on the display. Yet, when I connect it all and upload the code, the connected digit simply flashes and doesn't display anything. If I reset the Uno, it does the same and then stays blank.

I used the example code on Arduino Playground - LedControlDemos.

For the wiring, I connected the MAX7219's DIN, CLK, CS to the relevant pins stated in the code. I connected the V+ to the 5V supply. I connected the ISET pin to 5V via a 10k resistor. I connected the two ground pins to ground, and the Digit0 pin on the MAX7219 to the pin 14 on the 7-segment which should control the left-hand chip. Then I connected up A-G on the MAX7219 to the A-G for the left-hand digit on the display.

I don't have a circuit schematic, but here are photographs:

I think it's arising because I've making an error in my wiring, but I've struggled to find any tutorial or explanation that helps to answer my problems (and believe me, I've tried reading through everything), so maybe I'm just being an idiot. What am I doing wrong?

You must be kidding.
2017-08-13_13-15-04.jpg

Show us a schematic.
Where is the chip decoupling?

.

larryd:
Show us a schematic.

I'll hack a schematic later and post it up. To be honest, I figured that what I've done with the wiring was so wrong that it didn't seem worth making a schematic, but I will endeavour to do so.

The mess of wiring is because, yep, this is my first attempt at 7-segment stuff. FYI, the 7-segment display doesn't connect to power or ground; it has all its pins going to the MAX chip - should that be right? I've only wired up one digit now as well for testing (and to avoid wiry mess) but the same response happened when I had both digits wired up.

larryd:
Where is the chip decoupling?

I assume you mean the decoupling capacitors? The few guides on MAX7219 I've seen online (I mean, ones which involve actual wiring to a display; not just the pre-packaged circuit) haven't specified the need for capacitors.

This one (https://www.pjrc.com/teensy/td_libs_LedControl.html) is what I've been trying to replicate, but I admit to not understanding how the wiring in the photograph translates to its schematic or what it looks like in real life. What is wired to what, and should there be some decoupling going somewhere?

Okay, so here is a Fritzing schematic. Hopefully it is clearer than photos:

I couldn't find a match for the 2-digit display that I have (18 pins), so I hacked it together using 2 digits next to each other. In my sketch and IRL, I wired up only the left-hand digit because otherwise it was an even horribler mess.

The digit is hooked up to the Digit 0 pin on the MAX7219 (yellow wire).

The actual Fritzing sketch is attached here; ignore the Schematic view because it's not representative - look at the Breadboard view instead.

2Digit_7Seg_MAX7219.zip (18.4 KB)

Most people here will not open a ZIP file.
Attach the image to your next post.

.

Most people here do not care for fritzing diagrams. It is frequently too difficult to tell what pins are being used.
Pencil, paper and a digital camera work if you provide the proper detail in your diagram (like pin usage)

ignore the Schematic view because it's not representative - look at the Breadboard view instead.

No the schematic view is the real circuit. If you are saying ignore it then the whole thing is useless.

? The few guides on MAX7219 I've seen online (I mean, ones which involve actual wiring to a display; not just the pre-packaged circuit) haven't specified the need for capacitors.

Then they are just crap and should be ignored because he, the writer, hasn't got a clue about what he is doing. I say he because a woman would not be such an arrogant idiot.

Ok, so I thought that my hosted images were displaying, but it seems like they're not. I've gone back and edited the links so they point somewhere. Sorry, my bad.

I did attempt to upload a direct image, honest 'guv.

Grumpy_Mike:
No the schematic view is the real circuit. If you are saying ignore it then the whole thing is useless.

No, I say to ignore it because Fritzing doesn't have the part that I'm using and so I had to frig the whole thing so that the breadboard view looks like my breadboard. As a result, Fritzing thinks that there are 2 x one-digit displays (each with 10 pins) whereas my actual circuit has 1 x two-digit display (with 18 pins), and the schematic view "looks" incorrect.

No, I say to ignore it because Fritzing doesn't have the part that I'm using

Which is the main reason why Fritzing is crap.

What you are supposed to do is to create a part in Fritzing that matches what you are using. The big problem is that this is way too hard for beginners so they substitute parts leading to all sorts of misunderstanding.

It is like playing the game Twenty Questions only you can only answer yes or no, BUT when you answer yes you have to say no, no and when you answer no you just say no. Sure you can do it but it is ten times harder to switch your thinking round. When a schematic is not telling you the truth it is hard to switch in your mind from what you see to what is meant to be. This is easy to do if you know nothing to begin with, but the more you know the harder it is.

Even if you have the right part, Fritzing doesn't label the pins of chips, meaning everyone has to get out the data sheet, to see wtf they are to check the diagram.

This is why we recommend using a universal graphite font generator, otherwise known as a pencil, and using it to make marks on a paper that represent the schematic symbol for what you have.

Okay. I found this difficult, but hopefully what I've produced is of some use in diagnosing the problem.

Here are the pinouts for the MAX7219 chip and my display:

Here is my breadboard display and the relevant datasheets for the two parts:

And here is how the chip and display connect together:

(yes, because of poor planning in my drawing, the GFAB connections wouldn't join up on my diagram because otherwise it would look like a mess. Long story short, the letters on the display are connected up to the same letters on the MAX7219 chip on my actual circuit)

What might be where it's failing? Is it the lack of decoupling, or is it some fault in how I've assumed the wiring should be?

Try connecting to Digit 7 rather than digit 0 on the 7219 to see what happens.

Place a 100nF capacitor from pin 19 to GND on the 7219.

.

Always show us your current compete sketch.
Use CTRL T to format the sketch.
Please use code tags.
Use the </> icon in the posting menu.

[code] Paste sketch here. [/code]

larryd:
Try connecting to Digit 7 rather than digit 0 on the 7219 to see what happens.

Place a 100nF capacitor from pin 19 to GND on the 7219.

Thanks for the suggestions - connecting to Digit 7 (or indeed any other digit) does nothing, so I'm pretty sure that it's registering the Digit 0 correctly.

The only thing that happens to the display is that it momentarily lights up when the Arduino is reset, and even then it only creates an 'A' pattern which causes me to think that there's still some wiring bugs because I'd expect all 7 segments to light up.

I haven't got any 100nF capacitors (only 1microF, which causes nothing at all to happen to the display even when I reset it) so will have to pick some up to test the circuit.

The Arduino is loaded with the 7SegmentDemo from: Arduino Playground - HomePage

I haven't got any 100nF capacitors (only 1microF, which causes nothing at all to happen to the display even when I reset it) so will have to pick some up to test the circuit.

What is more important than the value is that they must be of the ceramic type.

The only thing that happens to the display is that it momentarily lights up when the Arduino is reset, and even then it only creates an 'A' pattern which causes me to think that there's still some wiring bugs because I'd expect all 7 segments to light up.

Things that happen on switch on rairly have any significance.

Check my circuit against yours. This is just omitting the decoupling capacitor. Note how the pin numbers are moved around the chips to make the wiring simple to understand. I made this and it worked.

Gents, thanks for the tips so far. I can confirm that my circuit is equivalent to Grumpy_Mike's, and it seems as though my wiring is set up fine.

My code is below:

#include "LedControl.h"
LedControl lc=LedControl(12,11,10,1);

void setup() {

  lc.shutdown(0,false);
  lc.setIntensity(0,8);
  lc.clearDisplay(0);


  lc.setChar(0,0,4,false);
}


void loop() {

}

What I've noticed is that, when I boot up the Arduino or reset it, the display briefly flashes with the current character (in the above code, the digit "4") and then goes blank again. I'm still waiting for my decoupling capacitors. Does the absence of the decoupling explain the above behaviour, or is there something else fishy likely to be going on?

Does the absence of the decoupling explain the above behaviour,

No.

As I said any flashing on switch on is not a useful indication of any fault.

I would suggest that the circuit is not wired like you think it is. Maybe some connections are not making properly if you use solderless bread board.