Pages: [1]   Go Down
Author Topic: Using TPIC6B595N or MAX7219  (Read 1167 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 39
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

I'm looking for the best way to control 110 individual LEDs. At the moment I'm using a HCF4094 and a ULN2003A driver for my first matrix and this is working well. Than someone suggested to use TPIC6B595N or a MAX7219

Now my question are:
  • can you control 64 LEDs by using 2 TPIC6B595N or woud you still require something linke the ULN2003 driver?
  • would it be more interesting to use the TPIC6B595N or MAX7219 in the end

Thanks!
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1) definitively. You should be able to get below 200us per 64 leds / frame with some programming tricks, or 500us to save a couple pins, on a 16MIPS avr.
2) depends on what you perceive as "interesting".
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 39
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So I have been trying to make a very easy setup to test the chip.

The setup is:

To find by clicking here so I don't screw up the topic smiley

Code is below but I'm not getting a single blink...

Code:
/*
 Shift Register Example
 for TPIC6B595 shift register by Jens C Brynildsen

 This sketch turns reads serial input and uses it to set the pins
 of a TPIC6B595 shift register.

 Hardware:
 * TPIC6B595 shift register attached to pins 7, 8, 11 and 12 of the Arduino,
 as detailed below.
 * LEDs attached to each of the outputs of the shift register

 Based on the example created 23 Mar 2010 by Tom Igoe

 */

//Pin to clear the register
const int clearPin = 7;
//Pin connected to latch pin (ST_CP) of 74HC595
const int latchPin = 9;
//Pin connected to clock pin (SH_CP) of 74HC595
const int clockPin = 10;
////Pin connected to Data in (DS) of 74HC595
const int dataPin = 11;

int counter = 0;
int numLedsInUse = 8;

void setup() {
  //set pins to output because they are addressed in the main loop
  pinMode(clearPin, OUTPUT);
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);  
  pinMode(clockPin, OUTPUT);
  Serial.begin(9600);
  Serial.println("*");
  
  // delay a little and then set
  delay(100);
  // Always start by sentting SRCLR high
  digitalWrite( clearPin, HIGH);
}

void loop() {
  // Display LED's running
  if( counter >= (numLedsInUse-1) ){
    counter = 0;
  } else {
    counter++;
  }
  
  // write to the shift register with the correct bit set high:
  registerWrite(counter, HIGH);
  delay( 100 );
}

// This method sends bits to the shift register:

void registerWrite(int whichPin, int whichState) {
  // the bits you want to send
  byte bitsToSend0 = 0;
  // write number as bits
  bitWrite(bitsToSend0, whichPin, whichState);

  // turn off the output so the pins don't light up
  // while you're shifting bits:
  digitalWrite(latchPin, LOW);
  
  // shift the bits out
  shiftOut(dataPin, clockPin, MSBFIRST, bitsToSend0);

  // turn on the output so the LEDs can light up:
  digitalWrite(latchPin, HIGH);
}
« Last Edit: November 29, 2012, 03:18:24 pm by Stijn » Logged

USA, FL
Offline Offline
God Member
*****
Karma: 14
Posts: 689
A life? Where can I download one of those?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

From the schematic, your pin declarations are wrong.  

You have pins 5, 6 and 8 on the schematic and 7, 9, 10 and 11 in the sketch.

Just change your jumpers to match the code.

« Last Edit: November 29, 2012, 11:13:07 pm by codlink » Logged

//LiNK

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27357
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The TPIC6B595 can only pull pins low. Current limit resistors to +5V drive the anodes high, the '595 outputs bring  the cathodes low to turn them on.
Logged

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.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 39
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

From the schematic, your pin declarations are wrong.  

You have pins 5, 6 and 8 on the schematic and 7, 9, 10 and 11 in the sketch.

Just change your jumpers to match the code.



Hi

Yes, that's an error between computer design and real life smiley but it is ok, the pins are as they are in the code... very good observation but that's not the issue..
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 39
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The TPIC6B595 can only pull pins low. Current limit resistors to +5V drive the anodes high, the '595 outputs bring  the cathodes low to turn them on.

Hi

Sorry but I'm pretty new to electronics so this might be stupid... does this mean that I have to connect the positive side of my led to my 5v and my negative to my resistor and to the TPIC6B595N? I made a new sketch like this.

In any case, I'm basing my design on this link. My original question was if it would be better and possible to use 2 times the TPIC6B595N to build a matrix, if I understood correctly this is not possible?

Thanks!
« Last Edit: November 30, 2012, 01:37:19 am by Stijn » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27357
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes -
+5 - resistor - anode, cathode to TPIC6B595

Sure, can use two TPIC6B595.

One will control current into the anodes, one will sink current from the cathodes.
Connect the anode control between the resistor and the anode.

Connect 2nd TPIC6B595 between resistor & anode.

So, drive the anodes, letting them go hi/low as needed for a column with 8 outputs of one shift register.
WIth the other, pull the cathode low for that 1 column.

Anode current is then either going into the anodes, or into the anode shift register.
Logged

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.

Pages: [1]   Go Up
Jump to: