6 digit 7 Segment display - TPIC6B595 schematic component?

Yes, they are daisy chained.

Is there a standard way they should be hooked up? Like, should the first display be on the far left or far right?
Here is what I show with my display and how it's hooked up.

Serial In goes to #1, then Serial out of 1 goes to in of #2, etc...

Using your suggestions, here is my test code. Works so far.

// Test sketch using 6 TPIC6B595 shift registers
#include <SPI.h>

const static byte charTable[128] = {
  // B-DP-g-f-e-d-c-b-a
  //    a 
  //f       b
  //    g
  //e       c
  //    d       DP
  
  //0         1         2         3         4         5         6         7
    B00111111,B00000110,B01011011,B01001111,B01100110,B01101101,B01111101,B00000111,
  //8         9
    B01111111,B01100111
};

const byte LATCH = 10;     //Arduino Latch Pin = 10
const byte NumberOfSR = 6; //Number of Shift Registers

byte DisplayData [NumberOfSR]; //Array for numbers that go in the 6 digit display

void refreshDisplay ()
{
  digitalWrite (LATCH, LOW);
  for (byte i = 0; i < NumberOfSR; i++)
    SPI.transfer (DisplayData [i]); 
  digitalWrite (LATCH, HIGH);
}

void clockDisplay ()
{
  DisplayData [0] = charTable[1];
  DisplayData [1] = charTable[2];
  DisplayData [2] = charTable[3];
  DisplayData [3] = charTable[4];
  DisplayData [4] = charTable[5];
  DisplayData [5] = charTable[6];
  refreshDisplay ();
}

void setup ()
{
  SPI.begin ();
}
  
void loop ()
{
    clockDisplay ();
}

I'll most likely use the decimal points for my lights and just use 2 more TPIC6B595's for the other 2 larger digits. Or, I may even use another 595 for the lights. That way I can daisy chain everything with some headers & cables.

The way its coded, it will display 654321.
Its up you to define what goes where, there isn' a standard.

You have no current limit resistors? That will burn out your LEDs eventually. The TPIC6B595 can sink a lot of current.

CrossRoads:
The way its coded, it will display 654321.

Its up you to define what goes where, there isn' a standard.

Ok, that's what I thought.

CrossRoads:
You have no current limit resistors? That will burn out your LEDs eventually. The TPIC6B595 can sink a lot of current.

I have 1 small resistor on each of the common anodes of the 7 segment displays. I sized it so if I was displaying the number 1, it would be about 10mA. If I show an 8, the display dims more. I would add resistors to each individual led for my final project, but I didn't want to put in 42 resistors on my breadboard for this. (plus I didn't have that many on hand)

Ok, so I'm starting to get together a list of components for my full size prototype, and I'm thinking about power requirements.

Can anyone help me or point me in the right direction with batteries?

For instance, I'm looking at 2 LiPo batteries. One is 5500mAh at 7.5V and the other is 5500mAh at 15.0V. I plan on using a DC-DC switching regulator to step down the battery voltage to 5V for the Arduino (like this: http://www.digikey.com/product-detail/en/OKI-78SR-5%2F1.5-W36-C/811-2196-5-ND/2259781?cur=USD) and use the voltage straight from the battery to power the LED displays. (good / bad idea?)

For the sake of simplicity, lets say each of my display segments uses 6 LEDs and each LED is 2.5V. So, for my 7.5V battery I could wire 2 rows of 3 LEDs in series and for my 15V battery I could wire 6 LEDs in series (correct?)

Now with my battery, will my displays last just as long, since each battery is 5500mAh?

If you wanted 6 LED segments, you would need 2 segments of 3 series-wired LEDs driven in parallel, consuming 40mA from a 7.5V source,
or, 1 segment of 6 series wired LEDs consuming 20mA from a 15V source.
You could use a TPIC6B595 to sink the 20mA or 40mA from the segments.
If you had 3 pairs of 2-LED strings then you would consume 60mA/segment.
Take advantage of the higher voltage & decreased current by running more LEDs in series.

Convert enough 5V current to power the '328P and the shift registers if you go that route.

Ok, I think I understand. As for the battery, I'll probably go 15V w/switching regulator.

Some more updates. I have my breadboard now hooked up to my GPS and it is pulling in the GPS time and displaying it on the 6 digit displays. I also have a 4 line 20 character LCD screen. It is hooked up to the Arduino via a Software Serial connection. I have both the 6 digit LED displays and the 4 line LCD displaying the time from GPS.

Now, my problem. The LCD lags behind the 6 digits. It is around a half second delay.
Is this because there is a long delay with using Serial? Or could it be the cheap screen I'm using?

Can you increase the transission speed to the LCD?

Or update the LCD first, then update the 7-segments.

From the LCD datasheet, it looks like I can change the BAUD rate with a command. The default is 9600. The display can go all the way to 115.2K. I'll try changing it tonight and see if I get better results.

Also, the LCD display can be controlled by either Serial, I2C, or SPI. Is one better over the other?

SPI is the fastest for getting the date there. I use it as much as I can.

I changed the baud rate for the LCD screen and it didn't change how the 2 displays were out of sync. So, I'm thinking that it is either: code related, using serial with the display is slow, or the display is just slow regardless. I'll try using SPI with it. (I just need to solder on a few more pins to my lcd)

Now, if I want to use SPI with the LCD screen, do I just daisy chain the MOSI & SCK lines from my 7 segment displays along with adding another line from my Arduino as a second Latch?

