Show Posts
Pages: 1 ... 8 9 [10]
136  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: 3 595 ic's and an 8x8 led matrix on: February 21, 2010, 07:54:17 am
Hi,

Thanks for all the help everyone! I got a lot further last night and I kind of figured it out but I know that I am way off base. With much effort I was able to make a green square and a smaller red square. However, there is a faint green line going down the center-right or the matrix and I don't know why. As you can see in the picture it's making the right of the red square turn a little orange:  http://tiny.cc/TktdA  
My hook up is exactly like in the shiftOut tutorial (http://www.arduino.cc/en/Tutorial/ShiftOut) just with a 3rd 595 cascaded...and I did not use a capacitor as I do not have one. But they said that was for the flicker and I don't have any flicker. Maybe this would be easier with some line decoders? Is that what people more typically use for these matrices? I have a couple M74HC23881's which default on LOW...just seems like it would be tedious to draw pixel by pixel...
So..here is my embarrassing code. I know there must be an easier way but...

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


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

void loop() {
//green square  
    digitalWrite(latchPin, LOW);  
            shiftOut(dataPin, clockPin, MSBFIRST, 255);  //controls the green 595 (#3)
            shiftOut(dataPin, clockPin, MSBFIRST, 126);  //controls the rows 595 (#2)
            shiftOut(dataPin, clockPin, MSBFIRST, 0);    //controls the red 595 (#1)
    digitalWrite(latchPin, HIGH);
    
      digitalWrite(latchPin, LOW);  
            shiftOut(dataPin, clockPin, MSBFIRST, 255);  
            shiftOut(dataPin, clockPin, MSBFIRST, 254);  
            shiftOut(dataPin, clockPin, MSBFIRST, 0);
    digitalWrite(latchPin, HIGH);
    
          digitalWrite(latchPin, LOW);  
            shiftOut(dataPin, clockPin, MSBFIRST, 128);  
            shiftOut(dataPin, clockPin, MSBFIRST, 0);  
            shiftOut(dataPin, clockPin, MSBFIRST, 0);
    digitalWrite(latchPin, HIGH);
    
        digitalWrite(latchPin, LOW);  
            shiftOut(dataPin, clockPin, MSBFIRST, 1);  
            shiftOut(dataPin, clockPin, MSBFIRST, 0);  
            shiftOut(dataPin, clockPin, MSBFIRST, 0);
    digitalWrite(latchPin, HIGH);
//end green square

//make a smaller red square//
   digitalWrite(latchPin, LOW);  
            shiftOut(dataPin, clockPin, MSBFIRST, 0);  
            shiftOut(dataPin, clockPin, MSBFIRST, 195);  
            shiftOut(dataPin, clockPin, MSBFIRST, 36);
    digitalWrite(latchPin, HIGH);
    
      digitalWrite(latchPin, LOW);  
            shiftOut(dataPin, clockPin, MSBFIRST, 0);  
            shiftOut(dataPin, clockPin, MSBFIRST, 219);  
            shiftOut(dataPin, clockPin, MSBFIRST, 60);
    digitalWrite(latchPin, HIGH);
    
          digitalWrite(latchPin, LOW);  
            shiftOut(dataPin, clockPin, MSBFIRST, 0);  //i don't know why I need
            shiftOut(dataPin, clockPin, MSBFIRST, 255);// these last two sections  
            shiftOut(dataPin, clockPin, MSBFIRST, 0);  // with 255 but when I take
    digitalWrite(latchPin, HIGH);                      //them out my red square loses
                                                       // a row
        digitalWrite(latchPin, LOW);  
            shiftOut(dataPin, clockPin, MSBFIRST, 0);  
            shiftOut(dataPin, clockPin, MSBFIRST, 255);  
            shiftOut(dataPin, clockPin, MSBFIRST, 0);

//end red square



  }
137  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: 3 595 ic's and an 8x8 led matrix on: February 20, 2010, 07:02:11 pm
Hi,

Thanks for the help.
But that is for a 16 pin matrix...mine has 24 pins. And also I just want to figure out how to use these 595s better...so I could run a few of these matrices at once.

138  Forum 2005-2010 (read only) / Frequently-Asked Questions / 3 595 ic's and an 8x8 led matrix on: February 20, 2010, 06:52:39 pm
Hello,

I have 3 74HC595 chips cascading to power a dual-color, 24-pin, LED matrix from sparkfun (see datasheet here: http://www.sparkfun.com/commerce/product_info.php?products_id=682) I mostly set everything up like the shiftOut tutorial here (http://www.arduino.cc/en/Tutorial/ShiftOut) except instead of single LEDs the 595 pins are going into the 24 pins of the LED matrix.

I want to be able to control this matrix dot by dot, write words, make a smiley face, whatever. I can hook up a pot and with shiftOut(dataPin, clockPin, MSBFIRST, pot); lights will move around...but I don't understand why they do what they do.

In the first 595, the one that goes to the Arduino, i have the 8 pins used for the red columns of the matrix. In the second 595, I have it cascaded into 595 #1 (just like in the shiftOut tutorial) and all those go to the 8 pins for the rows of the matrix. The last 595 goes to the green columns in the matrix. I also set that up just like I set up #2.

The way i thought it would be was that I would give for my value a decimal number that would correspond to a binary number that would control the pins in the 595's. For example if i said value = 2, that would be a 00000010 in binary. Therefore, the 2nd pin in the 595 would go to high. That works; but, if i want to make, say, the third pin in the second 595 go to high AND the 7th pin in the 1st 595 how do i do that? i thought it would simply be 00000100 01000000 or 1088 in decimal...but that doesn't work. i instead get the 7th pin going high in 595 #1 and 595 #3 (??) and i the last pin appears to go high in  595 #2...I have no idea why this is. (I am also doing shiftOut(dataPin, clockPin, MSBFIRST, (value>>smiley-cool); if the number is greater than 255)

I hope i'm being clear...I think i'm pretty over my head here...I've been trying to figure this out all day. Any help on how to cascade and control these 595s would be much appreciated. Maybe I'm using the wrong ICs for this job...

Thanks so much!
139  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: avrdude verification error on: March 02, 2010, 07:33:40 am
Hi thanks.  The correct board was selected on both machines as well as the correct serial port. Any other ideas?
140  Forum 2005-2010 (read only) / Frequently-Asked Questions / avrdude verification error on: March 01, 2010, 10:00:03 pm
I've been moving for the past week and haven't used my arduino duemilanova in awhile. Today I sat down with it and anything I try to upload I get the error:
Avrdude: verification error. First mismatch at byte 0x0002
                         0x61 != 0x63
Avrdude: verification error. Content mismatch

The power light is on, the L led on the board pulsates I get normal startup LEDs (I think). Did I break it? I get the same error on a win7 desktop and ubuntu laptop. Tried different usb chords. Uploading different samples. Restarting the board. I googled around and couldn't really find anything. If its broken is replacing the atmega 328 enough?
Any advice is much appreciated!!
141  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: 3-8 line decoders on: February 09, 2010, 05:12:38 pm
Hello,

Wow thanks for the quick replies! So I'm curious...what are those chips I ordered (the MM74HCT138N)? Is there anything I could do with them? (it's okay they were just free samples) On the wikipedia entry for 138 it says "3 to 8-line Decoder/Demultiplexer"  (no idea what the MM means also) and the 595 is "Serial-in Shift register with Output Latches." I don't actually know what any of that means...the 238 on sparkfun says it's "1-of-8 Decoder/Demultiplexer, Active High Outputs." Could I run that ShiftOut (http://www.arduino.cc/en/Tutorial/ShiftOut) tutorial with the chip from Sparkfun?

I'm not looking to do any PWM quite yet...just want some DIP packaged chips I can slap on a breadboards...

Thanks so much again for any help...
142  Forum 2005-2010 (read only) / Frequently-Asked Questions / 3-8 line decoders on: February 09, 2010, 04:47:08 pm
Hello,

I want to try out the arduino ShiftOut tutorial (I can't post links yet) because I want to use around 50 or so RGB LEDs on one duemilanove (I know it's a lot...is it possible?). Could anyone point me to any info explaining what the numbers in these chips mean? In the tutorial it says to use a 74HC595 3-8 line decoder. Sparkfun sells a 74HC238 and I just ordered a sample from fairchild of MM74HCT138N. But they are all 3-8 line decoders, all appear to be CMOS and they all have that 74HC in them. What is the difference? Would I be able to run that tutorial with the chips I ordered?

Thanks so much for any help!
Pages: 1 ... 8 9 [10]