Makershed SMD LED Shield

I recently purchased a SMD LED shield to learn both multiplexing LEDs with shift registers (74HC595) and surface mount soldering. And for the first time at SMD, i think i did a pretty good job soldering. Now I wanted to try their sample coding for this shield to get some ideas......but none of their sample code did anything special or didn't work properly. There shouldn't be any reason none of it would work properly besides faulty coding as I've made my own sample code to test the shield and it worked fine. Honestly, a lot of their sample coding may have looked like it would of done something elaborate, but all i got was all the 8x8 LEDs blinking or a single line of LEDs solidly lit. I've checked the pin outs, there is no additional libraries needed for the 74HC595s, and a lot of the times they enabled serial but did nothing with it. I couldn't even find another individual online who may have built this and coded it as well. So I however, have made my own sample coding, a chase sequence that is pretty compact in terms of coding footprint.

int latchPin = 8; 
int clockPin = 12;
int dataPin = 11;

void setup() {
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
  for (int i = 0; i < 8; i++) {
    byte rowBitsToSend = 0;
    byte columnBitsToSend = 0;
    digitalWrite(latchPin, LOW);
    bitWrite(columnBitsToSend, i, HIGH); //advance and light up column
    shiftOut(dataPin, clockPin, MSBFIRST, columnBitsToSend);
    bitWrite(rowBitsToSend, 8, HIGH); //enables all LEDs in the row
    shiftOut(dataPin, clockPin, MSBFIRST, rowBitsToSend);
    digitalWrite(latchPin, HIGH);
    delay(100);  //controls speed, fastest visible is about a 25ms delay
  }
}

On that note I was wondering if there was anyone that knows of a simple way of addressing each pin of the 74HC595s individually so I can start making some more interesting light sequences?
There was another project I was trying to work on in the past with 74HC595s, but all I ended up doing was using someone's pre-constructed library to make visible numbers with 7 segment LEDs....which on top of that didn't help me learn anything. AND I attempted to chain 2x shiftout registers together and all they would do is hand each other's numbers down to each other.

The only SMD LED shield I can find documentation for is the 9x17 Charlieplexed SMD version of the "LoL Shield". The makershed.com site shows only "Service Unavailable" for any page I try.

Have you got a pointer to the device you are trying to write sketches for?

johnwasser:
The only SMD LED shield I can find documentation for is the 9x17 Charlieplexed SMD version of the "LoL Shield". The makershed.com site shows only "Service Unavailable" for any page I try.

Have you got a pointer to the device you are trying to write sketches for?

Sorry for delay, thought it would pull up on search easily.

link to product...

Should be additional links to get to their sample coding on that page.

Very strange. The board has two shift registers for 64 red LEDs which implies multiplexing but the first example code they point to seems to imply that there are 8 red and 8 green LEDs and each is connected to the output of a shift register. o.0

The second example seems to much better match the hardware. If should display a sequence of 6 frames over and over. Give it a try:

https://raw.github.com/Make-Magazine/SMD-Shield/master/SPW/SMDLEDShield3/SMDLEDShield3.ino

If that works you should be able to use that code to display any sequence of patterns you like. It is easier to see the patterns when they are written in binary instead of decimal:

byte sequence[][8] = {
{
0b11111111,
0b10000001,
0b10000001,
0b10000001,
0b10000001,
0b10000001,
0b10000001,
0b11111111
} , 
{
0b00000000,
0b01111110,
0b01000010,
0b01000010,
0b01000010,
0b01000010,
0b01111110,
0b00000000
} , 
{
0b00000000,
0b00000000,
0b00111100,
0b00100100,
0b00100100,
0b00111100,
0b00000000,
0b00000000
} , 
{
0b00000000,
0b00000000,
0b00000000,
0b00011000,
0b00011000,
0b00000000,
0b00000000,
0b00000000
} , 
{
0b00000000,
0b00000000,
0b00111100,
0b00100100,
0b00100100,
0b00111100,
0b00000000,
0b00000000
} , 
{
0b00000000,
0b01111110,
0b01000010,
0b01000010,
0b01000010,
0b01000010,
0b01111110,
0b00000000
} 
};

johnwasser:
Very strange. The board has two shift registers for 64 red LEDs which implies multiplexing but the first example code they point to seems to imply that there are 8 red and 8 green LEDs and each is connected to the output of a shift register. o.0

The second example seems to much better match the hardware. If should display a sequence of 6 frames over and over. Give it a try:

https://raw.github.com/Make-Magazine/SMD-Shield/master/SPW/SMDLEDShield3/SMDLEDShield3.ino

If that works you should be able to use that code to display any sequence of patterns you like. It is easier to see the patterns when they are written in binary instead of decimal:

byte sequence[][8] = {

{
0b11111111,
0b10000001,
0b10000001,
0b10000001,
0b10000001,
0b10000001,
0b10000001,
0b11111111
} ,
{
0b00000000,
0b01111110,
0b01000010,
0b01000010,
0b01000010,
0b01000010,
0b01111110,
0b00000000
} ,
{
0b00000000,
0b00000000,
0b00111100,
0b00100100,
0b00100100,
0b00111100,
0b00000000,
0b00000000
} ,
{
0b00000000,
0b00000000,
0b00000000,
0b00011000,
0b00011000,
0b00000000,
0b00000000,
0b00000000
} ,
{
0b00000000,
0b00000000,
0b00111100,
0b00100100,
0b00100100,
0b00111100,
0b00000000,
0b00000000
} ,
{
0b00000000,
0b01111110,
0b01000010,
0b01000010,
0b01000010,
0b01000010,
0b01111110,
0b00000000
}
};

Yeah there second sample code doesn't work....it just lights up one whole column and thats it.

I've been looking for an easier method than just decimals. Is that all you would need to type into the code to get it to shift out bytes? I need help implementing something like that for multiple projects. Just trying to get a visual demonstration of the code, I follow and learn better by visual examples.

Since there seem to be no published schematics and no working examples we will have to determine the schematic by experiment. If you run the following code, exactly what pattern do you get?

In theory it should light each LED for 1/10th of a second in a regular pattern. By knowing the pattern you get we can determine what shift-register pins are connected to the various rows and columns

const int latchPin = 8; 
const int clockPin = 12;
const int dataPin = 11;

void setup() {
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
  for (int row = 0; row < 8; row++) {
    for (int column = 0; column < 8; column++) {
      digitalWrite(latchPin, LOW);
      shiftOut(dataPin, clockPin, MSBFIRST, 1<<column);  // One column HIGH
      shiftOut(dataPin, clockPin, MSBFIRST, ~(1<<row));  // One row LOW
      digitalWrite(latchPin, HIGH);
      delay(100);  //controls speed, fastest visible is about a 25ms delay
    }
  }
}

johnwasser:
In theory it should light each LED for 1/10th of a second in a regular pattern. By knowing the pattern you get we can determine what shift-register pins are connected to the various rows and columns

I have the same issue, Here is animated gif of what that code looks like in action

I can only get the columns to light up, never the rows.

Not sure if it's just your gif animation but there is something different about the final column (bottom row as shown in animation)

The last column seems to count down individual LEDs. I used a gif to capture what more accurately what my eye sees.
I should mention that the Animated GIF is not a complete loop, the last column does cycle thru each of the 8 LED individually.
High Res photos of the shield front and back:

Try swapping the Row and Column registers by changing:

      shiftOut(dataPin, clockPin, MSBFIRST, 1<<column);  // One column HIGH
      shiftOut(dataPin, clockPin, MSBFIRST, ~(1<<row));  // One row LOW

to:

      shiftOut(dataPin, clockPin, MSBFIRST, ~(1<<row));  // One row LOW
     shiftOut(dataPin, clockPin, MSBFIRST, 1<<column);  // One column HIGH

