Numitron Clock

Hi Arduino Guys,

I am building a Numitron Clock, and what i have left to do is the clock part. I was getting help programing it from a buddy, but he is not available tonight. This following code is what we have so far, and the Time.H Library that is found at http://www.arduino.cc/playground/Code/Time

#include <Time.h>



void setup() {
  pinMode(11, OUTPUT);  
  pinMode(10, OUTPUT);     
  pinMode(9, OUTPUT);     
  pinMode(8, OUTPUT); 
  pinMode(7, OUTPUT); 
  pinMode(6, OUTPUT); 
  pinMode(5, OUTPUT); 
  pinMode(4, OUTPUT);
  pinMode(3, OUTPUT); 
  pinMode(2, OUTPUT); 
  pinMode(1, OUTPUT); 
  pinMode(0, OUTPUT);
  pinMode(A0, OUTPUT);
  pinMode(A1, OUTPUT);
  pinMode(A2, OUTPUT);
  pinMode(A3, OUTPUT);
Serial.begin(9600);
  setTime(1,23,36,22,9,2011);
}

void displaytime(int ht, int ho, int mt, int mo) {
 DDRB = B00001111;
  DDRC = B00001111;
  DDRD = B11111111;
  
  PORTB = 0;
  PORTD = 1*16 + 2;
  PORTC = 3;
}
void loop() {
  int mymin = minute();
  int myhour = hour();
  int minone = mymin%10;
  int minten = (mymin-minone)/10;
  int hourone = myhour%10;
  int hourten = (myhour-hourone)/10;
  Serial.println("Time:");
    Serial.println(hourten);
      Serial.println(hourone);
        Serial.println(minten);
          Serial.println(minone);
        
  displaytime(hourten, hourone, minten, minone);
}

The Code above when ported to the clock kinda screws up the display, and i dont really know how to get it to show the time.

I am a programing newb and could use some direction. if more details are needed please ask. ill do the best i can,

PS) Here is an example of a numitron clock if you dont know what a numitron is http://hackadaycom.files.wordpress.com/2011/03/numitron_clock.jpg?w=470&h=353

My apologies.
I built this with an Arduino Uno. The Numitrons are DA-2000 series. http://www.tube-tester.com/sites/nixie/dat_arch/Numitron_Apollo.pdf

I am Driving them with 4 DM7447AN chips DM7447AN datasheet & application notes - Datasheet Archive

pins 11,10,9,8 go to Numitron 1
Pins 7,6,5,4, go to Numitron 2
pins 3,2,1,0 go to Numitron 3
Pins A0,A1,A2,A3 go to Numitron 4

With the following code I can Light the 4 Numitrons with no problems...

/*
  Numitron Arduino Test
 

 */

void setup() {                
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  
  pinMode(11, OUTPUT);  
  pinMode(10, OUTPUT);     
  pinMode(9, OUTPUT);     
  pinMode(8, OUTPUT); 
  pinMode(7, OUTPUT); 
  pinMode(6, OUTPUT); 
  pinMode(5, OUTPUT); 
  pinMode(4, OUTPUT);
  pinMode(3, OUTPUT); 
  pinMode(2, OUTPUT); 
  pinMode(1, OUTPUT); 
  pinMode(0, OUTPUT);
  pinMode(A0, OUTPUT);
  pinMode(A1, OUTPUT);
  pinMode(A2, OUTPUT);
  pinMode(A3, OUTPUT);
digitalWrite(11, LOW);
digitalWrite(10, LOW);
digitalWrite(9, LOW);
digitalWrite(8, LOW);
digitalWrite(7, LOW);
digitalWrite(6, LOW);
digitalWrite(5, LOW);
digitalWrite(4, LOW);
digitalWrite(3, LOW);
digitalWrite(2, LOW);
digitalWrite(1, LOW);
digitalWrite(0, LOW);
digitalWrite(A0, LOW);
digitalWrite(A1, LOW);
digitalWrite(A2, LOW);
digitalWrite(A3, LOW);

}

void loop() {
  
  DDRB = B00001111;
  DDRC = B00001111;
  DDRD = B11111111;
  
  PORTB = 9;
  PORTD = 9*16 + 2;
  PORTC = 1;
  
  delay(1000);              // wait for a second
 
}

This is where I got sent with the sharks. lost trying to get the clock working

I do not have all the answers you are looking for. The Numitrons/ Drivers use Binary numbers to translate to the display
This is where it gets tricky...

PORTB = 9; <this is just test numbers for the display, 9 is the first seg
PORTD = 8*16 + 2; <8 is the second Seg, and the 2 is the 3rd seg
PORTC = 1; < the 1 is the 4th segment

I am not sure what DDRB, DDRC, DDRD, or PORTB, PORTD, PORTC mean...

As far as the code that was given to me, nix it. lets pretend i didn't have it. What would be a proper way to set the arduino display the time on the Numitrons with out additional hardware... I included the Datasheet for the 7477 chips because it might help to see the Function Table. again, my apologies. I really know little about programming, and my friend that was going to help me "stood me up" for a lack of better words.

There are only 4 Input pins on each 7477. B,C,D, & A

As far as the serial.print question, I do not know what that was supposed to do.

thanks for trying to help, I really appreciate it.

These are the data direction control registers for the pins:
DDRB = B00001111; = D8,9, 10,11
DDRC = B00001111; = A0, A1, A2, A3 - refer to these as D14, 15,16, 17 instead
DDRD = B11111111; = D0,1,2,3,4,5,6,7

These seem kind of redundant as you already declare the pins to be outputs in Setup.

As this is a clock and you seem to have time, you could write out the data in a way that makes more sense to you.

Since you are driving Nixie tubes, I think you need some tube driver chips vs the TTL level part DM7447

Moving on:

Once you have the 6 digits broken out into their 0-9 values, then you can set the output pins.

Crude way for byte digitX on pins D8,9,10,11, assume D8 is the LSB and D11 is the MSB for this example
digitalWrite(D8, (digitX & 0x01); // write HIGH out if (digitX & 0x01) is True (i.e. not equal 0)
digitalWrite (D9, (digitX & 0x02);
digitalWrite (D10, (digitX & 0x04);
digitalWrite (D11, (digitX & 0x08);

repeat for the other digits

then check to see if time has changed and update as needed.

I know this is a very old thread. But I'm trying to do the exact same thing. Seems like there's some posts missing in this thread.

Don't worry, those posts won't be coming back, even now you resurrected this necrothread. The original accounts are as dead as this thread was.

patracy:
I know this is a very old thread. But I'm trying to do the exact same thing. Seems like there's some posts missing in this thread.

Post a schematic diagram of your Numitron clock, ensuring that pin numbering of all devices and their interconnections is clear. Step 1 is do a basic display test, writing a small sketch which shows every number on every tube.

patracy:
I know this is a very old thread. But I'm trying to do the exact same thing.

Specifically in this current thread that you started for the purpose. Q.V.