Some other questions...
1. I've noticed that my LCD screen flickers. It seems to be in time with when it updates every second. Could this is something to do with the power? Speaking as a non-electronics guy, if it is power related (and not simply a cheap screen with inherent defects) would adding a capacitor help? If so, how do I add it into my circuit? (polarized electrolytic across + to - at the display?)

2. Looking at 7 segment LED display, the time sometimes skips over a second or laggs. Like it will display 11:40:01 then 11:40:03. I'm using the example code from the Adafruit website to grab the GPS time. Like this:

// if a sentence is received, we can check the checksum, parse it...
if (GPS.newNMEAreceived()) {
    GPS.parse(GPS.lastNMEA());   // this also sets the newNMEAreceived() flag to false
    
    // Update our clock variables with the GPS time
    clocksecond = GPS.seconds;
    clockminute = GPS.minute;
    clockhour = GPS.hour;
}

I then use my clock variables to set the numbers on the display. Could it be that the GPS isn't always sending out an update every 1 second? The GPS is using a SoftwareSerial connection to the Arduino. Could that be part of the reason? Or, could it be taking the Arduino longer to parse the serial data at one time and less at another time?

Or, should I be going about getting the time from the GPS in a different way? I was searching around and came upon this post:
http://forums.parallax.com/showthread.php/116008-How-accurate-can-a-data-quot-time-stamp-quot-be-made-for-a-GPS-with-the-Propeller?p=840749&viewfull=1#post840749

Yeah, typically the serial data starts transmission on the PPS, but at 9600bps, it can be a long time before you actually get your data out of it (and it's not really convenient to watch for an edge on serial data like it is to watch for a PPS line). I typically watch for the PPS, then I know what time that PPS was by reading the GPS data that follows it.

There is a PPS pin on the GPS unit. Anyone have experience with using this? I might try posting my question over on the Adafruit forum...

"Now, if I want to use SPI with the LCD screen, do I just daisy chain the MOSI & SCK lines from my 7 segment displays along with adding another line from my Arduino as a second Latch?"

Yes.

Adding a cap:
"If so, how do I add it into my circuit? (polarized electrolytic across + to - at the display?)"

Parsing the message, or how often the GPS updates: have to work that out in your code.
If it has a seperate 1 pulse per second (PPS) pin, you could capture the time and then update with the 1 PPS signal, doing a time reading every once in while to make sure you're still in sync.
Yes.

Ok, seems simple enough. I'll have to dig through the datasheet on the LCD screen and see how I need to modify my code to send it text using SPI.

As for the PPS signal, I haven't played around with providing any input to the Arduino. I guess I need to look into the pulseIn information?

I added a 16V 1000uF electrolytic polarized capacitor to the power going into the LCD screen. Didn't change the flickering. It seems to flicker whenever it is refreshed. I played around with the code some and only have it refresh every 10 seconds. When it is just static there is no flickering. (also, the flickering seems to be coming from the LEDs that act as the backlight)

The only things I can think of that would be the cause of the flickering are: power or cheap LCD. :~ Could the Arduino not be able to deliver enough current to the screen when it refreshes? The datasheet says it typically draws 250mA. (doesn't give a min or max, just typical)

The other thing I noticed is that the time displayed on my 7 segment display is slow by about 1/2 to 3/4 of a second. (I compared it to a SkyScan atomic clock and an online clock) I don't need my clock to be crazy accurate, but 1/2 to 3/4 of a second is off too much. Could it be taking this long for the GPS to send the NEMA data to the Arduino, have the Arduino parse it out, then use it to set the time? Would the update go any faster if the GPS was hooked into the hardware serial pins 0 & 1 TX/RX?

I did a simple test and hooked up the PPS signal wire to a teeny tiny speaker and could hear the pulses every second. They matched exactly (as best my ears could tell) to the seconds from both of my clocks. So, I think a plan would be to have the Arduino listen to and count the pulses and use that to sync for the clock. Unless anyone has suggestions. I'm all ears. :slight_smile:

I'm having trouble using the PPS on the GPS unit to trigger an interrupt. I posted a new question here: http://arduino.cc/forum/index.php/topic,154776.0.html if anyone wants to follow along/help.

As an update, I bought a few different kinds of LEDs to see which ones I like best. I got some of the Cree 5-mm Red 3000mcd - 12000mcd high luminous intensity LEDs. Holy crap those things are bright. I could barely look at them outdoors, much less indoors running at 20mA. I think I still see spots. :fearful:

I have some 5mm ultrabright white LEDs - am only running them at 2-3mA due to the brightness. Wow!

I'm starting to layout some components for my displays. Are there any pros or cons for placing the 595's? Should I group all of them together on a board and then run 8 LED drain wires to each of my 7 segment displays? Or, place 1 595 at each 7 segment display and run 3 wires (MOSI, SS, SCLK) from the arduino to each display?

Having them all on one board and then running a ribbon cable to each display is a nice clean way to go, keeps your SPI signals all in 1 place.
Essentially this:
http://www.crossroadsfencing.com/BobuinoRev17/
bare boards available for $6 mailed to US locations.

I've been considering getting your board. Then I was thinking, if I'm going to make boards for the 7 segment LED displays, would it be ok to put the 595 on those boards. That way I'm only running 3 wires instead of 8. Just wondering what the pros/cons are, besides the obvious of 3 wires vs. 8 wires (plus pos. & neg.)

I'm playing around with Eagle right now (learning that software) so thoughts like this are bouncing around in my head.