See what pattern you get then.

johnwasser:
Try swapping the Row and Column registers by changing:

      shiftOut(dataPin, clockPin, MSBFIRST, ~(1<<row));  // One row LOW

shiftOut(dataPin, clockPin, MSBFIRST, 1<<column);  // One column HIGH



See what pattern you get then.

Its rather strange result. I have feeling the second 595 is NOT sending out a "High". The last row is cycling a LED off from top to bottom

The last column is cycling a LED off from top to bottom.

OK, let's try swapping polarity (HIGH for LOW) by changing:

      shiftOut(dataPin, clockPin, MSBFIRST, ~(1<<row));  // One row LOW
     shiftOut(dataPin, clockPin, MSBFIRST, 1<<column);  // One column HIGH

to:

      shiftOut(dataPin, clockPin, MSBFIRST, 1<<row);  // One row LOW
     shiftOut(dataPin, clockPin, MSBFIRST, ~(1<<column));  // One column HIGH
const int latchPin = 8; 
const int clockPin = 12;
const int dataPin = 11;

void setup() {
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
  for (int row = 0; row < 8; row++) {
    for (int column = 0; column < 8; column++) {
      digitalWrite(latchPin, LOW);
      shiftOut(dataPin, clockPin, MSBFIRST, 1<<row);  // One row LOW
      shiftOut(dataPin, clockPin, MSBFIRST, ~(1<<column));  // One column HIGH
      digitalWrite(latchPin, HIGH);
      delay(60);  //controls speed, fastest visible is about a 25ms delay
    }
  }
}


Woah! Well I see the last column has some potential. Still no full Rows. The Columns cycle completl

I'm not sure but I think maybe that bizarre pattern might come from the Clock and Data pins being swapped. Try switching them to:

const int latchPin = 8; 
const int clockPin = 11;
const int dataPin = 12;

johnwasser:
I'm not sure but I think maybe that bizarre pattern might come from the Clock and Data pins being swapped. Try switching them to:

const int latchPin = 8; 

const int clockPin = 11;
const int dataPin = 12;

Zero LED's lit up. I will manually test the Clock and Data pins.
BTW: found the datasheet on the Two 595 http://www.nxp.com/documents/data_sheet/74HC_HCT595.pdf

OK, so that probably means that the Data and Clock pins were right before. :frowning:

How about changing "MSBFIRST" to "LSBFIRST" to see what that does to the pattern?

I can't think of a reason why only the last row lights up one at a time while the first seven rows light up all at once.

johnwasser:
OK, so that probably means that the Data and Clock pins were right before. :frowning:

How about changing "MSBFIRST" to "LSBFIRST" to see what that does to the pattern?

I can't think of a reason why only the last row lights up one at a time while the first seven rows light up all at once.

I manually tested every pin and LED. To my surprise every single LED was inverted (cathode,anode). Looking back at the instructions I found the culprit. The assembly instructions are wrong, they invert the cathode. Funny thing is that the packaging image shows the correct placement of the LED's, but the instructions completely show the opposite. I have contacted Make Magazine. Thanks again so much for your help. Once I get a new Shield I will let know which code actually worked. My goal is to build a 80's boom box inspired Audio Spectrum Analyzer.

With a symmetric 8x8 matrix driven directly from the shift registers it shouldn't matter which way around the LEDs are mounted as long as they are all the same. :frowning:

I wonder how they get the horizontal traces and vertical traces to pass each other without connecting. What does the circuit board look like under those LEDs? It's strange that your trace don't look the same as the ones in the MAKE article:

I tested the traces (as much as I could) and they all seem to be connected where they shouldn't, The last Column is the only one I was able to manual light the LEDs one by one. When I apply a little voltage to any LED, the entire Column lights. (except the last Column)
Also I have a few spare SMD LEDs left from this project, I tested them and I can confirm the Green Line is the Cathode.

Wow you are totally right the positive end trace is not even visible on this image.